private void axPageLayoutControl1_OnMouseUp(object sender, IPageLayoutControlEvents_OnMouseUpEvent e) { if (_enumMapSurType != EnumMapSurroundType.None) { if (pNewEnvelopeFeedback != null) { IActiveView pActiveView = null; pActiveView = axPageLayoutControl1.PageLayout as IActiveView; IEnvelope pEnvelope = pNewEnvelopeFeedback.Stop(); AddMapSurround(pActiveView, _enumMapSurType, pEnvelope); pNewEnvelopeFeedback = null; _enumMapSurType = EnumMapSurroundType.None; } } }
private void AddMapSurround(IActiveView pAV, EnumMapSurroundType _enumMapSurroundType, IEnvelope pEnvelope) { try { switch (_enumMapSurroundType) { case EnumMapSurroundType.NorthArrow: addNorthArrow(axPageLayoutControl1.PageLayout, pEnvelope, pAV); break; case EnumMapSurroundType.ScaleBar: makeScaleBar(pAV, axPageLayoutControl1.PageLayout, pEnvelope); break; case EnumMapSurroundType.Legend: MakeLegend(pAV, axPageLayoutControl1.PageLayout, pEnvelope); break; } } catch (Exception ex) { } }
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { _enumMapSurType = EnumMapSurroundType.NorthArrow; }
private void addScaleBar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { _enumMapSurType = EnumMapSurroundType.ScaleBar; }
private void addLegend_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { _enumMapSurType = EnumMapSurroundType.Legend; }