private void btnNorthMarkerSymbolSelector_Click(object sender, EventArgs e) { try { frmSymbolSelector selector = new frmSymbolSelector(); if (selector != null) { selector.SetStyleGallery(ApplicationBase.StyleGallery); selector.SetSymbol((this.inorthArrow_0 as IMarkerNorthArrow).MarkerSymbol); if (selector.ShowDialog() == DialogResult.OK) { (this.inorthArrow_0 as IMarkerNorthArrow).MarkerSymbol = selector.GetSymbol() as IMarkerSymbol; this.bool_0 = false; this.method_1(); this.bool_0 = true; this.method_0(); } } } catch { } }
private void btnNorthArrorSelector_Click(object sender, EventArgs e) { try { frmSymbolSelector selector = new frmSymbolSelector(); if (selector != null) { selector.SetStyleGallery(this.istyleGallery_0); selector.SetSymbol(this.inorthArrow_0); if (selector.ShowDialog() == DialogResult.OK) { this.inorthArrow_0 = selector.GetSymbol() as INorthArrow; this.bool_0 = false; this.method_1(); this.bool_0 = true; this.method_0(); } } } catch { } }
private void btnSymbolSelector_Click(object sender, EventArgs e) { try { ITextSymbol pSym = m_pScaleText.Symbol; frmSymbolSelector selector = new frmSymbolSelector(); if (selector != null) { selector.SetStyleGallery(this.istyleGallery_0); selector.SetSymbol(pSym); if (selector.ShowDialog() == DialogResult.OK) { pSym = selector.GetSymbol() as ITextSymbol; m_pScaleText.Symbol = pSym; this.method_1(pSym); ScaleTextEventsClass.ScaleTextChage(this); this.method_4(); } } } catch { } }
private void btnSymbol2Selector_Click(object sender, EventArgs e) { try { if (m_pScaleBar is IDoubleFillScaleBar) { ISymbol pSym = (m_pScaleBar as IDoubleFillScaleBar).FillSymbol2 as ISymbol; frmSymbolSelector selector = new frmSymbolSelector(); if (selector != null) { selector.SetStyleGallery(this.istyleGallery_0); selector.SetSymbol(pSym); if (selector.ShowDialog() == DialogResult.OK) { (m_pScaleBar as IDoubleFillScaleBar).FillSymbol2 = selector.GetSymbol() as IFillSymbol; this.method_4(); } } } } catch { } }
private void btnBackgroundSelector_Click(object sender, EventArgs e) { try { frmSymbolSelector selector = new frmSymbolSelector(); if (selector != null) { IStyleGalleryItem selectStyleGalleryItem = this.cboBackground.GetSelectStyleGalleryItem(); IBackground pSym = null; if (selectStyleGalleryItem != null) { pSym = selectStyleGalleryItem.Item as IBackground; } selector.SetStyleGallery(this.istyleGallery_0); if (pSym != null) { selector.SetSymbol(pSym); } else { selector.SetSymbol(new SymbolBackgroundClass()); } if (selector.ShowDialog() == DialogResult.OK) { pSym = selector.GetSymbol() as IBackground; this.bool_0 = false; selectStyleGalleryItem = this.cboBackground.GetStyleGalleryItemAt(this.cboBackground.Items.Count - 1); if (selectStyleGalleryItem != null) { if (selectStyleGalleryItem.Name == "<定制>") { selectStyleGalleryItem.Item = pSym; } else { selectStyleGalleryItem = new MyStyleGalleryItem { Name = "<定制>", Item = pSym }; this.cboBackground.Add(selectStyleGalleryItem); this.cboBackground.SelectedIndex = this.cboBackground.Items.Count - 1; } } else { selectStyleGalleryItem = new MyStyleGalleryItem { Name = "<定制>", Item = pSym }; this.cboBackground.Add(selectStyleGalleryItem); this.cboBackground.SelectedIndex = this.cboBackground.Items.Count - 1; } this.bool_0 = true; } } } catch { } }
private bool method_0() { IActiveView activeView = this._context.ActiveView; IGraphicsContainer graphicsContainer = activeView.GraphicsContainer; bool result; if (graphicsContainer == null) { result = false; } else { try { frmSymbolSelector frmSymbolSelector = new frmSymbolSelector(); if (frmSymbolSelector == null) { result = false; return(result); } IScaleText scaleText = new ScaleText(); frmSymbolSelector.SetSymbol(scaleText); frmSymbolSelector.SetStyleGallery(this._context.StyleGallery); if (frmSymbolSelector.ShowDialog() == System.Windows.Forms.DialogResult.OK) { scaleText = (frmSymbolSelector.GetSymbol() as IScaleText); if (scaleText == null) { result = false; return(result); } UID clsid = new UID { Value = "esriCarto.ScaleText" }; IMapFrame mapFrame = graphicsContainer.FindFrame(activeView.FocusMap) as IMapFrame; scaleText.MapUnits = mapFrame.Map.MapUnits; IMapSurroundFrame mapSurroundFrame = mapFrame.CreateSurroundFrame(clsid, scaleText); IElement element = mapSurroundFrame as IElement; IEnvelope envelope = new Envelope() as IEnvelope; envelope.PutCoords(5.0, 13.0, 8.0, 14.0); IEnvelope envelope2 = new Envelope() as IEnvelope; scaleText.QueryBounds(this._context.ActiveView.ScreenDisplay, envelope, envelope2); element.Geometry = envelope2; INewElementOperation operation = new NewElementOperation { ActiveView = this._context.ActiveView, Element = element }; this._context.OperationStack.Do(operation); result = true; return(result); } } catch { } result = false; } return(result); }