Ejemplo n.º 1
0
        /// <summary>
        /// Constructs a new FiberSpliceConfigHelper
        /// </summary>
        /// <param name="hook">Hook</param>
        /// <param name="editor">Editor</param>
        public FiberSpliceHelper(HookHelperExt hookHelper, IEditor3 editor)
//            : base(hook)
//            : base(hook, editor)
        {
            _hookHelper = hookHelper;
            _editor     = editor;
        }
        /// <summary>
        /// Constructs a new ConnectionEditorHelper
        /// </summary>
        /// <param name="hook">Hook</param>
        /// <param name="editor">Editor</param>
        public FiberDeviceConnectionHelper(HookHelperExt hookHelper, IEditor3 editor)
//            : base(hook)
//            : base(hook, editor)
        {
            _hookHelper = hookHelper;
            _editor     = editor;
        }
Ejemplo n.º 3
0
 public static HookHelperExt Instance(object hook)
 {
     if (_instance == null)
     {
         _instance = new HookHelperExt(hook);
     }
     return(_instance);
 }
        /// <summary>
        /// Constructs a new FiberTraceHelper
        /// </summary>
        /// <param name="hookHelper">HookHelper</param>
        /// 
        public FiberTraceHelper(HookHelperExt hookHelper)
        {
            _hookHelper = hookHelper;

            // -------------------------------------------------
            // Listen for selections only when a valid telecom
            // workspace has been opened.
            // -------------------------------------------------
            _wkspHelper.ValidWorkspaceSelected += new EventHandler(_wkspHelper_ValidWorkspaceSelected);
            _wkspHelper.WorkspaceClosed += new EventHandler(_wkspHelper_WorkspaceClosed);
        }
        /// <summary>
        /// Constructs a new FiberTraceHelper
        /// </summary>
        /// <param name="hookHelper">HookHelper</param>
        ///
        public FiberTraceHelper(HookHelperExt hookHelper)
        {
            _hookHelper = hookHelper;

            // -------------------------------------------------
            // Listen for selections only when a valid telecom
            // workspace has been opened.
            // -------------------------------------------------
            _wkspHelper.ValidWorkspaceSelected += new EventHandler(_wkspHelper_ValidWorkspaceSelected);
            _wkspHelper.WorkspaceClosed        += new EventHandler(_wkspHelper_WorkspaceClosed);
        }
        public FiberDeviceConnectionWindow(object hook)
        {
            InitializeComponent();
            this.Hook = hook;

            _hookHelper = HookHelperExt.Instance(hook);

            // --------------------------------------------
            // Listen to workspace changes. Wire up events
            // only when a valid workspace is selected.
            // --------------------------------------------
            _wkspHelper.ValidWorkspaceSelected += new EventHandler(_wkspHelper_ValidWorkspaceSelected);
            _wkspHelper.WorkspaceClosed += new EventHandler(_wkspHelper_WorkspaceClosed);
        }
        public FiberDeviceConnectionCommand()
        {
            try
            {
                if (ArcMap.Editor == null)
                {
                    _logHelper.addLogEntry(DateTime.Now.ToString(), "ERROR", "Editor License not found.", "FiberDeviceConnectionCommand()");
                    return;
                }

                // -----------------------------------
                // Construct a new hook helper and a
                // connections helper that does all the
                // cable to device connection work
                // -----------------------------------
                _hookHelper = HookHelperExt.Instance(this.Hook);
                _deviceConnectionHelper = new FiberDeviceConnectionHelper(_hookHelper, ArcMap.Editor as IEditor3);

                // -----------------------------------
                // Always hide connections window on
                // any initialization
                // -----------------------------------
                UID dockWinID = new UIDClass();
                dockWinID.Value = @"esriTelcoTools_FiberDeviceConnectionWindow";
                IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
                dockWindow.Show(false);

                // -----------------------------------
                // Track the start and stop of editing
                // -----------------------------------
                Events.OnStartEditing += new IEditEvents_OnStartEditingEventHandler(Events_OnStartEditing);
                Events.OnStopEditing += new IEditEvents_OnStopEditingEventHandler(Events_OnStopEditing);
            }
            catch (Exception ex)
            {
                _logHelper.addLogEntry(DateTime.Now.ToString(), "ERROR", "FiberDeviceConnectionCommand()", ex.Message);
            }
        }
 public FiberCableConfigHelper(HookHelperExt hookHelper, ESRI.ArcGIS.Editor.IEditor3 editor)
     : base(editor)
 {
     _hookHelper = hookHelper;
 }
        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());
            }
        }
 public static HookHelperExt Instance(object hook)
 {
     if (_instance == null)
     {
         _instance = new HookHelperExt(hook);
     }
     return _instance;
 }
 public FiberCableConfigHelper(HookHelperExt hookHelper, ESRI.ArcGIS.Editor.IEditor3 editor)
     : base(editor)
 {
     _hookHelper = hookHelper;
 }
 //            : base(hook)
 //            : base(hook, editor)
 /// <summary>
 /// Constructs a new ConnectionEditorHelper
 /// </summary>
 /// <param name="hook">Hook</param>
 /// <param name="editor">Editor</param>
 public FiberDeviceConnectionHelper(HookHelperExt hookHelper, IEditor3 editor)
 {
     _hookHelper = hookHelper;
     _editor = editor;
 }
 //            : base(hook)
 //            : base(hook, editor)
 /// <summary>
 /// Constructs a new FiberSpliceConfigHelper
 /// </summary>
 /// <param name="hook">Hook</param>
 /// <param name="editor">Editor</param>
 public FiberSpliceHelper(HookHelperExt hookHelper, IEditor3 editor)
 {
     _hookHelper = hookHelper;
     _editor = editor;
 }
        /// <summary>
        /// To prepare and display the form to the user
        /// </summary>
        /// <param name="connectionHelper">Class providing helper methods for connections</param>
        public void DisplayConnections(FiberDeviceConnectionHelper connectionHelper, HookHelperExt hookHelper)
        {
            _connectionHelper = connectionHelper;
            _hookHelper = hookHelper;

            // Changes the GUI appropriately
            SetEditState(_isEditing);

            // Populate drop downs with splice closure and device info.
            PopulateDropDowns(connectionHelper);
        }