private void btnProperty_Click(object sender, EventArgs e) { frmElementProperty property = new frmElementProperty { Text = "格网标注属性" }; bool flag = false; if (this.cboFormat.SelectedIndex == 0) { NumericFormatPropertyPage page = new NumericFormatPropertyPage(); property.AddPage(page); INumberFormat format = (this.igridLabel_0 as IFormattedGridLabel).Format; if (flag = property.EditProperties(format)) { (this.igridLabel_0 as IFormattedGridLabel).Format = format; } } else if (this.cboFormat.SelectedIndex == 1) { MixedLabelPropertyPage page2 = new MixedLabelPropertyPage(); property.AddPage(page2); flag = property.EditProperties(this.igridLabel_0); } else { CornerGridLabelPropertyPage page3 = new CornerGridLabelPropertyPage(); property.AddPage(page3); PrincipalDigitsLabelPropertyPage page4 = new PrincipalDigitsLabelPropertyPage(); property.AddPage(page4); flag = property.EditProperties(this.igridLabel_0); } if (flag) { this.bool_1 = true; if (this.OnValueChange != null) { this.OnValueChange(); } } }
private void method_0() { IPropertySheet sheet; IPropertyPage page; IElement element = this.ielement_0; if (element is ITextElement) { sheet = new frmElementProperty { Title = "属性" }; page = new TextSetupCtrl(); sheet.AddPage(page); page = new ElementSizeAndPositionCtrl(); sheet.AddPage(page); if (sheet.EditProperties(element)) { this.iactiveView_0.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this.iactiveView_0.GraphicsContainer.UpdateElement(element); this.iactiveView_0.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); } } else { IEnvelope envelope; if (element is IMapFrame) { sheet = new frmElementProperty { Title = "数据框 属性" }; page = null; page = new MapGeneralInfoCtrl(); sheet.AddPage(page); page = new MapCoordinateCtrl(); sheet.AddPage(page); page = new FrameProprtyPage(); sheet.AddPage(page); envelope = element.Geometry.Envelope; if (sheet.EditProperties(element)) { this.iactiveView_0.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); this.iactiveView_0.GraphicsContainer.UpdateElement(element); this.iactiveView_0.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); } } else if (element is IPictureElement) { sheet = new frmElementProperty { Title = "图像 属性" }; page = null; page = new PicturePropertyPage(); sheet.AddPage(page); page = new FrameProprtyPage(); sheet.AddPage(page); envelope = element.Geometry.Envelope; if (sheet.EditProperties(element)) { this.iactiveView_0.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); this.iactiveView_0.GraphicsContainer.UpdateElement(element); this.iactiveView_0.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); } } else if (element is IMapSurroundFrame) { sheet = new frmElementProperty { Title = "属性" }; page = null; if ((element as IMapSurroundFrame).MapSurround is INorthArrow) { page = new UI.NorthArrowPropertyPage(); sheet.AddPage(page); } else if ((element as IMapSurroundFrame).MapSurround is IScaleBar) { page = new UI.ScaleBarFormatPropertyPage(); sheet.AddPage(page); page = new UI.ScaleAndUnitsPropertyPage(); sheet.AddPage(page); page = new UI.NumberAndLabelPropertyPage(); sheet.AddPage(page); } else if ((element as IMapSurroundFrame).MapSurround is IScaleText) { page = new UI.ScaleTextTextPropertyPage(); sheet.AddPage(page); page = new UI.ScaleTextFormatPropertyPage(); sheet.AddPage(page); } else if ((element as IMapSurroundFrame).MapSurround is ILegend) { page = new UI.LegendPropertyPage(); sheet.AddPage(page); page = new UI.LegendItemPropertyPage(); sheet.AddPage(page); } page = new FrameProprtyPage(); sheet.AddPage(page); envelope = element.Geometry.Envelope; IElement element1 = (element as IClone).Clone() as IElement; if (sheet.EditProperties(element)) { this.iactiveView_0.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this.iactiveView_0.GraphicsContainer.UpdateElement(element); this.iactiveView_0.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); } } else if (element is IFrameElement) { sheet = new frmElementProperty { Title = "属性" }; page = null; page = new UI.ElementGeometryInfoPropertyPage(); sheet.AddPage(page); page = new FrameProprtyPage(); sheet.AddPage(page); envelope = element.Geometry.Envelope; if (sheet.EditProperties(element)) { this.iactiveView_0.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); this.iactiveView_0.GraphicsContainer.UpdateElement(element); this.iactiveView_0.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); } } else if (element is IFillShapeElement) { sheet = new frmElementProperty { Title = "属性" }; page = null; page = new UI.FillSymbolPropertyPage(); sheet.AddPage(page); page = new UI.ElementGeometryInfoPropertyPage(); sheet.AddPage(page); envelope = element.Geometry.Envelope; if (sheet.EditProperties(element)) { this.iactiveView_0.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); this.iactiveView_0.GraphicsContainer.UpdateElement(element); this.iactiveView_0.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); } } else if (element is ILineElement) { sheet = new frmElementProperty { Title = "属性" }; page = null; page = new UI.LineSymbolPropertyPage(); sheet.AddPage(page); envelope = element.Geometry.Envelope; if (sheet.EditProperties(element)) { this.iactiveView_0.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); this.iactiveView_0.GraphicsContainer.UpdateElement(element); this.iactiveView_0.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); } } } this.ielement_2 = (element as IClone).Clone() as IElement; }
private bool method_1() { IGraphicsContainerSelect graphicsContainerSelect = this.GetSelection(); bool result; if (graphicsContainerSelect.ElementSelectionCount == 0) { result = false; } else { IElement element = graphicsContainerSelect.SelectedElement(0); IEditElementPropertiesOperation editElementPropertiesOperation = new EditElementPropertiesOperation(); editElementPropertiesOperation.ActiveView = this._context.ActiveView; editElementPropertiesOperation.Element = element; if (!(element is IOleFrame) && ElementChangeEvent.IsFireElementPropertyEditEvent) { ElementChangeEvent.EditElementProperty(element); result = true; } else { if (element is ITextElement) { IPropertySheet propertySheet = new frmElementProperty(); propertySheet.Title = "属性"; IPropertyPage propertyPage = new TextSetupCtrl(); propertySheet.AddPage(propertyPage); propertyPage = new ElementSizeAndPositionCtrl(); propertySheet.AddPage(propertyPage); if (propertySheet.EditProperties(element)) { IActiveView activeView = this._context.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._context.OperationStack.Do(editElementPropertiesOperation); } } else if (element is IFractionTextElement) { IPropertySheet propertySheet = new frmElementProperty(); propertySheet.Title = "属性"; IPropertyPage propertyPage = new FractionTextSymbolPage(); (propertyPage as FractionTextSymbolPage).ActiveView = this._context.ActiveView; propertySheet.AddPage(propertyPage); if (propertySheet.EditProperties(element)) { IActiveView activeView = this._context.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._context.OperationStack.Do(editElementPropertiesOperation); } } else if (element is IMapFrame) { IPropertySheet propertySheet = new frmElementProperty(); propertySheet.Title = "数据框 属性"; IPropertyPage propertyPage = new MapGeneralInfoCtrl(); propertySheet.AddPage(propertyPage); propertyPage = new MapCoordinateCtrl(); propertySheet.AddPage(propertyPage); propertyPage = new FrameProprtyPage(); propertySheet.AddPage(propertyPage); IEnvelope envelope = element.Geometry.Envelope; if (propertySheet.EditProperties(element)) { IActiveView activeView = this._context.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._context.OperationStack.Do(editElementPropertiesOperation); } } else if (element is IPictureElement) { IPropertySheet propertySheet = new frmElementProperty(); propertySheet.Title = "图像 属性"; IPropertyPage propertyPage = new PicturePropertyPage(); propertySheet.AddPage(propertyPage); propertyPage = new FrameProprtyPage(); propertySheet.AddPage(propertyPage); IEnvelope envelope = element.Geometry.Envelope; if (propertySheet.EditProperties(element)) { IActiveView activeView = this._context.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._context.OperationStack.Do(editElementPropertiesOperation); } } else if (element is IMapSurroundFrame) { IPropertySheet propertySheet = new frmElementProperty(); propertySheet.Title = "属性"; IPropertyPage propertyPage; if ((element as IMapSurroundFrame).MapSurround is INorthArrow) { propertyPage = new NorthArrowPropertyPage(); propertySheet.AddPage(propertyPage); } else if ((element as IMapSurroundFrame).MapSurround is IScaleBar) { propertyPage = new ScaleBarFormatPropertyPage(); propertySheet.AddPage(propertyPage); propertyPage = new ScaleAndUnitsPropertyPage(); propertySheet.AddPage(propertyPage); propertyPage = new NumberAndLabelPropertyPage(); propertySheet.AddPage(propertyPage); } else if ((element as IMapSurroundFrame).MapSurround is IScaleText) { propertyPage = new ScaleTextTextPropertyPage(); propertySheet.AddPage(propertyPage); propertyPage = new ScaleTextFormatPropertyPage(); propertySheet.AddPage(propertyPage); } else if ((element as IMapSurroundFrame).MapSurround is ILegend) { propertyPage = new LegendPropertyPage(); propertySheet.AddPage(propertyPage); propertyPage = new LegendItemPropertyPage(); propertySheet.AddPage(propertyPage); } propertyPage = new FrameProprtyPage(); propertySheet.AddPage(propertyPage); IEnvelope envelope = element.Geometry.Envelope; IElement arg_43A_0 = (element as IClone).Clone() as IElement; if (propertySheet.EditProperties(element)) { IActiveView activeView = this._context.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._context.OperationStack.Do(editElementPropertiesOperation); } } else if (element is IFrameElement) { IPropertySheet propertySheet = new frmElementProperty(); propertySheet.Title = "属性"; IPropertyPage propertyPage = new ElementGeometryInfoPropertyPage(); propertySheet.AddPage(propertyPage); propertyPage = new FrameProprtyPage(); propertySheet.AddPage(propertyPage); IEnvelope envelope = element.Geometry.Envelope; if (propertySheet.EditProperties(element)) { IActiveView activeView = this._context.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._context.OperationStack.Do(editElementPropertiesOperation); } } else if (element is IFillShapeElement) { IPropertySheet propertySheet = new frmElementProperty(); propertySheet.Title = "属性"; IPropertyPage propertyPage = new FillSymbolPropertyPage(); propertySheet.AddPage(propertyPage); propertyPage = new ElementGeometryInfoPropertyPage(); propertySheet.AddPage(propertyPage); IEnvelope envelope = element.Geometry.Envelope; if (propertySheet.EditProperties(element)) { IActiveView activeView = this._context.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._context.OperationStack.Do(editElementPropertiesOperation); } } else if (element is ILineElement) { IPropertySheet propertySheet = new frmElementProperty(); propertySheet.Title = "属性"; IPropertyPage propertyPage = new LineSymbolPropertyPage(); propertySheet.AddPage(propertyPage); IEnvelope envelope = element.Geometry.Envelope; if (propertySheet.EditProperties(element)) { IActiveView activeView = this._context.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._context.OperationStack.Do(editElementPropertiesOperation); } } else if (element is IMarkerElement) { IPropertySheet propertySheet = new frmElementProperty(); propertySheet.Title = "属性"; IPropertyPage propertyPage = new MarkerElementPropertyPage(); propertySheet.AddPage(propertyPage); IEnvelope envelope = element.Geometry.Envelope; if (propertySheet.EditProperties(element)) { IActiveView activeView = this._context.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._context.OperationStack.Do(editElementPropertiesOperation); } } else if (element is IJTBElement) { frmJTBElement frmJTBElement = new frmJTBElement(); frmJTBElement.JTBElement = (element as IJTBElement); IEnvelope envelope = element.Geometry.Envelope; if (frmJTBElement.ShowDialog() == System.Windows.Forms.DialogResult.OK) { IActiveView activeView = this._context.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._context.OperationStack.Do(editElementPropertiesOperation); } } result = true; } } return(result); }
private bool method_1() { IPropertySheet sheet; IPropertyPage page; IActiveView activeView; IGraphicsContainerSelect select = this.method_0(); if (select.ElementSelectionCount == 0) { return(false); } IElement element = select.SelectedElement(0); IEditElementPropertiesOperation operation = new EditElementPropertiesOperation { ActiveView = this._hookHelper.ActiveView, Element = element }; if (element is ITextElement) { sheet = new frmElementProperty { Title = "属性" }; page = new TextSetupCtrl(); sheet.AddPage(page); page = new UI.ElementSizeAndPositionCtrl(); sheet.AddPage(page); if (sheet.EditProperties(element)) { activeView = this._hookHelper.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._hookHelper.OperationStack.Do(operation); } } else { IEnvelope envelope; if (element is IMapFrame) { sheet = new frmElementProperty { Title = "数据框 属性" }; page = null; page = new MapGeneralInfoCtrl(); sheet.AddPage(page); page = new MapCoordinateCtrl(); sheet.AddPage(page); page = new FrameProprtyPage(); sheet.AddPage(page); envelope = element.Geometry.Envelope; if (sheet.EditProperties(element)) { activeView = this._hookHelper.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._hookHelper.OperationStack.Do(operation); } } else if (element is IPictureElement) { sheet = new frmElementProperty { Title = "图像 属性" }; page = null; page = new PicturePropertyPage(); sheet.AddPage(page); page = new FrameProprtyPage(); sheet.AddPage(page); envelope = element.Geometry.Envelope; if (sheet.EditProperties(element)) { activeView = this._hookHelper.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._hookHelper.OperationStack.Do(operation); } } else if (element is IMapSurroundFrame) { sheet = new frmElementProperty { Title = "属性" }; page = null; if ((element as IMapSurroundFrame).MapSurround is INorthArrow) { page = new UI.NorthArrowPropertyPage(); sheet.AddPage(page); } else if ((element as IMapSurroundFrame).MapSurround is IScaleBar) { page = new UI.ScaleBarFormatPropertyPage(); sheet.AddPage(page); page = new UI.ScaleAndUnitsPropertyPage(); sheet.AddPage(page); page = new UI.NumberAndLabelPropertyPage(); sheet.AddPage(page); } else if ((element as IMapSurroundFrame).MapSurround is IScaleText) { page = new UI.ScaleTextTextPropertyPage(); sheet.AddPage(page); page = new UI.ScaleTextFormatPropertyPage(); sheet.AddPage(page); } else if ((element as IMapSurroundFrame).MapSurround is ILegend) { page = new UI.LegendPropertyPage(); sheet.AddPage(page); page = new UI.LegendItemPropertyPage(); sheet.AddPage(page); } page = new FrameProprtyPage(); sheet.AddPage(page); envelope = element.Geometry.Envelope; IElement element1 = (element as IClone).Clone() as IElement; if (sheet.EditProperties(element)) { activeView = this._hookHelper.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._hookHelper.OperationStack.Do(operation); } } else if (element is IFrameElement) { sheet = new frmElementProperty { Title = "属性" }; page = null; page = new UI.ElementGeometryInfoPropertyPage(); sheet.AddPage(page); page = new FrameProprtyPage(); sheet.AddPage(page); envelope = element.Geometry.Envelope; if (sheet.EditProperties(element)) { activeView = this._hookHelper.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._hookHelper.OperationStack.Do(operation); } } else if (element is IFillShapeElement) { sheet = new frmElementProperty { Title = "属性" }; page = null; page = new UI.FillSymbolPropertyPage(); sheet.AddPage(page); page = new UI.ElementGeometryInfoPropertyPage(); sheet.AddPage(page); envelope = element.Geometry.Envelope; if (sheet.EditProperties(element)) { activeView = this._hookHelper.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._hookHelper.OperationStack.Do(operation); } } else if (element is ILineElement) { sheet = new frmElementProperty { Title = "属性" }; page = null; page = new UI.LineSymbolPropertyPage(); sheet.AddPage(page); envelope = element.Geometry.Envelope; if (sheet.EditProperties(element)) { activeView = this._hookHelper.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._hookHelper.OperationStack.Do(operation); } } else if (element is IMarkerElement) { sheet = new frmElementProperty { Title = "属性" }; page = null; page = new UI.MarkerElementPropertyPage(); sheet.AddPage(page); envelope = element.Geometry.Envelope; if (sheet.EditProperties(element)) { activeView = this._hookHelper.ActiveView; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, envelope); activeView.GraphicsContainer.UpdateElement(element); activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, element, null); this._hookHelper.OperationStack.Do(operation); } } } return(true); }