本文整理汇总了C#中ext_DisconnectMode类的典型用法代码示例。如果您正苦于以下问题:C# ext_DisconnectMode类的具体用法?C# ext_DisconnectMode怎么用?C# ext_DisconnectMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ext_DisconnectMode类属于命名空间,在下文中一共展示了ext_DisconnectMode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDisconnection
/// <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;
}
}
示例2: OnDisconnection
/// <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: OnDisconnection
/// <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: OnDisconnection
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: OnDisconnection
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$
}
示例6: OnDisconnection
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: OnDisconnection
/// <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: OnDisconnection
public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
{
if (_listener == null)
return;
_listener.BeforeSave -= DocumentListener_BeforeSave;
_listener.Dispose();
_listener = null;
}
示例9: OnDisconnection
/// <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: OnDisconnection
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: catch
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: OnDisconnection
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");
}
}
}
示例13: OnDisconnection
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: RemoveGui
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: OnDisconnection
/// <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);
}
}