Exemplo n.º 1
0
 // ------------------------------------
 // Use this static helper to get hold
 // of a Telecom Workspace Helper.
 // ------------------------------------
 public static TelecomWorkspaceHelper Instance()
 {
     if (_instance == null)
     {
         _instance = new TelecomWorkspaceHelper();
     }
     return(_instance);
 }
        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());
            }
        }
 // ------------------------------------
 // Use this static helper to get hold
 // of a Telecom Workspace Helper.
 // ------------------------------------
 public static TelecomWorkspaceHelper Instance()
 {
     if(_instance == null)
     {
         _instance = new TelecomWorkspaceHelper();
     }
     return _instance;
 }