Пример #1
0
 /// <summary>Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded.</summary>
 /// <param term='disconnectMode'>Describes how the Add-in is being unloaded.</param>
 /// <param term='custom'>Array of parameters that are host application specific.</param>
 /// <seealso class='IDTExtensibility2' />
 public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
 {
     if (events != null)
     {
         events.BeforeExecute -= OnPaste;
     }
 }
 /// <summary>Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded.</summary>
 /// <param term='disconnectMode'>Describes how the Add-in is being unloaded.</param>
 /// <param term='custom'>Array of parameters that are host application specific.</param>
 /// <seealso class='IDTExtensibility2' />
 public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom) {
     //Definition of handlers for solution events
     if (disconnectMode != ext_DisconnectMode.ext_dm_UISetupComplete &&
         disconnectMode != ext_DisconnectMode.ext_dm_HostShutdown) {
         addinEventSink.OnDisconnect();
     }
 }
Пример #3
0
 /// <summary>
 /// アドインがOneNoteから切断された際に呼ばれます
 /// </summary>
 /// <param name="RemoveMode"></param>
 /// <param name="custom"></param>
 /// <remarks>アドインの終了処理を行います</remarks>
 public void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
 {
     cli.Dispose();
     this.cli = null;
     GC.Collect();
     GC.WaitForPendingFinalizers();
 }
Пример #4
0
        public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
        {
            //if (disconnectMode == ext_DisconnectMode.ext_dm_HostShutdown
            //    || disconnectMode == ext_DisconnectMode.ext_dm_UserClosed)
            //{
            //    _gitPlugin.DeleteCommands();
            //    _gitPlugin.DeleteCommandBar(GitToolBarName);
            //    //Place the command on the tools menu.
            //    //Find the MenuBar command bar, which is the top-level command bar holding all the main menu items:
            //    var menuBarCommandBar = ((CommandBars)_applicationObject.CommandBars)["MenuBar"];

            //    CommandBarControl toolsControl;
            //    try
            //    {
            //        toolsControl = menuBarCommandBar.Controls["Git"];
            //        if (toolsControl != null)
            //        {
            //            toolsControl.Delete();
            //        }
            //    }
            //    catch
            //    {
            //    }
            //}
        }
Пример #5
0
        public void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
        {
 		// If this is not because of host shutdown(removed by user for example) we call OnBeginShutdown at hand
    		if (RemoveMode != ext_DisconnectMode.ext_dm_HostShutdown)
        		OnBeginShutdown(ref custom);

$ApplicationDestroy$
        }
			public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
			{
				if(null == m_plugin)
					return;

				Log.Debug("Disconnect called...");
				((Options)m_plugin.Options).Save();
				Log.ClearHandlers();
			}
Пример #7
0
        /// <summary>Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded.</summary>
        /// <param term='disconnectMode'>Describes how the Add-in is being unloaded.</param>
        /// <param term='custom'>Array of parameters that are host application specific.</param>
        /// <seealso class='IDTExtensibility2' />
        public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
        {
            System.Diagnostics.Trace.WriteLine(string.Format("Event: OnDisconnection, disconnectMode: {0}", disconnectMode));
            CommandBar mdiDocCommandBar =
                        ((CommandBars)_applicationObject.CommandBars)["Easy MDI Document Window"];

            //mdiDocCommandBar.Controls["Close All Documents"].Delete();
            mdiDocCommandBar.Controls["Display All Commands"].Delete();
        }
Пример #8
0
        public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
        {
            if (_listener == null)
                return;

            _listener.BeforeSave -= DocumentListener_BeforeSave;
            _listener.Dispose();
            _listener = null;
        }
Пример #9
0
        /// <summary>Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded.</summary>
        /// <param term='disconnectMode'>Describes how the Add-in is being unloaded.</param>
        /// <param term='custom'>Array of parameters that are host application specific.</param>
        /// <seealso class='IDTExtensibility2' />
        public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
        {
            switch (disconnectMode)
            {
                case ext_DisconnectMode.ext_dm_HostShutdown:
                case ext_DisconnectMode.ext_dm_UserClosed:

                    SwitchAddin.Instance.DestroyUserInterface();

                    break;
            }
        }
Пример #10
0
 public void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
 {
     try
     {
         if (null != _application)
             _application.Dispose();
     }
     catch (Exception exception)
     {
         OfficeRegistry.LogErrorMessage(_hostApplicationName, _progId, "Error occured in OnDisconnection. ", exception);
     }
 }
