📄 inspectorevents_10_eventprovider.cs
字号:
namespace Microsoft.Office.Interop.Outlook
{
using System;
using System.Collections;
using System.Runtime.InteropServices;
using System.Threading;
internal sealed class InspectorEvents_10_EventProvider : InspectorEvents_10_Event, IDisposable
{
private ArrayList m_aEventSinkHelpers;
private UCOMIConnectionPoint m_ConnectionPoint;
private UCOMIConnectionPointContainer m_ConnectionPointContainer;
public InspectorEvents_10_EventProvider(object obj1)
{
this.m_ConnectionPointContainer = (UCOMIConnectionPointContainer) obj1;
}
public override void add_Activate(InspectorEvents_10_ActivateEventHandler handler1)
{
lock (this)
{
if (this.m_ConnectionPoint == null)
{
this.Init();
}
InspectorEvents_10_SinkHelper helper = new InspectorEvents_10_SinkHelper();
int pdwCookie = 0;
this.m_ConnectionPoint.Advise((object) helper, out pdwCookie);
helper.m_dwCookie = pdwCookie;
helper.m_ActivateDelegate = handler1;
this.m_aEventSinkHelpers.Add((object) helper);
}
}
public override void add_BeforeMaximize(InspectorEvents_10_BeforeMaximizeEventHandler handler1)
{
lock (this)
{
if (this.m_ConnectionPoint == null)
{
this.Init();
}
InspectorEvents_10_SinkHelper helper = new InspectorEvents_10_SinkHelper();
int pdwCookie = 0;
this.m_ConnectionPoint.Advise((object) helper, out pdwCookie);
helper.m_dwCookie = pdwCookie;
helper.m_BeforeMaximizeDelegate = handler1;
this.m_aEventSinkHelpers.Add((object) helper);
}
}
public override void add_BeforeMinimize(InspectorEvents_10_BeforeMinimizeEventHandler handler1)
{
lock (this)
{
if (this.m_ConnectionPoint == null)
{
this.Init();
}
InspectorEvents_10_SinkHelper helper = new InspectorEvents_10_SinkHelper();
int pdwCookie = 0;
this.m_ConnectionPoint.Advise((object) helper, out pdwCookie);
helper.m_dwCookie = pdwCookie;
helper.m_BeforeMinimizeDelegate = handler1;
this.m_aEventSinkHelpers.Add((object) helper);
}
}
public override void add_BeforeMove(InspectorEvents_10_BeforeMoveEventHandler handler1)
{
lock (this)
{
if (this.m_ConnectionPoint == null)
{
this.Init();
}
InspectorEvents_10_SinkHelper helper = new InspectorEvents_10_SinkHelper();
int pdwCookie = 0;
this.m_ConnectionPoint.Advise((object) helper, out pdwCookie);
helper.m_dwCookie = pdwCookie;
helper.m_BeforeMoveDelegate = handler1;
this.m_aEventSinkHelpers.Add((object) helper);
}
}
public override void add_BeforeSize(InspectorEvents_10_BeforeSizeEventHandler handler1)
{
lock (this)
{
if (this.m_ConnectionPoint == null)
{
this.Init();
}
InspectorEvents_10_SinkHelper helper = new InspectorEvents_10_SinkHelper();
int pdwCookie = 0;
this.m_ConnectionPoint.Advise((object) helper, out pdwCookie);
helper.m_dwCookie = pdwCookie;
helper.m_BeforeSizeDelegate = handler1;
this.m_aEventSinkHelpers.Add((object) helper);
}
}
public override void add_Close(InspectorEvents_10_CloseEventHandler handler1)
{
lock (this)
{
if (this.m_ConnectionPoint == null)
{
this.Init();
}
InspectorEvents_10_SinkHelper helper = new InspectorEvents_10_SinkHelper();
int pdwCookie = 0;
this.m_ConnectionPoint.Advise((object) helper, out pdwCookie);
helper.m_dwCookie = pdwCookie;
helper.m_CloseDelegate = handler1;
this.m_aEventSinkHelpers.Add((object) helper);
}
}
public override void add_Deactivate(InspectorEvents_10_DeactivateEventHandler handler1)
{
lock (this)
{
if (this.m_ConnectionPoint == null)
{
this.Init();
}
InspectorEvents_10_SinkHelper helper = new InspectorEvents_10_SinkHelper();
int pdwCookie = 0;
this.m_ConnectionPoint.Advise((object) helper, out pdwCookie);
helper.m_dwCookie = pdwCookie;
helper.m_DeactivateDelegate = handler1;
this.m_aEventSinkHelpers.Add((object) helper);
}
}
public override void Dispose()
{
this.Finalize();
GC.SuppressFinalize(this);
}
public override void Finalize()
{
Monitor.Enter(this);
try
{
if (this.m_ConnectionPoint != null)
{
int count = this.m_aEventSinkHelpers.Count;
int num2 = 0;
if (0 < count)
{
do
{
InspectorEvents_10_SinkHelper helper = (InspectorEvents_10_SinkHelper) this.m_aEventSinkHelpers[num2];
this.m_ConnectionPoint.Unadvise(helper.m_dwCookie);
num2++;
}
while (num2 < count);
}
Marshal.ReleaseComObject(this.m_ConnectionPoint);
}
}
catch (Exception)
{
}
finally
{
Monitor.Exit(this);
}
}
private void Init()
{
UCOMIConnectionPoint ppCP = null;
byte[] b = new byte[] { 0x2a, 0x30, 6, 0, 0, 0, 0, 0, 0xc0, 0, 0, 0, 0, 0, 0, 70 };
Guid riid = new Guid(b);
this.m_ConnectionPointContainer.FindConnectionPoint(ref riid, out ppCP);
this.m_ConnectionPoint = ppCP;
this.m_aEventSinkHelpers = new ArrayList();
}
public override void remove_Activate(InspectorEvents_10_ActivateEventHandler handler1)
{
lock (this)
{
int count = this.m_aEventSinkHelpers.Count;
int index = 0;
if (0 < count)
{
do
{
InspectorEvents_10_SinkHelper helper = (InspectorEvents_10_SinkHelper) this.m_aEventSinkHelpers[index];
if ((helper.m_ActivateDelegate != null) && (helper.m_ActivateDelegate.Equals((object) handler1) & 0xff))
{
this.m_aEventSinkHelpers.RemoveAt(index);
this.m_ConnectionPoint.Unadvise(helper.m_dwCookie);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -