public void CreateEventBridge() { if (false == Factory.Settings.EnableEvents) { return; } if (null != _connectPoint) { return; } if (null == _activeSinkId) { _activeSinkId = SinkHelper.GetConnectionPoint(this, ref _connectPoint, NetOffice.OutlookApi.Behind.EventContracts.ItemEvents_SinkHelper.Id, NetOffice.OutlookApi.Behind.EventContracts.ItemEvents_10_SinkHelper.Id); } if (NetOffice.OutlookApi.Behind.EventContracts.ItemEvents_SinkHelper.Id.Equals(_activeSinkId, StringComparison.InvariantCultureIgnoreCase)) { _itemEvents_SinkHelper = new NetOffice.OutlookApi.Behind.EventContracts.ItemEvents_SinkHelper(this, _connectPoint); return; } if (NetOffice.OutlookApi.Behind.EventContracts.ItemEvents_10_SinkHelper.Id.Equals(_activeSinkId, StringComparison.InvariantCultureIgnoreCase)) { _itemEvents_10_SinkHelper = new NetOffice.OutlookApi.Behind.EventContracts.ItemEvents_10_SinkHelper(this, _connectPoint); return; } }
public void DisposeEventBridge() { if (null != _itemEvents_SinkHelper) { _itemEvents_SinkHelper.Dispose(); _itemEvents_SinkHelper = null; } if (null != _itemEvents_10_SinkHelper) { _itemEvents_10_SinkHelper.Dispose(); _itemEvents_10_SinkHelper = null; } _connectPoint = null; }