Пример #11
0
 void IDTExtensibility2.OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
 {
     try
     {
         if (null != _excelApplication)
             _excelApplication.Dispose();
     }
     catch (Exception exception)
     {
         string message = string.Format("An error occured.{0}{0}{1}", Environment.NewLine, exception.Message);
         MessageBox.Show(message, _progId, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #12
0
		public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
		{
			if (disconnectMode == ext_DisconnectMode.ext_dm_UserClosed)
			{
				try
				{
					LogHelper.LogDebug("Performing cleanup");
					this.Cleanup();
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message, "CodeKeep");
				}
			}
		}
        public void OnDisconnection(ext_DisconnectMode removeMode, ref Array custom)
        {
            try
            {
                _appDomain.DomainUnload -= HandleAppDomainChange;
                _appDomainManager.Dispose();
            }
            catch
            {
            }
            Notify("Unloaded. Goodbye.");

            _appDomainManager = null;
            _dte = null;
            _appDomain = null;
        }
Пример #14
0
 void IDTExtensibility2.OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
 {
     try
     {
         if (null != _wordApplication)
         {
             // word ignores the temporary parameter in created menus(not toolbars) and save menu settings to normal.dot 
             RemoveGui();
             _wordApplication.Dispose();
         }
     }
     catch (Exception exception)
     {
         string message = string.Format("An error occured.{0}{0}{1}", Environment.NewLine, exception.Message);
         MessageBox.Show(message, _prodId, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #15
0
 /// <summary>Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded.</summary>
 /// <param term='disconnectMode'>Describes how the Add-in is being unloaded.</param>
 /// <param term='custom'>Array of parameters that are host application specific.</param>
 /// <seealso class='IDTExtensibility2' />
 public void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
 {
     try
     {
         switch (RemoveMode)
         {
             case ext_DisconnectMode.ext_dm_HostShutdown:
             case ext_DisconnectMode.ext_dm_UserClosed:
                 SetupCommandBarButton();
                 SetupCommands();
                 break;
         }
     }
     catch (System.Exception e)
     {
         System.Windows.Forms.MessageBox.Show(e.ToString());
     }
 }
Пример #16
0
        void IDTExtensibility2.OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
        {
            try
            {
                foreach (ITaskPane item in TaskPaneInstances)
                {
                    try
                    {
                        item.OnDisconnection();
                    }
                    catch (NetRuntimeSystem.Exception exception)
                    {
                        NetOffice.DebugConsole.Default.WriteException(exception);
                    }
                }

                foreach (var item in TaskPanes)
                {
                    try
                    {
                        if (null != item.Pane && !item.Pane.IsDisposed)
                            item.Pane.Dispose();
                    }
                    catch (NetRuntimeSystem.Exception exception)
                    {
                        NetOffice.DebugConsole.Default.WriteException(exception);
                    }
                }

                try
                {
                    if (null != TaskPaneFactory && false == TaskPaneFactory.IsDisposed)
                        TaskPaneFactory.Dispose();
                }
                catch (NetRuntimeSystem.Exception exception)
                {
                    NetOffice.DebugConsole.Default.WriteException(exception);
                }

                try
                {
                    Tweaks.DisposeTweaks(Factory, this, Type);
                    RaiseOnDisconnection(RemoveMode, ref custom);
                    Utils.Dispose();

                }
                catch (NetRuntimeSystem.Exception exception)
                {
                    Factory.Console.WriteException(exception);
                }

                try
                {
                    if (!Application.IsDisposed)
                        Application.Dispose();
                }
                catch (NetRuntimeSystem.Exception exception)
                {
                    NetOffice.DebugConsole.Default.WriteException(exception);
                }	
            }
            catch (NetRuntimeSystem.Exception exception)
            {
                NetOffice.DebugConsole.Default.WriteException(exception);
                OnError(ErrorMethodKind.OnDisconnection, exception);
            }
        }
Пример #17
0
 public void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
 {
     Dispose();
 }
Пример #18
0
        /// <summary>
        /// Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded.
        /// </summary>
        /// <param name="disconnectMode">Describes how the Add-in is being unloaded.</param>
        /// <param name="custom">Array of parameters that are host application specific.</param>
        /// <seealso cref="IDTExtensibility2"/>
        public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
        {
            EngineManager.Dispose();

            if (disconnectMode == ext_DisconnectMode.ext_dm_UserClosed) {
                // Delete the Commands
                CommandHelper.RemoveCommand(this.App, COMMANDNAMESPACE + "." + POPUP_MENU_NAME_MINIFIER);
                CommandHelper.RemoveCommand(this.App, COMMANDNAMESPACE + "." + POPUP_MENU_NAME_JSHINT);
                CommandHelper.RemoveCommand(this.App, COMMANDNAMESPACE + "." + POPUP_MENU_NAME_CSSLINT);

                // Remove the controls from the CommandBars
                CommandHelper.RemoveCommandControl(this.App, "Item", POPUP_MENU_NAME_MINIFIER);
                CommandHelper.RemoveCommandControl(this.App, "Item", POPUP_MENU_NAME_JSHINT);
                CommandHelper.RemoveCommandControl(this.App, "Item", POPUP_MENU_NAME_CSSLINT);
            }
        }
Пример #19
0
 public void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
 {
     RemoveMenus();
 }
Пример #20
0
 public void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
 {
     Dispose();
 }
 /// <summary>Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded.</summary>
 /// <param term='disconnectMode'>Describes how the Add-in is being unloaded.</param>
 /// <param term='custom'>Array of parameters that are host application specific.</param>
 /// <seealso class='IDTExtensibility2' />
 public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
 {
     try
     {
         switch (disconnectMode)
         {
             case ext_DisconnectMode.ext_dm_HostShutdown:
             case ext_DisconnectMode.ext_dm_UserClosed:
                 clearUserTemporayUI();
                 break;
         }
     }
     catch (System.Exception e)
     {
         System.Windows.Forms.MessageBox.Show(e.ToString());
     }
 }
Пример #22
0
        void IDTExtensibility2.OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
        {
            try
            {
                foreach (ITaskPane item in TaskPaneInstances)
                {
                    try
                    {
                        item.OnDisconnection();
                    }
                    catch (NetRuntimeSystem.Exception exception)
                    {
                        NetOffice.DebugConsole.Default.WriteException(exception);
                    }
                }

                foreach (var item in TaskPanes)
                {
                    try
                    {
                        if (null != item.Pane && !item.Pane.IsDisposed)
                        {
                            item.Pane.Dispose();
                        }
                    }
                    catch (NetRuntimeSystem.Exception exception)
                    {
                        NetOffice.DebugConsole.Default.WriteException(exception);
                    }
                }

                try
                {
                    if (null != TaskPaneFactory && false == TaskPaneFactory.IsDisposed)
                    {
                        TaskPaneFactory.Dispose();
                    }
                }
                catch (NetRuntimeSystem.Exception exception)
                {
                    NetOffice.DebugConsole.Default.WriteException(exception);
                }

                try
                {
                    Tweaks.DisposeTweaks(Factory, this, Type);
                    RaiseOnDisconnection(RemoveMode, ref custom);
                    Utils.Dispose();
                }
                catch (NetRuntimeSystem.Exception exception)
                {
                    Factory.Console.WriteException(exception);
                }

                try
                {
                    if (!Application.IsDisposed)
                    {
                        Application.Dispose();
                    }
                }
                catch (NetRuntimeSystem.Exception exception)
                {
                    NetOffice.DebugConsole.Default.WriteException(exception);
                }
            }
            catch (NetRuntimeSystem.Exception exception)
            {
                NetOffice.DebugConsole.Default.WriteException(exception);
                OnError(ErrorMethodKind.OnDisconnection, exception);
            }
        }
Пример #23
0
 public void OnDisconnection([In] ext_DisconnectMode removeMode, [In, MarshalAs(29, SafeArraySubType = VarEnum.VT_VARIANT)] ref Array custom)
 {
     Trace.WriteLine($"Addin disconnecting from application. Mode: {removeMode}");
 }
Пример #24
0
 void Addin_OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
 {
 }
Пример #25
0
 public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
 {
     _gitPlugin.DeleteCommands();
 }
Пример #26
0
        private void Addin_OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
        {

        }
Пример #27
0
 public void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
 {
     OneNoteApplication = null;
     GC.Collect();
     GC.WaitForPendingFinalizers();
 }
Пример #28
0
        /// <summary>
        /// Occurs whenever an add-in is unloaded from MS Office
        /// </summary>
        /// <param name="removeMode">An ext_DisconnectMode enumeration value that informs an add-in why it was unloaded.</param>
        /// <param name="custom">An empty array that you can use to pass host-specific data for use after the add-in unloads</param>
        protected override void HandleOnDisconnection(ext_DisconnectMode removeMode, ref Array custom)
        {
            try
            {
                RaiseOnDisconnection(removeMode, ref custom);
                Utils.Dispose();
            }
            catch (NetRuntimeSystem.Exception exception)
            {
                Factory.Console.WriteException(exception);
            }

            foreach (ITaskPane item in TaskPaneInstances)
            {
                try
                {
                    item.OnDisconnection();
                }
                catch (NetRuntimeSystem.Exception exception)
                {
                    Factory.Console.WriteException(exception);
                }
            }

            foreach (var item in TaskPanes)
            {
                try
                {
                    if (null != item.Pane && !item.Pane.IsDisposed)
                    {
                        item.Pane.Dispose();
                    }
                }
                catch (NetRuntimeSystem.Exception exception)
                {
                    Factory.Console.WriteException(exception);
                }
            }

            try
            {
                if (null != RibbonUI)
                {
                    RibbonUI.Dispose();
                    RibbonUI = null;
                }
            }
            catch (NetRuntimeSystem.Exception exception)
            {
                Factory.Console.WriteException(exception);
            }

            try
            {
                if (null != TaskPaneFactory && false == TaskPaneFactory.IsDisposed)
                {
                    TaskPaneFactory.Dispose();
                }
            }
            catch (NetRuntimeSystem.Exception exception)
            {
                Factory.Console.WriteException(exception);
            }

            try
            {
                if (null != RibbonUI)
                {
                    RibbonUI.Dispose();
                    RibbonUI = null;
                }
            }
            catch (NetRuntimeSystem.Exception exception)
            {
                Factory.Console.WriteException(exception);
            }

            try
            {
                if (!Application.IsDisposed)
                {
                    Application.Dispose();
                }
            }
            catch (NetRuntimeSystem.Exception exception)
            {
                Factory.Console.WriteException(exception);
            }

            try
            {
                CleanUp();
            }
            catch (NetRuntimeSystem.Exception exception)
            {
                Factory.Console.WriteException(exception);
            }
        }
Пример #29
0
		/// <summary>
		/// Implements the OnDisconnection method of the IDTExtensibility2 interface. 
		/// Occurs when the Add-in is being unloaded.
		/// </summary>
		/// <param name="disconnectMode">Describes how the Add-in is being unloaded.</param>
		/// <param name="custom">Array of parameters that are host application specific.</param>
		/// <seealso cref="IDTExtensibility2"/>
		public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
		{
			if (Composer != null)
				Composer.Dispose();

			Logger.Log("Goodbye!");
		}
Пример #30
0
 /// <summary>Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded.</summary>
 /// <param term='disconnectMode'>Describes how the Add-in is being unloaded.</param>
 /// <param term='custom'>Array of parameters that are host application specific.</param>
 /// <seealso class='IDTExtensibility2' />
 void IDTExtensibility2.OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
 {
     _application = null;
     _addInInstance = null;
 }
Пример #31
0
 public virtual void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
 {
     Debug.Print("ExcelComAddIn.OnDisconnection");
 }
Пример #32
0
 public virtual void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
 {
     Logger.ComAddIn.Verbose("ExcelComAddIn.OnDisconnection");
 }
Пример #33
0
 /// <summary>Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded.</summary>
 /// <param term='disconnectMode'>Describes how the Add-in is being unloaded.</param>
 /// <param term='custom'>Array of parameters that are host application specific.</param>
 /// <seealso class='IDTExtensibility2' />
 public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
 {
     eventHandler.Disconnect();
     if (!commandLine)
     {
         try
         {
             initializer.removeCommands();
             UpdateDefaultEditors(false);
         }
         catch (System.Exception e)
         {
             MessageBox.Show(e.Message + "\r\n\r\nStacktrace:\r\n" + e.StackTrace);
         }
     }
 }
Пример #34
0
        private void RaiseOnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
        {
            try
            {
                if (null != OnDisconnection)
                    OnDisconnection(RemoveMode, ref custom);
            }
            catch (NetRuntimeSystem.Exception exception)
            {
				NetOffice.DebugConsole.Default.WriteException(exception);
                OnError(ErrorMethodKind.OnDisconnection, exception);
            }
        }
Пример #35
0
 /// <summary>
 /// This method is called when the add-in is about to be unloaded. The 
 /// add-in will be unloaded when Visio is shutting down or when a user 
 /// has removed or deselected the add-in from the "COM Add-Ins" dialog.
 /// </summary>
 /// <param name="removeMode">Tells the add-in why Visio is disconnecting.</param>        
 /// <param name="custom">Array of additional parameters for the add-in, not used in this case.</param>
 public void OnDisconnection( ext_DisconnectMode removeMode, ref Array custom )
 {
     try
     {
         if ( _eventSink != null )
             _eventSink.Dispose();
     }
     catch ( Exception ex )
     {
         ESIMessageBox.ShowError( ex );
     }
 }
Пример #36
0
 /// <summary>Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded.</summary>
 /// <param term='disconnectMode'>Describes how the Add-in is being unloaded.</param>
 /// <param term='custom'>Array of parameters that are host application specific.</param>
 /// <seealso class='IDTExtensibility2' />
 public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
 {
 }
Пример #37
0
		public void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
		{
			OneNoteApplication = null;
			GC.Collect();
			GC.WaitForPendingFinalizers();
		}
Пример #38
0
 public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
 {
     ThisAddIn_Shutdown();
 }
Пример #39
0
 /// <summary>Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded.</summary>
 /// <param term='disconnectMode'>Describes how the Add-in is being unloaded.</param>
 /// <param term='custom'>Array of parameters that are host application specific.</param>
 /// <seealso class='IDTExtensibility2' />
 public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
 {
 }
 public void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
 {
     return;
 }