protected override void OnMouseDown(MouseEventArgs arg) { base.OnMouseDown(arg); try { ValueSymbolForm valueSymbolForm = AddIn.FromID <ValueSymbolForm.AddinImpl>(ThisAddIn.IDs.ValueSymbolForm).UI; selectedValue = valueSymbolForm.SelectedValue; selectedColor = valueSymbolForm.SelectedColor; if ((Painter.ActiveLayer == null) || (arg.Button != MouseButtons.Left) || (selectedValue == null)) { return; } preMousePos = Raster.ScreenCoor2RasterCoor(arg.X, arg.Y, Painter.ActiveLayer); iniMousePos = preMousePos; } catch (Exception ex) { MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error"); } }
protected override void OnClick() { if (s_dockWindow == null) { UID dockWinID = new UIDClass(); dockWinID.Value = ThisAddIn.IDs.RS_Tools_Tools_Inspector_Inspector; s_dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID); } if (s_dockWindow == null) { return; } Inspector.AddinImpl winImpl = AddIn.FromID <Inspector.AddinImpl>(ThisAddIn.IDs.RS_Tools_Tools_Inspector_Inspector); Inspector inspector = winImpl.UI; if (inspector != null) { inspector.OKStay(); } else { Utilities.Utilities_MessageBox.ErrorBox("Critical Error", "SOORRY!"); } }
protected override void OnMouseDown(MouseEventArgs arg) { UID toolId = new UIDClass(); toolId.Value = ThisAddIn.IDs.PickProfileCoordinates; var mxdDoc = ArcMap.Document; var screenDisplay = mxdDoc.ActiveView.ScreenDisplay; var point = screenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y); var pointToSave = screenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y); point.SpatialReference = mxdDoc.FocusMap.SpatialReference; pointToSave.SpatialReference = mxdDoc.FocusMap.SpatialReference; EsriTools.ProjectToWgs84(point); var winImpl = AddIn.FromID <DockableWindowMilSpaceProfileCalc.AddinImpl>(ThisAddIn.IDs.DockableWindowMilSpaceProfileCalc); if (winImpl.MilSpaceProfileCalsController.View.ActiveButton == ProfileSettingsPointButtonEnum.PointsFist) { winImpl.MilSpaceProfileCalsController.SetFirsPointForLineProfile(point, pointToSave); } if (winImpl.MilSpaceProfileCalsController.View.ActiveButton == ProfileSettingsPointButtonEnum.PointsSecond) { winImpl.MilSpaceProfileCalsController.SetSecondfPointForLineProfile(point, pointToSave); } if (winImpl.MilSpaceProfileCalsController.View.ActiveButton == ProfileSettingsPointButtonEnum.CenterFun) { winImpl.MilSpaceProfileCalsController.SetCenterPointForFunProfile(point, pointToSave); } var settings = winImpl.MilSpaceProfileCalsController.ProfileSettings[ProfileSettingsTypeEnum.Points]; }
protected override void OnClick() { try { // ------------------------------------ // Set the selection tool as the // current tool // ------------------------------------ _hookHelper.ExecuteSelectionTool(); // ------------------------------------- // Initialize the window with the helper // ------------------------------------- FiberDeviceConnectionWindow.AddinImpl winImpl = AddIn.FromID <FiberDeviceConnectionWindow.AddinImpl>(ThisAddIn.IDs.Esri_Telecom_Tools_Windows_FiberDeviceConnectionWindow); FiberDeviceConnectionWindow deviceWindow = winImpl.UI; deviceWindow.DisplayConnections(_deviceConnectionHelper, _hookHelper); // Get dockable window. UID dockWinID = new UIDClass(); dockWinID.Value = @"esriTelcoTools_FiberDeviceConnectionWindow"; IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID); dockWindow.Show(true); } catch (Exception ex) { _logHelper.addLogEntry(DateTime.Now.ToString(), "ERROR", "FiberDeviceConnectionCommand::OnClick()", ex.Message); } }
protected override void OnActivate() { try { UID dockWinID = new UIDClass(); dockWinID.Value = ThisAddIn.IDs.EditForm; IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID); if (!dockWindow.IsVisible()) { dockWindow.Show(true); } activeLayer = Editor.ActiveLayer; IRasterLayer rasterLayer = (IRasterLayer)activeLayer; IRasterProps rasterProp = (IRasterProps)rasterLayer.Raster; maxIndex = new Position(rasterProp.Width - 1, rasterProp.Height - 1); EditForm editForm = AddIn.FromID <EditForm.AddinImpl>(ThisAddIn.IDs.EditForm).UI; editForm.SetLayer(activeLayer.Name); System.Array noDataValue = (System.Array)rasterProp.NoDataValue; editForm.RasterGridView.NoDataValue = Convert.ToDouble(noDataValue.GetValue(0)); editForm.SetNoDataValue(editForm.RasterGridView.NoDataValue); } catch (Exception ex) { MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error"); } base.OnActivate(); }
void _fiberTraceHelper_TraceCompleted(object sender, EventArgs e) { _logHelper.addLogEntry(DateTime.Now.ToString(), "INFO", "Trace Complete"); List <ESRI.ArcGIS.Geodatabase.IRow> results = _fiberTraceHelper.TraceResults; if (showReportCheckBox.Checked == true) { UID dockWinID = new UIDClass(); dockWinID.Value = @"esriTelcoTools_FiberTraceReportWindow"; IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID); dockWindow.Show(true); // Show a report FiberTraceReportWindow.AddinImpl winImpl = AddIn.FromID <FiberTraceReportWindow.AddinImpl>( ThisAddIn.IDs.Esri_Telecom_Tools_Windows_FiberTraceReportWindow); FiberTraceReportWindow traceReportWindow = winImpl.UI; traceReportWindow.InitReport(_fiberTraceHelper); // Change this to a report helper traceReportWindow.PopulateReport(results); } // Select the traced features _fiberTraceHelper.SelectTracedDevices(); _fiberTraceHelper.SelectTracedSpliceClosures(); _fiberTraceHelper.SelectTracedFiberCables(); }
void Events_OnStartEditing() { // ----------------------------------- // Check to see if we are editing the // telecom workspace, and that // workspace is valid, if not ignore. // ----------------------------------- ESRI.ArcGIS.Geodatabase.IFeatureWorkspace workspace = (ESRI.ArcGIS.Geodatabase.IFeatureWorkspace)ArcMap.Editor.EditWorkspace; IFeatureWorkspace fwksp = TelecomWorkspaceHelper.Instance().CurrentWorkspace; bool wkspIsValid = TelecomWorkspaceHelper.Instance().CurrentWorkspaceIsValid; if (workspace == null || !wkspIsValid || !workspace.Equals(fwksp)) { return; } // ----------------------------------- // Workspace is valid for editing. // Get the splice form and set to // edit mode // ----------------------------------- FiberDeviceConnectionWindow.AddinImpl winImpl = AddIn.FromID <FiberDeviceConnectionWindow.AddinImpl>(ThisAddIn.IDs.Esri_Telecom_Tools_Windows_FiberDeviceConnectionWindow); FiberDeviceConnectionWindow deviceWindow = winImpl.UI; deviceWindow.IsEditing = true; }
protected override void OnMouseDown(MouseEventArgs arg) { base.OnMouseDown(arg); if (Painter.ActiveLayer != null && arg.Button == MouseButtons.Left) { try { ValueSymbolForm valueSymbolForm = AddIn.FromID <ValueSymbolForm.AddinImpl>(ThisAddIn.IDs.ValueSymbolForm).UI; selectedValue = valueSymbolForm.SelectedValue; selectedColor = valueSymbolForm.SelectedColor; IPoint startCoor = Raster.ScreenCoor2MapCoor(arg.X, arg.Y); if (!isDrawing) { newLineFeedback = new NewLineFeedback(); newLineFeedback.Display = ArcMap.Document.ActiveView.ScreenDisplay; newLineFeedback.Symbol = (ISymbol)Display.GetDefaultSelectLineSymbol(); newLineFeedback.Start(startCoor); } newLineFeedback.AddPoint(startCoor); } catch (Exception ex) { MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error"); } } }
internal void CallGraphsHandle(ProfileSession profileSession, ProfileSettingsTypeEnum profileType) { var winImpl = AddIn.FromID <DockableWindowMilSpaceProfileGraph.AddinImpl>(ThisAddIn.IDs.DockableWindowMilSpaceProfileGraph); winImpl.MilSpaceProfileCalsController.ShowWindow(); winImpl.MilSpaceProfileCalsController.AddSession(profileSession); }
/// <summary> /// Remove all selection if there is no layer loaded /// </summary> protected override void OnUpdate() { Enabled = ArcMap.Application != null; try { if (ArcMap.Document.FocusMap.LayerCount == 0) { Display.ClearElement(Editor.Selections.GetAllGraphicElements()); Editor.Selections.Clear(); UID dockWinID = new UIDClass(); dockWinID.Value = ThisAddIn.IDs.IdentifyForm; IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID); if (dockWindow.IsVisible()) { IdentifyForm identifyForm = AddIn.FromID <IdentifyForm.AddinImpl>(ThisAddIn.IDs.IdentifyForm).UI; identifyForm.ClearValues(); } } } catch (Exception ex) { MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error"); } }
private void Editor_OnSelectionChanged() { SF10_dckFrmSaisie.AddinImpl winImp = AddIn.FromID <SF10_dckFrmSaisie.AddinImpl>(ThisAddIn.IDs.SF10_dckFrmSaisie); SF10_dckFrmSaisie dnrWindow = winImp.UI; dnrWindow.UpdateSaisieDockWin(); }
void appStatusEvents_Initialized() { //The UID for the menu to add the custom button to string sMenuGuid = "{E45FE607-8E26-44D3-A851-86496FF031C9}";// "Parcel - Parcel Lines Context Menu." string sCommand1 = ""; //Get the custom button from the Addin. This initializes the button //if it hasn't already been initialized. var AM_Cmd1 = AddIn.FromID <ConstructionTraverse>(ThisAddIn.IDs.ConstructionTraverse); sCommand1 = "Esri_ParcelEditHelper_ConstructionTraverse"; AddCommandToApplicationMenu(m_pApp, sCommand1, sMenuGuid, false, "", false); //after "" command. var AM_Cmd5 = AddIn.FromID <PanTo>(ThisAddIn.IDs.PanTo); sCommand1 = "Esri_ParcelEditHelper_PanTo"; AddCommandToApplicationMenu(m_pApp, sCommand1, sMenuGuid, true, "", false); //after "" command. var AM_Cmd2 = AddIn.FromID <SaveLinesGridToFile>(ThisAddIn.IDs.SaveLinesGridToFile); sCommand1 = "Esri_ParcelEditHelper_SaveLinesGridToFile"; AddCommandToApplicationMenu(m_pApp, sCommand1, sMenuGuid, true, "", false); //after "" command. var AM_Cmd3 = AddIn.FromID <LoadFileToLinesGrid>(ThisAddIn.IDs.LoadFileToLinesGrid); sCommand1 = "Esri_ParcelEditHelper_LoadFileToLinesGrid"; AddCommandToApplicationMenu(m_pApp, sCommand1, sMenuGuid, false, "", false); //after "" command. var AM_Cmd4 = AddIn.FromID <BreaklineAddNewLines>(ThisAddIn.IDs.BreaklineAddNewLines); sMenuGuid = "{4598F676-8CEB-4fe1-8E4F-5ADB93379793}"; // "Parcel - Construction Lines Context Menu." sCommand1 = "Esri_ParcelEditHelper_BreaklineAddNewLines"; AddCommandToApplicationMenu(m_pApp, sCommand1, sMenuGuid, false, "{9987F18B-8CC4-4548-8C41-7DB51F289BB3}", false); //after "breakline" command. var AM_Cmd6 = AddIn.FromID <ClothoidSpiral>(ThisAddIn.IDs.ClothoidSpiral); sMenuGuid = "{02D578D0-42AB-11D2-84D6-0000F875B9C6}";// "Editor - Sketch tool Context Menu." sCommand1 = "Esri_ParcelEditHelper_ClothoidSpiral"; // AddCommandToApplicationMenu(m_pApp, sCommand1, sMenuGuid, false, "", false); //{E443DE0C-4F6E-45EC-8953-3B29678E1E74} after "sketch tangent curve" command. AddCommandToApplicationMenu(m_pApp, sCommand1, sMenuGuid, false, "{7FB343C2-B56A-11D2-9F1A-00C04F6BC979}", false); // after "esriEditor.TangentCurveSketchMenuItem" command. // If the extension hasn't been started yet, bail if (s_extension == null) { return; } //// Reset event handlers ESRI.ArcGIS.Carto.IActiveViewEvents_Event avEvent = ArcMap.Document.FocusMap as ESRI.ArcGIS.Carto.IActiveViewEvents_Event; if (avEvent == null) { return; } avEvent.ItemAdded += AvEvent_ItemAdded; avEvent.ItemDeleted += AvEvent_ItemAdded; avEvent.ContentsChanged += AvEvent_ContentsChanged; }
void appStatusEvents_Initialized() { //The UID for the menu to add the custom button to string sMenuGuid = "{CFFCF318-533D-4806-95F0-7DFF28D87084}";// "Parcel - Parcel Editor toolbar esriCadastralUI.CadastralEditorMenu" string sCommand1 = ""; //Get the custom button from the Addin. This initializes the button //if it hasn't already been initialized. var AM_Cmd1 = AddIn.FromID <AppendCadastralXMLFiles>(ThisAddIn.IDs.AppendCadastralXMLFiles); sCommand1 = "Esri_CadastralXML_AppendCadastralXMLFiles"; AddCommandToApplicationMenu(m_pApp, sCommand1, sMenuGuid, false, "{9FB04311-8CBC-4AFB-9F51-1C53658FB991}", false); //after "" command. // If the extension hasn't been started yet, bail if (s_extension == null) { return; } //// Reset event handlers ESRI.ArcGIS.Carto.IActiveViewEvents_Event avEvent = ArcMap.Document.FocusMap as ESRI.ArcGIS.Carto.IActiveViewEvents_Event; if (avEvent == null) { return; } avEvent.ItemAdded += AvEvent_ItemAdded; avEvent.ItemDeleted += AvEvent_ItemAdded; avEvent.ContentsChanged += AvEvent_ContentsChanged; }
protected override void OnMouseDown(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg) { if (arg.Button != System.Windows.Forms.MouseButtons.Left) { return; } try { //Get the active view from the ArcMap static class. IActiveView activeView = ArcMap.Document.FocusMap as IActiveView; var point = activeView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y) as IPoint; // always use WGS84 var sr = GetSR(); if (sr != null) { point.Project(sr); } var doc = AddIn.FromID <ArcMapAddinCoordinateTool.DockableWindowCoordinateTool.AddinImpl>(ThisAddIn.IDs.DockableWindowCoordinateTool); if (doc != null) { doc.SetInput(point.X, point.Y); } } catch { } }
/// <summary> /// Prepare the editor for editing. /// </summary> public static void StartEditing() { // Select a layer to edit first int rasterLayerCount = ArcMapApp.RasterLayerCount; if (rasterLayerCount == 1) { Editor.activeLayer = ArcMapApp.GetRasterLayer(); } else { SelectLayerForm selectLayerForm = new SelectLayerForm(); selectLayerForm.ShowDialog(); if (selectLayerForm.ReturnLayer == null) { return; } Editor.activeLayer = selectLayerForm.ReturnLayer; } Editor.IsEditing = true; Editor.Edits.Clear(); // Enable the save button SaveEditsButton saveButton = AddIn.FromID <SaveEditsButton>(ThisAddIn.IDs.SaveEditsButton); saveButton.IsEnabled = true; // Enable the save as button SaveEditsAsButton saveAsButton = AddIn.FromID <SaveEditsAsButton>(ThisAddIn.IDs.SaveEditsAsButton); saveAsButton.IsEnabled = true; // Enable the stop button StopEditingButton stopButton = AddIn.FromID <StopEditingButton>(ThisAddIn.IDs.StopEditingButton); stopButton.IsEnabled = true; // Enable the edit tool. EditTool selectTool = AddIn.FromID <EditTool>(ThisAddIn.IDs.EditTool); selectTool.IsEnabled = true; // Disable the start button StartEditingButton startEditingButton = AddIn.FromID <StartEditingButton>(ThisAddIn.IDs.StartEditingButton); startEditingButton.IsEnabled = false; // Enable the ShowEditsButton ShowEditsButton showEditsButton = AddIn.FromID <ShowEditsButton>(ThisAddIn.IDs.ShowEditsButton); showEditsButton.IsEnabled = true; }
void appStatusEvents_Initialized() { //The UID for the menu to add the custom button to string sMenuGuid = "{E6087790-BEBC-4de8-8221-BAEB12A60A58}";// "Cadastral Fabric Context Menu." string sCommand1 = ""; string sCommand2 = ""; if (m_bIsCatalog) { //Get the custom button from the Addin. This initializes the button //if it hasn't already been initialized. var AC_Cmd1 = AddIn.FromID <clsDeleteInconsistentRecords>(ThisAddIn.IDs.clsDeleteInconsistentRecords2); // sCommand1 = ThisAddIn.IDs.clsDeleteInconsistentRecords2.ToString(); // the ICommand to add sCommand1 = "Esri_DeleteSelectedParcels_Inconsistent_Records"; var AC_Cmd2 = AddIn.FromID <TruncateFabricTables>(ThisAddIn.IDs.TruncateFabricTables2); sCommand2 = ThisAddIn.IDs.TruncateFabricTables2.ToString(); // the ICommand to add } if (m_bIsMap) { //Get the custom button from the Addin. This initializes the button //if it hasn't already been initialized. var AM_Cmd1 = AddIn.FromID <clsDeleteInconsistentRecords>(ThisAddIn.IDs.clsDeleteInconsistentRecords); // sCommand1 = ThisAddIn.IDs.clsDeleteInconsistentRecords.ToString(); // the ICommand to add sCommand1 = "Esri_DeleteSelectedParcels_Inconsistent_Records"; var AM_Cmd2 = AddIn.FromID <TruncateFabricTables>(ThisAddIn.IDs.TruncateFabricTables); sCommand2 = ThisAddIn.IDs.TruncateFabricTables.ToString(); // the ICommand to add } AddCommandToApplicationMenu(m_pApp, sCommand1, sMenuGuid, false, "{3BFD71DE-024E-43EA-8A37-562324D839ED}", false); //after check fabric command. AddCommandToApplicationMenu(m_pApp, sCommand2, sMenuGuid, false, sCommand1, true); // If the extension hasn't been started yet, bail if (s_extension == null) { return; } if (m_bIsMap) { //// Reset event handlers ESRI.ArcGIS.Carto.IActiveViewEvents_Event avEvent = ArcMap.Document.FocusMap as ESRI.ArcGIS.Carto.IActiveViewEvents_Event; if (avEvent == null) { return; } avEvent.ItemAdded += AvEvent_ItemAdded; avEvent.ItemDeleted += AvEvent_ItemAdded; avEvent.ContentsChanged += AvEvent_ContentsChanged; } }
// protected override void Dispose(bool disposing) // { // base.Dispose(disposing); //// Events.OnStartEditing -= new IEditEvents_OnStartEditingEventHandler(Events_OnStartEditing); //// Events.OnStopEditing -= new IEditEvents_OnStopEditingEventHandler(Events_OnStopEditing); // } void Events_OnStopEditing(bool save) { // ----------------------------------- // Get the device connection form and // set to read only mode // ----------------------------------- FiberDeviceConnectionWindow.AddinImpl winImpl = AddIn.FromID <FiberDeviceConnectionWindow.AddinImpl>(ThisAddIn.IDs.Esri_Telecom_Tools_Windows_FiberDeviceConnectionWindow); FiberDeviceConnectionWindow deviceWindow = winImpl.UI; deviceWindow.IsEditing = false; }
public FiberEditorExtension() { try { // -------------------------------------- // Initialize log window with log helper // -------------------------------------- _logHelper = LogHelper.Instance(); TelecomToolsLogWindow.AddinImpl winImpl = AddIn.FromID <TelecomToolsLogWindow.AddinImpl>( ThisAddIn.IDs.Esri_Telecom_Tools_Windows_TelecomToolsLogWindow); TelecomToolsLogWindow logWindow = winImpl.UI; logWindow.InitLog(_logHelper); // -------------------- // Build a hook helper // -------------------- _hookHelper = HookHelperExt.Instance(this.Hook); // ------------------------------------------- // Initialize telecom workspace helper. // // Listen to ActiveViewChanged event. // // If this happens the focus map more than // likely changed. Since the tools go after // layers in the TOC we probably need to close // the current telecom workspace since // editing etc could not longer be done. // Should add code to ask for saving changes. // ------------------------------------------- _wkspHelper = TelecomWorkspaceHelper.Instance(); _wkspHelper.ActiveViewChanged += new EventHandler(_wkspHelper_ActiveViewChanged); // ------------------------------------------- // Build helpers that actually do all object // creation work for special feature types // ------------------------------------------- _fiberCableHelper = new FiberCableConfigHelper(_hookHelper, ArcMap.Editor as IEditor3); _fiberDeviceHelper = new FiberDeviceConfigHelper(_hookHelper, ArcMap.Editor as IEditor3); // -------------------------------------------- // Splice and Connection helpers // -------------------------------------------- _spliceHelper = new FiberSpliceHelper(_hookHelper, ArcMap.Editor as IEditor3); _connectionHelper = new FiberDeviceConnectionHelper(_hookHelper, ArcMap.Editor as IEditor3); _logHelper.addLogEntry(DateTime.Now.ToString(), "INFO", "Telecom Extension Constructed."); } catch (Exception ex) { _logHelper.addLogEntry(DateTime.Now.ToString(), "ERROR", "General error.", ex.ToString()); } }
// protected override void Dispose(bool disposing) // { // base.Dispose(disposing); //// Events.OnStartEditing -= new IEditEvents_OnStartEditingEventHandler(Events_OnStartEditing); //// Events.OnStopEditing -= new IEditEvents_OnStopEditingEventHandler(Events_OnStopEditing); // } void Events_OnStopEditing(bool save) { // ----------------------------------- // Get the splice form and set to // read only mode // ----------------------------------- FiberSpliceWindow.AddinImpl winImpl = AddIn.FromID <FiberSpliceWindow.AddinImpl>( ThisAddIn.IDs.Esri_Telecom_Tools_Windows_FiberSpliceWindow); FiberSpliceWindow spliceWindow = winImpl.UI; spliceWindow.IsEditing = false; }
protected override void OnMouseDown(MouseEventArgs arg) { UID toolId = new UIDClass(); toolId.Value = ThisAddIn.IDs.PickProfileCoordinates; var mxdDoc = ArcMap.Document; var screenDisplay = mxdDoc.ActiveView.ScreenDisplay; var point = screenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y); var pointToSave = screenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y); point.SpatialReference = pointToSave.SpatialReference = mxdDoc.FocusMap.SpatialReference; EsriTools.ProjectToWgs84(point); var winImpl = AddIn.FromID <DockableWindowMilSpaceProfileCalc.AddinImpl>(ThisAddIn.IDs.DockableWindowMilSpaceProfileCalc); var dem = winImpl.MilSpaceProfileCalsController.View.DemLayerName; MapLayersManager mngr = new MapLayersManager(mxdDoc.ActiveView); //Set Z value using selected DEM var rl = mngr.RasterLayers.FirstOrDefault(l => l.Name == dem); if (rl != null) { point.AddZCoordinate(rl.Raster); pointToSave.AddZCoordinate(rl.Raster); } else { MessageBox.Show(LocalizationContext.Instance.DemLayerNotChosenText, LocalizationContext.Instance.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (winImpl.MilSpaceProfileCalsController.View.ActiveButton == ProfileSettingsPointButtonEnum.PointsFist) { winImpl.MilSpaceProfileCalsController.SetFirsPointForLineProfile(point, pointToSave); } if (winImpl.MilSpaceProfileCalsController.View.ActiveButton == ProfileSettingsPointButtonEnum.PointsSecond) { winImpl.MilSpaceProfileCalsController.SetSecondfPointForLineProfile(point, pointToSave); } if (winImpl.MilSpaceProfileCalsController.View.ActiveButton == ProfileSettingsPointButtonEnum.CenterFun) { winImpl.MilSpaceProfileCalsController.SetCenterPointForFunProfile(point, pointToSave); } var settings = winImpl.MilSpaceProfileCalsController.ProfileSettings[ProfileSettingsTypeEnum.Points]; }
protected override void OnClick() { AddEditDataSource datasourceForm = new AddEditDataSource(ArcMap.Editor.EditWorkspace, globalVariables.currentDataSource); datasourceForm.ShowDialog(); // Find out if we were canceled if (datasourceForm.WasCanceled == false) { // Adjustments were made. Repopulate the Combobox! var dataSourceCombobox = AddIn.FromID <cmbDataSource>(ThisAddIn.IDs.cmbDataSource); dataSourceCombobox.PopulateComboboxContents(); } }
void appStatusEvents_Initialized() { //The UID for the menu to add the custom button to string sMenuGuid = "{E6087790-BEBC-4de8-8221-BAEB12A60A58}";// "Cadastral Fabric Context Menu." //FindGUIDOfCommandItem(m_pApp, "{E6087790-BEBC-4de8-8221-BAEB12A60A58}"); //List<string> tbs = new List<string>(); //List<string> tbs = ListArcMapVisibleToolbars(m_pApp); List <string> tbs = ListArcCatalogToolbars(m_pApp); string sCommand1 = ""; if (m_bIsCatalog) { //Get the custom button from the Addin. This initializes the button //if it hasn't already been initialized. var AC_Cmd1 = AddIn.FromID <LoadCOGOData>(ThisAddIn.IDs.LoadCOGOData2); sCommand1 = ThisAddIn.IDs.LoadCOGOData2.ToString(); // the ICommand to add } if (m_bIsMap) { //Get the custom button from the Addin. This initializes the button //if it hasn't already been initialized. var AM_Cmd1 = AddIn.FromID <LoadCOGOData>(ThisAddIn.IDs.LoadCOGOData); sCommand1 = ThisAddIn.IDs.LoadCOGOData.ToString(); // the ICommand to add } AddCommandToApplicationMenu(m_pApp, sCommand1, sMenuGuid, false, "", "{AEA2FE42-ADC8-4F2A-88C1-185CF9BA4EA6}", false); //after check fabric command. // If the extension hasn't been started yet, bail if (s_extension == null) { return; } if (m_bIsMap) { //// Reset event handlers ESRI.ArcGIS.Carto.IActiveViewEvents_Event avEvent = ArcMap.Document.FocusMap as ESRI.ArcGIS.Carto.IActiveViewEvents_Event; if (avEvent == null) { return; } } }
protected override void OnMouseMove(MouseEventArgs arg) { try { IPoint point = GetMapPoint(arg.X, arg.Y); var doc = AddIn.FromID <ArcMapAddinCoordinateConversion.DockableWindowCoordinateConversion.AddinImpl>(ThisAddIn.IDs.DockableWindowCoordinateConversion); if (doc != null && point != null) { doc.GetMainVM().IsHistoryUpdate = false; doc.SetInput(point.X, point.Y); } } catch { } }
private void setupDelegates() { Domain_Null buttonNull = AddIn.FromID <Domain_Null>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_Null); Domain_00 button0 = AddIn.FromID <Domain_00>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_00); Domain_01 button1 = AddIn.FromID <Domain_01>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_01); Domain_02 button2 = AddIn.FromID <Domain_02>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_02); Domain_03 button3 = AddIn.FromID <Domain_03>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_03); Domain_04 button4 = AddIn.FromID <Domain_04>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_04); Domain_05 button5 = AddIn.FromID <Domain_05>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_05); Domain_06 button6 = AddIn.FromID <Domain_06>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_06); Domain_07 button7 = AddIn.FromID <Domain_07>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_07); Domain_08 button8 = AddIn.FromID <Domain_08>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_08); Domain_09 button9 = AddIn.FromID <Domain_09>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_09); Domain_10 button10 = AddIn.FromID <Domain_10>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_10); Domain_11 button11 = AddIn.FromID <Domain_11>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_11); Domain_12 button12 = AddIn.FromID <Domain_12>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_12); Domain_13 button13 = AddIn.FromID <Domain_13>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_13); Domain_14 button14 = AddIn.FromID <Domain_14>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_14); Domain_15 button15 = AddIn.FromID <Domain_15>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_15); Domain_16 button16 = AddIn.FromID <Domain_16>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_16); Domain_17 button17 = AddIn.FromID <Domain_17>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_17); Domain_18 button18 = AddIn.FromID <Domain_18>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_18); Domain_19 button19 = AddIn.FromID <Domain_19>(ThisAddIn.IDs.RS_Tools_Tools_DomainAppointer_Domain_19); buttonNull.domain = ApplyDomainNull; button0.domain = ApplyDomain; button1.domain = ApplyDomain; button2.domain = ApplyDomain; button3.domain = ApplyDomain; button4.domain = ApplyDomain; button5.domain = ApplyDomain; button6.domain = ApplyDomain; button7.domain = ApplyDomain; button8.domain = ApplyDomain; button9.domain = ApplyDomain; button10.domain = ApplyDomain; button11.domain = ApplyDomain; button12.domain = ApplyDomain; button13.domain = ApplyDomain; button14.domain = ApplyDomain; button15.domain = ApplyDomain; button16.domain = ApplyDomain; button17.domain = ApplyDomain; button18.domain = ApplyDomain; button19.domain = ApplyDomain; }
void appStatusEvents_Initialized() { //The UID for the menu to add the custom button to string sMenuGuid = "{E6087790-BEBC-4de8-8221-BAEB12A60A58}";// "Cadastral Fabric Context Menu." string sCommand1 = ""; if (m_bIsCatalog) { //Get the custom button from the Addin. This initializes the button //if it hasn't already been initialized. var AC_Cmd1 = AddIn.FromID <FabricQC_Command>(ThisAddIn.IDs.CoordinateInverse2); sCommand1 = ThisAddIn.IDs.CoordinateInverse2.ToString(); // the ICommand to add } if (m_bIsMap) { //Get the custom button from the Addin. This initializes the button //if it hasn't already been initialized. var AM_Cmd1 = AddIn.FromID <FabricQC_Command>(ThisAddIn.IDs.CoordinateInverse); sCommand1 = ThisAddIn.IDs.CoordinateInverse.ToString(); // the ICommand to add } AddCommandToApplicationMenu(m_pApp, sCommand1, sMenuGuid, false, "", "{AEA2FE42-ADC8-4F2A-88C1-185CF9BA4EA6}", false); //after check fabric command. // If the extension hasn't been started yet, bail if (s_extension == null) { return; } if (m_bIsMap) { //// Reset event handlers ESRI.ArcGIS.Carto.IActiveViewEvents_Event avEvent = ArcMap.Document.FocusMap as ESRI.ArcGIS.Carto.IActiveViewEvents_Event; if (avEvent == null) { return; } avEvent.ItemAdded += AvEvent_ItemAdded; avEvent.ItemDeleted += AvEvent_ItemAdded; avEvent.ContentsChanged += AvEvent_ContentsChanged; } }
private void OnWindowLoaded(object sender, RoutedEventArgs e) { // TODO: loading animation foreach (var item in Helper) { Tables.Add(item); } NotifyPropertyChanged("Tables"); Refresh(); TableSearchButton butt = AddIn.FromID <TableSearchButton>(ThisAddIn.IDs.TableSearchButton); // we can't seem to get a handle on the open event butt.VisibilityChangedEvent += (o, evt) => { IDockableWindow searchWindow = ArcMap.DockableWindowManager.GetDockableWindow(ThisAddIn.IDs.TableSearchWindow.ToUID()); if (searchWindow.IsVisible()) { Refresh(); } }; }
protected override void OnMouseDown(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg) { if (arg.Button != System.Windows.Forms.MouseButtons.Left) { return; } try { var point = GetMapPoint(arg.X, arg.Y); var doc = AddIn.FromID <ArcMapAddinCoordinateConversion.DockableWindowCoordinateConversion.AddinImpl>(ThisAddIn.IDs.DockableWindowCoordinateConversion); if (doc != null && point != null) { doc.GetMainVM().IsToolGenerated = true; doc.SetInput(point.X, point.Y); } doc.GetMainVM().IsToolActive = false; } catch { } }
/// <summary> /// Stop editing. /// </summary> public static void StopEditing() { Editor.activeLayer = null; Editor.isEditing = false; Display.ClearElement(Editor.Edits.GetAllGraphicElements()); Editor.Edits.Clear(); Display.ClearElement(Editor.Selections.GetAllGraphicElements()); Editor.Selections.Clear(); StopEditingButton stopEditingButton = AddIn.FromID <StopEditingButton>(ThisAddIn.IDs.StopEditingButton); stopEditingButton.IsEnabled = false; StartEditingButton startEditionButton = AddIn.FromID <StartEditingButton>(ThisAddIn.IDs.StartEditingButton); startEditionButton.IsEnabled = true; SaveEditsButton saveEditsButton = AddIn.FromID <SaveEditsButton>(ThisAddIn.IDs.SaveEditsButton); saveEditsButton.IsEnabled = false; SaveEditsAsButton saveEditsAsButton = AddIn.FromID <SaveEditsAsButton>(ThisAddIn.IDs.SaveEditsAsButton); saveEditsAsButton.IsEnabled = false; EditTool selectTool = AddIn.FromID <EditTool>(ThisAddIn.IDs.EditTool); selectTool.IsEnabled = false; ShowEditsButton showEditsButton = AddIn.FromID <ShowEditsButton>(ThisAddIn.IDs.ShowEditsButton); showEditsButton.IsEnabled = false; EditForm editForm = AddIn.FromID <EditForm.AddinImpl>(ThisAddIn.IDs.EditForm).UI; editForm.ClearValues(); editForm.SetLayer(""); }
/// <summary> /// Stop editing. /// </summary> public static void StopEditing() { Editor.activeLayer = null; Editor.isEditing = false; Display.ClearElement(Editor.Edits.GetAllGraphicElements()); Editor.Edits.Clear(); Display.ClearElement(Editor.Selections.GetAllGraphicElements()); Editor.Selections.Clear(); if (ArcMap.Application.CurrentTool.Caption == "Select") { ArcMap.Application.CurrentTool = null; } StopEditingButton stopEditingButton = AddIn.FromID <StopEditingButton>(ThisAddIn.IDs.StopEditingButton); stopEditingButton.IsEnabled = false; StartEditingButton startEditionButton = AddIn.FromID <StartEditingButton>(ThisAddIn.IDs.StartEditingButton); startEditionButton.IsEnabled = true; SaveEditsButton saveEditsButton = AddIn.FromID <SaveEditsButton>(ThisAddIn.IDs.SaveEditsButton); saveEditsButton.IsEnabled = false; SaveEditsAsButton saveEditsAsButton = AddIn.FromID <SaveEditsAsButton>(ThisAddIn.IDs.SaveEditsAsButton); saveEditsAsButton.IsEnabled = false; EditTool selectTool = AddIn.FromID <EditTool>(ThisAddIn.IDs.EditTool); selectTool.IsEnabled = false; ShowEditsButton showEditsButton = AddIn.FromID <ShowEditsButton>(ThisAddIn.IDs.ShowEditsButton); showEditsButton.IsEnabled = false; }
protected override void OnClick() { try { // ----------------------------------- // Show the fiber trace dialog // ----------------------------------- UID dockWinID = new UIDClass(); dockWinID.Value = @"esriTelcoTools_FiberTraceWindow"; IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID); dockWindow.Show(true); FiberTraceWindow.AddinImpl winImpl = AddIn.FromID <FiberTraceWindow.AddinImpl>( ThisAddIn.IDs.Esri_Telecom_Tools_Windows_FiberTraceWindow); FiberTraceWindow traceWindow = winImpl.UI; traceWindow.InitFiberTrace(_fiberTraceHelper); } catch (Exception ex) { _logHelper.addLogEntry(DateTime.Now.ToString(), "ERROR", "FiberTraceCommand::OnClick", ex.Message); } }