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 ESRI.ArcGIS.Carto; using DevExpress.XtraEditors; using KGIS.Plugin.LayerProperty.Interface; namespace KGIS.Plugin.LayerProperty.View.UC_Controls { public partial class UCFeatureLayerDispProperty : XtraUserControl, IUCPropertyPageEx, IPropertyPage { private ILayer m_Layer; private bool m_ShowTips; private bool m_ScaleSymbols; private int m_Transparency; private bool isDirty; public event System.EventHandler EditorChanged; public bool IsPageDirty { get { return this.isDirty; } set { this.isDirty = value; } } public int Priority { get { throw new Exception("The method or operation is not implemented."); } set { throw new Exception("The method or operation is not implemented."); } } public string Title { get { throw new Exception("The method or operation is not implemented."); } set { throw new Exception("The method or operation is not implemented."); } } public UCFeatureLayerDispProperty() { InitializeComponent(); } private void chkShowMapTips_CheckedChanged(object sender, System.EventArgs e) { try { this.m_ShowTips = this.chkShowMapTips.Checked; } catch (Exception ex) { //RdbUtil.AddException(ex); } } private void chkScaleSymbols_CheckedChanged(object sender, System.EventArgs e) { try { this.m_ScaleSymbols = this.chkScaleSymbols.Checked; } catch (Exception ex) { //RdbUtil.AddException(ex); } } private void speTransparency_EditValueChanged(object sender, System.EventArgs e) { try { this.m_Transparency = Convert.ToInt32(this.speTransparency.Value); this.InvokeEditValueChanged(sender, e); } catch (Exception ex) { //RdbUtil.AddException(ex); } } public void InitUC(object layerProperty) { try { this.m_Layer = (layerProperty as ILayer); IFeatureLayer2 featureLayer = this.m_Layer as IFeatureLayer2; if (featureLayer != null) { this.chkShowMapTips.Checked = this.m_Layer.ShowTips; this.chkScaleSymbols.Checked = featureLayer.ScaleSymbols; this.speTransparency.Value = (featureLayer as ILayerEffects).Transparency; } } catch (Exception ex) { //RdbUtil.AddException(ex); } } public void Write2Prop() { try { if (this.m_Layer != null) { this.m_Layer.ShowTips = this.chkShowMapTips.Checked; IFeatureLayer2 featureLayer = this.m_Layer as IFeatureLayer2; featureLayer.ScaleSymbols = this.chkScaleSymbols.Checked; (this.m_Layer as ILayerEffects).Transparency = Convert.ToInt16(this.speTransparency.Value); } this.isDirty = false; } catch (Exception ex) { //RdbUtil.AddException(ex); } } public bool CanWrite2Prop() { return this.isDirty; } private void InvokeEditValueChanged(object sender, System.EventArgs e) { if (this.EditorChanged != null) { this.EditorChanged(sender, e); } this.isDirty = true; } public void SetDefaultValue(object value) { } public int Activate() { throw new Exception("The method or operation is not implemented."); } public void Deactivate() { throw new Exception("The method or operation is not implemented."); } public void Cancel() { throw new Exception("The method or operation is not implemented."); } } }