年度变更建库软件5.0版本
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

863 lines
39 KiB

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraTab;
using KGIS.Plugin.LayerProperty.Interface;
using ESRI.ArcGIS.Carto;
namespace KGIS.Plugin.LayerProperty.View.UC_Controls
{
public partial class UCLayerProperties : XtraUserControl
{
private XtraTabPage m_TabFeatureLayer;
private XtraTabPage m_TabFields;
private XtraTabPage m_TabLable;
private XtraTabPage m_TabRasterLayer;
private XtraTabPage m_TabRasterCatalogLayer;
private XtraTabPage m_TabDefinitionQuery;
private XtraTabPage m_TabFeatureRender;
private XtraTabPage m_TabRasterRender;
private XtraTabPage m_TabLayerEffect;
private XtraTabPage m_TabGeodataset;
private XtraTabPage m_TabSelected;
private XtraTabPage m_TabAnnotationSymbologyProperty;
private bool m_IsNew;
private bool m_IsCustomLayer;
private IUCPropertyPageEx ucLablePropertyPage;
private IUCPropertyPageEx ucFeatureLayerProperty;
private IUCPropertyPageEx ucDefinitionQueryProperty;
private IUCPropertyPageEx ucFieldsPropertyPage;
private IUCPropertyPageEx ucRasterLayerPropertyPage;
private IUCPropertyPageEx ucRasterCatalogPropertyPage;
private IUCPropertyPageEx ucFeatureRenderPropertyPage;
private IUCPropertyPageEx ucRasterRenderPropertyPage;
private IUCPropertyPageEx ucLayerEffectPropertyPage;
private IUCPropertyPageEx ucDataSourceProperty;
private IUCPropertyPageEx ucGeneralProperty;
private IUCPropertyPageEx ucAnnotationSymbologyPropertyPage;
private ILayerProperty m_LayerProperty;
private List<IPropertyPage> PropertyPageList;
private ILayer m_Layer;
public object LayerProperty
{
get
{
if (this.m_LayerProperty != null)
{
return this.m_LayerProperty;
}
return this.m_Layer;
}
set
{
if (value is ILayer)
{
this.m_Layer = (value as ILayer);
}
else
{
if (value is ILayerProperty)
{
this.m_LayerProperty = (value as ILayerProperty);
if (this.m_LayerProperty.Layer == null)
{
this.m_LayerProperty.CreateLayer();
}
this.m_Layer = this.m_LayerProperty.Layer;
}
}
this.AddPropertyPages();
}
}
public event System.EventHandler btnOKClick;
public event System.EventHandler btnCancelClick;
public event System.EventHandler btnApplyClick;
public UCLayerProperties()
{
InitializeComponent();
this.PropertyPageList = new List<IPropertyPage>();
}
public UCLayerProperties(bool isNew) : this()
{
this.m_IsNew = isNew;
InitiatePropertyPages();
}
//public void InitUC()
//{
// try
// {
// this.HideAllTabPage();
// if (this.tabGeneralProperty == null)
// {
// this.tabGeneralProperty = new XtraTabPage();
// this.tabGeneralProperty.Text = "基本属性";
// }
// this.AddTabPage(this.tabGeneralProperty);
// if (this.ucGeneralProperty == null)
// {
// this.ucGeneralProperty = new UCGeneralProperty();
// this.ucGeneralProperty.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
// this.ucGeneralProperty.InitUC(null);
// //(this.ucGeneralProperty as UCGeneralProperty).SelectTableChanged += new SelectionChangedEventHandler<AETable>(this.ucGeneralProperty_SelectTableChanged);
// (this.ucGeneralProperty as UCGeneralProperty).Dock = DockStyle.Fill;
// this.tabGeneralProperty.Controls.Add(this.ucGeneralProperty as System.Windows.Forms.Control);
// this.tabGeneralProperty.Tag = this.ucGeneralProperty;
// this.PropertyPageList.Add(this.ucGeneralProperty);
// }
// }
// catch (Exception ex)
// {
// //RdbUtil.AddException(ex);
// }
//}
public bool InitUC(ILayer LayerPropertyObject)
{
try
{
if (LayerPropertyObject == null)
{
//DevExpressMessageDialog.ShowMessageDialog("未设置图层属性!");
return false;
}
this.m_IsCustomLayer = false;
this.HideAllTabPage();
if (this.tabGeneralProperty == null)
{
this.tabGeneralProperty = new XtraTabPage();
this.tabGeneralProperty.Text = "基本属性";
this.tabGeneralProperty.AutoScroll = true;
}
this.AddTabPage(this.tabGeneralProperty);
if (this.ucGeneralProperty == null)
{
this.ucGeneralProperty = new UCGeneralProperty();
this.ucGeneralProperty.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
//(this.ucGeneralProperty as UCGeneralProperty).SelectTableChanged += new SelectionChangedEventHandler<AETable>(this.ucGeneralProperty_SelectTableChanged);
this.ucGeneralProperty.Dock = DockStyle.Fill;
this.tabGeneralProperty.Controls.Add(this.ucGeneralProperty as System.Windows.Forms.Control);
this.tabGeneralProperty.Tag = this.ucGeneralProperty;
this.PropertyPageList.Add(this.ucGeneralProperty);
}
this.ucGeneralProperty.InitUC(LayerPropertyObject);
this.LayerProperty = LayerPropertyObject;
this.btnApply.Enabled = false;
this.ucGeneralProperty.IsPageDirty = false;
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
return true;
}
//public bool InitUC(ILayerProperty LayerPropertyObject)
//{
// try
// {
// if (LayerPropertyObject == null)
// {
// //DevExpressMessageDialog.ShowMessageDialog("未设置图层属性!");
// return false;
// }
// this.m_IsCustomLayer = true;
// this.HideAllTabPage();
// if (this.tabGeneralProperty == null)
// {
// this.tabGeneralProperty = new XtraTabPage();
// }
// this.tabGeneralProperty.Text = "基本属性";
// this.tabGeneralProperty.AutoScroll = true;
// this.AddTabPage(this.tabGeneralProperty);
// if (this.ucGeneralProperty == null)
// {
// this.ucGeneralProperty = new UCGeneralProperty();
// this.PropertyPageList.Add(this.ucGeneralProperty);
// this.ucGeneralProperty.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
// //(this.ucGeneralProperty as UCGeneralProperty).SelectTableChanged += new SelectionChangedEventHandler<AETable>(this.ucGeneralProperty_SelectTableChanged);
// this.ucGeneralProperty.Dock = DockStyle.Fill;
// this.tabGeneralProperty.Controls.Add(this.ucGeneralProperty as System.Windows.Forms.Control);
// this.tabGeneralProperty.Tag = this.ucGeneralProperty;
// }
// this.ucGeneralProperty.InitUC(LayerPropertyObject);
// this.LayerProperty = LayerPropertyObject;
// this.btnApply.Enabled = false;
// this.ucGeneralProperty.IsPageDirty = false;
// }
// catch (Exception ex)
// {
// //RdbUtil.AddException(ex);
// }
// return true;
//}
private void ucGeneralProperty_EditorChanged(object sender, System.EventArgs e)
{
this.btnApply.Enabled = true;
}
private void AddTabPage(XtraTabPage tabPage)
{
if (!this.TabControlMain.TabPages.Contains(tabPage))
{
this.TabControlMain.TabPages.Add(tabPage);
}
tabPage.PageVisible = true;
if (tabPage == this.m_TabSelected)
{
this.TabControlMain.SelectedTabPage = this.m_TabSelected;
}
}
private void HideAllTabPage()
{
foreach (XtraTabPage xtraTabPage in this.TabControlMain.TabPages)
{
xtraTabPage.PageVisible = false;
}
}
private void RemoveOtherPage()
{
try
{
for (int i = 1; i < this.TabControlMain.TabPages.Count; i++)
{
XtraTabPage xtraTabPage = this.TabControlMain.TabPages[i];
this.PropertyPageList.Remove(xtraTabPage.Tag as IPropertyPage);
this.TabControlMain.TabPages.RemoveAt(i);
i--;
}
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void AddPropertyPages()
{
try
{
if (this.m_Layer != null)
{
if (this.m_Layer is IDataLayer)
{
this.AddGeoDatasetPropertyPage();
}
if (this.m_Layer is IGdbRasterCatalogLayer)
{
this.AddRasterCatalogPropertyPage();
}
else
{
if (this.m_Layer is IFeatureLayer)
{
this.AddFeatureLayerDisplayPropertyPage();
}
}
if (this.m_Layer is IRasterLayer)
{
this.AddRasterDatasetPropertyPage();
}
if (this.m_Layer is IGeoFeatureLayer)
{
this.AddLablePropertyPage();
}
if (this.m_Layer is ILayerFields)
{
IAttributeTable attributeTable = this.m_Layer as IAttributeTable;
if (attributeTable != null && attributeTable.AttributeTable != null)
{
this.AddFieldsPropertyPage();
}
}
if (this.m_Layer is IFDOGraphicsLayer)
{
this.AddAnnotationSymbologyPropertyPage();
}
if (this.m_Layer is IFeatureLayerDefinition2)
{
this.AddDefinitionQueryPropertyPage();
}
if (this.m_Layer is IFeatureLayer && !(this.m_Layer is IGdbRasterCatalogLayer) && !(this.m_Layer is IAnnotationLayer))
{
this.AddFeatureRenderPropertyPage();
}
if (this.m_Layer is IGroupLayer || this.m_Layer is ICadLayer)
{
this.AddLayerEffectPropertyPage();
}
if (this.m_Layer is IRasterLayer)
{
this.AddRasterRenderPropertyPage();
}
}
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void AddFeatureLayerDisplayPropertyPage()
{
try
{
//if (this.m_TabFeatureLayer == null)
//{
// stopwatch.Start();
// this.m_TabFeatureLayer = new XtraTabPage();
// this.m_TabFeatureLayer.Text = "显示设置";
// stopwatch.Stop();
// Console.WriteLine("14.1:" + stopwatch.Elapsed);
//}
this.AddTabPage(this.m_TabFeatureLayer);
//if (this.ucFeatureLayerProperty == null)
//{
// this.ucFeatureLayerProperty = new UCFeatureLayerDispProperty();
// this.ucFeatureLayerProperty.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
// (this.ucFeatureLayerProperty as UCFeatureLayerDispProperty).Dock = DockStyle.Fill;
// this.m_TabFeatureLayer.Controls.Add(this.ucFeatureLayerProperty as System.Windows.Forms.Control);
// this.m_TabFeatureLayer.Tag = this.ucFeatureLayerProperty;
// this.PropertyPageList.Add(this.ucFeatureLayerProperty);
//}
this.ucFeatureLayerProperty.InitUC(this.m_Layer);
this.ucFeatureLayerProperty.IsPageDirty = false;
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void AddDefinitionQueryPropertyPage()
{
try
{
//if (this.m_TabDefinitionQuery == null)
//{
// this.m_TabDefinitionQuery = new XtraTabPage();
// this.m_TabDefinitionQuery.Text = "预定义查询";
//}
this.AddTabPage(this.m_TabDefinitionQuery);
//if (this.ucDefinitionQueryProperty == null)
//{
// this.ucDefinitionQueryProperty = new UCDefinitionQueryProperty();
// this.ucDefinitionQueryProperty.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
// (this.ucDefinitionQueryProperty as UCDefinitionQueryProperty).Dock = DockStyle.Fill;
// this.m_TabDefinitionQuery.Controls.Add(this.ucDefinitionQueryProperty as System.Windows.Forms.Control);
// this.m_TabDefinitionQuery.Tag = this.ucDefinitionQueryProperty;
// this.PropertyPageList.Add(this.ucDefinitionQueryProperty);
//}
this.ucDefinitionQueryProperty.InitUC(this.m_Layer);
this.ucDefinitionQueryProperty.IsPageDirty = false;
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void AddAnnotationSymbologyPropertyPage()
{
try
{
//if (this.m_TabAnnotationSymbologyProperty == null)
//{
// this.m_TabAnnotationSymbologyProperty = new XtraTabPage();
// this.m_TabAnnotationSymbologyProperty.Text = "符号设置";
//}
this.AddTabPage(this.m_TabAnnotationSymbologyProperty);
//if (this.ucAnnotationSymbologyPropertyPage == null)
//{
// this.ucAnnotationSymbologyPropertyPage = new UCAnnotationSymbologyPropertyPage();
// this.ucAnnotationSymbologyPropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
// (this.ucAnnotationSymbologyPropertyPage as UCAnnotationSymbologyPropertyPage).Dock = DockStyle.Fill;
// this.m_TabAnnotationSymbologyProperty.Controls.Add(this.ucAnnotationSymbologyPropertyPage as System.Windows.Forms.Control);
// this.m_TabAnnotationSymbologyProperty.Tag = this.ucAnnotationSymbologyPropertyPage;
// this.PropertyPageList.Add(this.ucAnnotationSymbologyPropertyPage);
//}
this.ucAnnotationSymbologyPropertyPage.InitUC(this.m_Layer);
this.ucAnnotationSymbologyPropertyPage.IsPageDirty = false;
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void AddFieldsPropertyPage()
{
try
{
//if (this.m_TabFields == null)
//{
// stopwatch.Start();
// this.m_TabFields = new XtraTabPage();
// this.m_TabFields.Text = "字 段";
//}
this.AddTabPage(this.m_TabFields);
//if (this.ucFieldsPropertyPage == null)
//{
// this.ucFieldsPropertyPage = new UCFieldsPropertyPage();
// this.ucFieldsPropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
// (this.ucFieldsPropertyPage as UCFieldsPropertyPage).Dock = DockStyle.Fill;
// this.m_TabFields.Controls.Add(this.ucFieldsPropertyPage as System.Windows.Forms.Control);
// this.m_TabFields.Tag = this.ucFieldsPropertyPage;
// this.PropertyPageList.Add(this.ucFieldsPropertyPage);
//}
this.ucFieldsPropertyPage.InitUC(this.m_Layer);
this.ucFieldsPropertyPage.IsPageDirty = false;
if (this.ucDataSourceProperty != null && this.ucDataSourceProperty is UCDataSourceProperty)
{
(this.ucDataSourceProperty as UCDataSourceProperty).ucFieldsPropertyPage = this.ucFieldsPropertyPage;
}
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void AddLablePropertyPage()
{
try
{
//if (this.m_TabLable == null)
//{
// this.m_TabLable = new XtraTabPage();
// this.m_TabLable.Text = "标 注";
//}
this.AddTabPage(this.m_TabLable);
//if (this.ucLablePropertyPage == null)
//{
// this.ucLablePropertyPage = new UCLabelPropertyPage();
// this.ucLablePropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
// (this.ucLablePropertyPage as UCLabelPropertyPage).Dock = DockStyle.Fill;
// this.m_TabLable.Controls.Add(this.ucLablePropertyPage as System.Windows.Forms.Control);
// this.m_TabLable.Tag = this.ucLablePropertyPage;
// this.PropertyPageList.Add(this.ucLablePropertyPage);
//}
this.ucLablePropertyPage.InitUC(this.m_Layer);
this.ucLablePropertyPage.IsPageDirty = false;
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void AddRasterDatasetPropertyPage()
{
try
{
//if (this.m_TabRasterLayer == null)
//{
// this.m_TabRasterLayer = new XtraTabPage();
// this.m_TabRasterLayer.Text = "显示设置";
//}
this.AddTabPage(this.m_TabRasterLayer);
//if (this.ucRasterLayerPropertyPage == null)
//{
// this.ucRasterLayerPropertyPage = new UCRasterLayerDispPropertyPage();
// this.ucRasterLayerPropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
// this.ucRasterLayerPropertyPage.Dock = DockStyle.Fill;
// this.m_TabRasterLayer.Controls.Add(this.ucRasterLayerPropertyPage as System.Windows.Forms.Control);
// this.m_TabRasterLayer.Tag = this.ucRasterLayerPropertyPage;
// this.PropertyPageList.Add(this.ucRasterLayerPropertyPage);
//}
this.ucRasterLayerPropertyPage.InitUC(this.m_Layer);
this.ucRasterLayerPropertyPage.IsPageDirty = false;
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void AddRasterCatalogPropertyPage()
{
try
{
//if (this.m_TabRasterCatalogLayer == null)
//{
// this.m_TabRasterCatalogLayer = new XtraTabPage();
// this.m_TabRasterCatalogLayer.Text = "显示设置";
//}
this.AddTabPage(this.m_TabRasterCatalogLayer);
//if (this.ucRasterCatalogPropertyPage == null)
//{
// this.ucRasterCatalogPropertyPage = new UCRasterCatalogDispPropertyPage();
// this.ucRasterCatalogPropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
// this.ucRasterCatalogPropertyPage.Dock = DockStyle.Fill;
// this.m_TabRasterCatalogLayer.Controls.Add(this.ucRasterCatalogPropertyPage as System.Windows.Forms.Control);
// this.m_TabRasterCatalogLayer.Tag = this.ucRasterCatalogPropertyPage;
// this.PropertyPageList.Add(this.ucRasterCatalogPropertyPage);
//}
this.ucRasterCatalogPropertyPage.InitUC(this.m_Layer);
this.ucRasterCatalogPropertyPage.IsPageDirty = false;
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void AddFeatureRenderPropertyPage()
{
try
{
//if (this.m_TabFeatureRender == null)
//{
// this.m_TabFeatureRender = new XtraTabPage();
// this.m_TabFeatureRender.Text = "渲染设置";
//}
this.AddTabPage(this.m_TabFeatureRender);
//if (this.ucFeatureRenderPropertyPage == null)
//{
// this.ucFeatureRenderPropertyPage = new UCFeatureRenderProperty();
// this.ucFeatureRenderPropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
// this.ucFeatureRenderPropertyPage.Dock = DockStyle.Fill;
// this.m_TabFeatureRender.Controls.Add(this.ucFeatureRenderPropertyPage as System.Windows.Forms.Control);
// this.m_TabFeatureRender.Tag = this.ucFeatureRenderPropertyPage;
// this.PropertyPageList.Add(this.ucFeatureRenderPropertyPage);
//}
this.ucFeatureRenderPropertyPage.InitUC(this.m_Layer);
this.ucFeatureRenderPropertyPage.IsPageDirty = false;
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void AddRasterRenderPropertyPage()
{
try
{
//if (this.m_TabRasterRender == null)
//{
// this.m_TabRasterRender = new XtraTabPage();
// this.m_TabRasterRender.Text = "渲染设置";
//}
this.AddTabPage(this.m_TabRasterRender);
//if (this.ucRasterRenderPropertyPage == null)
//{
// this.ucRasterRenderPropertyPage = new UCRasterRenderProperty();
// this.ucRasterRenderPropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
// this.ucRasterRenderPropertyPage.Dock = DockStyle.Fill;
// this.m_TabRasterRender.Controls.Add(this.ucRasterRenderPropertyPage as System.Windows.Forms.Control);
// this.m_TabRasterRender.Tag = this.ucRasterRenderPropertyPage;
// this.PropertyPageList.Add(this.ucRasterRenderPropertyPage);
//}
this.ucRasterRenderPropertyPage.InitUC(this.m_Layer);
this.ucRasterRenderPropertyPage.IsPageDirty = false;
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void AddLayerEffectPropertyPage()
{
try
{
//if (this.m_TabLayerEffect == null)
//{
// this.m_TabLayerEffect = new XtraTabPage();
// this.m_TabLayerEffect.Text = "显示设置";
//}
this.AddTabPage(this.m_TabLayerEffect);
//if (this.ucLayerEffectPropertyPage == null)
//{
// this.ucLayerEffectPropertyPage = new UCLayerEffectPropertyPage();
// this.ucLayerEffectPropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
// this.ucLayerEffectPropertyPage.Dock = DockStyle.Fill;
// this.m_TabLayerEffect.Controls.Add(this.ucLayerEffectPropertyPage as System.Windows.Forms.Control);
// this.m_TabLayerEffect.Tag = this.ucLayerEffectPropertyPage;
// this.PropertyPageList.Add(this.ucLayerEffectPropertyPage);
//}
this.ucLayerEffectPropertyPage.InitUC(this.m_Layer);
this.ucLayerEffectPropertyPage.IsPageDirty = false;
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void AddGeoDatasetPropertyPage()
{
try
{
if (this.m_TabGeodataset == null)
{
this.m_TabGeodataset = new XtraTabPage();
this.m_TabGeodataset.Text = "数据源";
}
this.AddTabPage(this.m_TabGeodataset);
//if (this.ucDataSourceProperty == null)
//{
// this.ucDataSourceProperty = new UCDataSourceProperty();
// this.ucDataSourceProperty.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
// this.ucDataSourceProperty.Dock = DockStyle.Fill;
// this.m_TabGeodataset.Controls.Add(this.ucDataSourceProperty as System.Windows.Forms.Control);
// this.m_TabGeodataset.Tag = this.ucDataSourceProperty;
// this.PropertyPageList.Add(this.ucDataSourceProperty);
//}
this.ucDataSourceProperty.InitUC(this.m_Layer);
this.ucDataSourceProperty.IsPageDirty = false;
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void TabControlMain_SelectedPageChanged(object sender, DevExpress.XtraTab.TabPageChangedEventArgs e)
{
}
private void btnOK_Click(object sender, System.EventArgs e)
{
try
{
if (this.btnApply.Enabled)
{
this.btnApply_Click(sender, e);
}
if (this.btnOKClick != null)
{
this.btnOKClick(sender, e);
}
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void btnCancel_Click(object sender, System.EventArgs e)
{
if (this.btnCancelClick != null)
{
this.btnCancelClick(sender, e);
}
}
private void btnApply_Click(object sender, System.EventArgs e)
{
try
{
foreach (IPropertyPage current in this.PropertyPageList)
{
if (current.IsPageDirty && current.CanWrite2Prop())
{
current.Write2Prop();
}
}
if (this.m_IsCustomLayer)
{
this.m_LayerProperty.GetPropertyFromLayer();
this.m_LayerProperty.ApplyProperty();
}
this.btnApply.Enabled = false;
if (this.btnApplyClick != null)
{
this.btnApplyClick(sender, e);
}
}
catch (Exception ex)
{
//RdbUtil.AddException(ex);
}
}
private void UCLayerProperties_ParentChanged(object sender, System.EventArgs e)
{
if (base.FindForm() != null)
{
base.FindForm().FormClosed -= new FormClosedEventHandler(this.UCLayerProperties_FormClosed);
base.FindForm().FormClosed += new FormClosedEventHandler(this.UCLayerProperties_FormClosed);
}
}
private void UCLayerProperties_FormClosed(object sender, FormClosedEventArgs e)
{
this.m_TabSelected = this.TabControlMain.SelectedTabPage;
}
private void InitiatePropertyPages()
{
if (this.m_TabGeodataset == null)
{
this.m_TabGeodataset = new XtraTabPage();
this.m_TabGeodataset.Text = "数据源";
}
if (this.ucDataSourceProperty == null)
{
this.ucDataSourceProperty = new UCDataSourceProperty();
this.ucDataSourceProperty.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
this.ucDataSourceProperty.Dock = DockStyle.Fill;
this.m_TabGeodataset.Controls.Add(this.ucDataSourceProperty as System.Windows.Forms.Control);
this.m_TabGeodataset.Tag = this.ucDataSourceProperty;
this.PropertyPageList.Add(this.ucDataSourceProperty);
}
if (this.m_TabRasterCatalogLayer == null)
{
this.m_TabRasterCatalogLayer = new XtraTabPage();
this.m_TabRasterCatalogLayer.Text = "显示设置";
}
if (this.ucRasterCatalogPropertyPage == null)
{
this.ucRasterCatalogPropertyPage = new UCRasterCatalogDispPropertyPage();
this.ucRasterCatalogPropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
this.ucRasterCatalogPropertyPage.Dock = DockStyle.Fill;
this.m_TabRasterCatalogLayer.Controls.Add(this.ucRasterCatalogPropertyPage as System.Windows.Forms.Control);
this.m_TabRasterCatalogLayer.Tag = this.ucRasterCatalogPropertyPage;
this.PropertyPageList.Add(this.ucRasterCatalogPropertyPage);
}
if (this.m_TabFeatureLayer == null)
{
this.m_TabFeatureLayer = new XtraTabPage();
this.m_TabFeatureLayer.Text = "显示设置";
}
if (this.ucFeatureLayerProperty == null)
{
this.ucFeatureLayerProperty = new UCFeatureLayerDispProperty();
this.ucFeatureLayerProperty.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
(this.ucFeatureLayerProperty as UCFeatureLayerDispProperty).Dock = DockStyle.Fill;
this.m_TabFeatureLayer.Controls.Add(this.ucFeatureLayerProperty as System.Windows.Forms.Control);
this.m_TabFeatureLayer.Tag = this.ucFeatureLayerProperty;
this.PropertyPageList.Add(this.ucFeatureLayerProperty);
}
if (this.m_TabRasterLayer == null)
{
this.m_TabRasterLayer = new XtraTabPage();
this.m_TabRasterLayer.Text = "显示设置";
}
if (this.ucRasterLayerPropertyPage == null)
{
this.ucRasterLayerPropertyPage = new UCRasterLayerDispPropertyPage();
this.ucRasterLayerPropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
this.ucRasterLayerPropertyPage.Dock = DockStyle.Fill;
this.m_TabRasterLayer.Controls.Add(this.ucRasterLayerPropertyPage as System.Windows.Forms.Control);
this.m_TabRasterLayer.Tag = this.ucRasterLayerPropertyPage;
this.PropertyPageList.Add(this.ucRasterLayerPropertyPage);
}
if (this.m_TabLable == null)
{
this.m_TabLable = new XtraTabPage();
this.m_TabLable.Text = "标 注";
}
if (this.ucLablePropertyPage == null)
{
this.ucLablePropertyPage = new UCLabelPropertyPage();
this.ucLablePropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
(this.ucLablePropertyPage as UCLabelPropertyPage).Dock = DockStyle.Fill;
this.m_TabLable.Controls.Add(this.ucLablePropertyPage as System.Windows.Forms.Control);
this.m_TabLable.Tag = this.ucLablePropertyPage;
this.PropertyPageList.Add(this.ucLablePropertyPage);
}
if (this.m_TabFields == null)
{
this.m_TabFields = new XtraTabPage();
this.m_TabFields.Text = "字 段";
}
if (this.ucFieldsPropertyPage == null)
{
this.ucFieldsPropertyPage = new UCFieldsPropertyPage();
this.ucFieldsPropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
(this.ucFieldsPropertyPage as UCFieldsPropertyPage).Dock = DockStyle.Fill;
this.m_TabFields.Controls.Add(this.ucFieldsPropertyPage as System.Windows.Forms.Control);
this.m_TabFields.Tag = this.ucFieldsPropertyPage;
this.PropertyPageList.Add(this.ucFieldsPropertyPage);
}
//if (this.ucDataSourceProperty != null && this.ucDataSourceProperty is UCDataSourceProperty)
//{
// (this.ucDataSourceProperty as UCDataSourceProperty).ucFieldsPropertyPage = this.ucFieldsPropertyPage;
//}
if (this.m_TabAnnotationSymbologyProperty == null)
{
this.m_TabAnnotationSymbologyProperty = new XtraTabPage();
this.m_TabAnnotationSymbologyProperty.Text = "符号设置";
}
if (this.ucAnnotationSymbologyPropertyPage == null)
{
this.ucAnnotationSymbologyPropertyPage = new UCAnnotationSymbologyPropertyPage();
this.ucAnnotationSymbologyPropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
(this.ucAnnotationSymbologyPropertyPage as UCAnnotationSymbologyPropertyPage).Dock = DockStyle.Fill;
this.m_TabAnnotationSymbologyProperty.Controls.Add(this.ucAnnotationSymbologyPropertyPage as System.Windows.Forms.Control);
this.m_TabAnnotationSymbologyProperty.Tag = this.ucAnnotationSymbologyPropertyPage;
this.PropertyPageList.Add(this.ucAnnotationSymbologyPropertyPage);
}
if (this.m_TabDefinitionQuery == null)
{
this.m_TabDefinitionQuery = new XtraTabPage();
this.m_TabDefinitionQuery.Text = "预定义查询";
}
if (this.ucDefinitionQueryProperty == null)
{
this.ucDefinitionQueryProperty = new UCDefinitionQueryProperty();
this.ucDefinitionQueryProperty.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
(this.ucDefinitionQueryProperty as UCDefinitionQueryProperty).Dock = DockStyle.Fill;
this.m_TabDefinitionQuery.Controls.Add(this.ucDefinitionQueryProperty as System.Windows.Forms.Control);
this.m_TabDefinitionQuery.Tag = this.ucDefinitionQueryProperty;
this.PropertyPageList.Add(this.ucDefinitionQueryProperty);
}
if (this.m_TabFeatureRender == null)
{
this.m_TabFeatureRender = new XtraTabPage();
this.m_TabFeatureRender.Text = "渲染设置";
}
if (this.ucFeatureRenderPropertyPage == null)
{
this.ucFeatureRenderPropertyPage = new UCFeatureRenderProperty();
this.ucFeatureRenderPropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
this.ucFeatureRenderPropertyPage.Dock = DockStyle.Fill;
this.m_TabFeatureRender.Controls.Add(this.ucFeatureRenderPropertyPage as System.Windows.Forms.Control);
this.m_TabFeatureRender.Tag = this.ucFeatureRenderPropertyPage;
this.PropertyPageList.Add(this.ucFeatureRenderPropertyPage);
}
if (this.m_TabLayerEffect == null)
{
this.m_TabLayerEffect = new XtraTabPage();
this.m_TabLayerEffect.Text = "显示设置";
}
if (this.ucLayerEffectPropertyPage == null)
{
this.ucLayerEffectPropertyPage = new UCLayerEffectPropertyPage();
this.ucLayerEffectPropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
this.ucLayerEffectPropertyPage.Dock = DockStyle.Fill;
this.m_TabLayerEffect.Controls.Add(this.ucLayerEffectPropertyPage as System.Windows.Forms.Control);
this.m_TabLayerEffect.Tag = this.ucLayerEffectPropertyPage;
this.PropertyPageList.Add(this.ucLayerEffectPropertyPage);
}
if (this.m_TabRasterRender == null)
{
this.m_TabRasterRender = new XtraTabPage();
this.m_TabRasterRender.Text = "渲染设置";
}
if (this.ucRasterRenderPropertyPage == null)
{
this.ucRasterRenderPropertyPage = new UCRasterRenderProperty();
this.ucRasterRenderPropertyPage.EditorChanged += new System.EventHandler(this.ucGeneralProperty_EditorChanged);
this.ucRasterRenderPropertyPage.Dock = DockStyle.Fill;
this.m_TabRasterRender.Controls.Add(this.ucRasterRenderPropertyPage as System.Windows.Forms.Control);
this.m_TabRasterRender.Tag = this.ucRasterRenderPropertyPage;
this.PropertyPageList.Add(this.ucRasterRenderPropertyPage);
}
}
}
}