Пример #1
0
 /// <summary>
 /// WrapEvent to dispose the wrappedMailItem
 /// </summary>
 /// <param name="id">the UID of the wrappedMailItem</param>
 /// <param name="o">the wrapped mailItem object</param>
 private void MailItemInspector_Dispose(Guid id, object o)
 {
   MailItemInspector wrappedMailItem = o as MailItemInspector;
   wrappedMailItem.Dispose -= new OutlookWrapperDisposeDelegate(MailItemInspector_Dispose);
   wrappedMailItem.Close -= new MailItemInspectorCloseDelegate(mailItem_Close);
   wrappedMailItem.Open -= new MailItemInspectorOpenDelegate(mailItem_Open);
   wrappedMailItem.Save -= new MailItemInspectorSaveDelegate(mailItem_Save);
   _WrappedObjects.Remove(id);
 }
Пример #2
0
    /// <summary>
    /// Wrap mailItem object to managed mailItem events.
    /// </summary>
    /// <param name="explorer">the outlook explorer to manage</param>
    private void WrapMailItem(Outlook.Inspector inspector)
    {
      if (_WrappedObjects.ContainsValue(inspector) == true)
        return;

      MailItemInspector wrappedMailItem = new MailItemInspector(inspector);
      wrappedMailItem.Dispose += new OutlookWrapperDisposeDelegate(MailItemInspector_Dispose);
      wrappedMailItem.Close += new MailItemInspectorCloseDelegate(mailItem_Close);
      wrappedMailItem.Open += new MailItemInspectorOpenDelegate(mailItem_Open);
      wrappedMailItem.Save += new MailItemInspectorSaveDelegate(mailItem_Save);
      _WrappedObjects[wrappedMailItem.Id] = inspector;
    }