public ItemSavedEventArgs (IOutlookId entryId)
    {
      if (entryId == null)
        throw new ArgumentNullException (nameof (entryId));

      EntryId = entryId;
    }
예제 #2
0
        public ItemSavedEventArgs(IOutlookId entryId)
        {
            if (entryId == null)
            {
                throw new ArgumentNullException(nameof(entryId));
            }

            EntryId = entryId;
        }
        private void OnItemSavedOrDeleted(object item, ItemAction action)
        {
            IOutlookId entryId = null;

            bool wasDeleted = action == ItemAction.Delete;

            var appointment = item as AppointmentItem;

            if (appointment != null)
            {
                //Don't add appointment if it is a meeting invite, since this can cause doubled and/or cancelled meetings
                if (appointment.MeetingStatus != OlMeetingStatus.olMeetingReceived)
                {
                    s_logger.Debug($"'{nameof (ItemAction)}.{action}': Appointment '{appointment.Subject}' '{appointment.EntryID}' ");
                    entryId = new AppointmentId(new Implementation.Events.AppointmentId(appointment.EntryID, appointment.GlobalAppointmentID), appointment.LastModificationTime, wasDeleted);
                }
            }
            else
            {
                var task = item as TaskItem;
                if (task != null)
                {
                    s_logger.Debug($"'{nameof (ItemAction)}.{action}': Task '{task.Subject}' '{task.EntryID}' ");
                    entryId = new GenericId(task.EntryID, task.LastModificationTime, wasDeleted);
                }
                else
                {
                    var contact = item as ContactItem;
                    if (contact != null)
                    {
                        s_logger.Debug($"'{nameof (ItemAction)}.{action}': Contact '{contact.LastNameAndFirstName}' '{contact.EntryID}' ");
                        entryId = new GenericId(contact.EntryID, contact.LastModificationTime, wasDeleted);
                    }
                }
            }

            if (entryId != null)
            {
                OnItemSavedOrDeleted(entryId);
            }
        }
    private async Task RunPartialNoThrow (IOutlookId[] itemsToSync)
    {
      try
      {
        var logger = new SynchronizationLogger (_profileId, _profileName);

        using (AutomaticStopwatch.StartInfo (s_logger, string.Format ("Partial sync: Running synchronization profile '{0}'", _profileName)))
        {
          await _synchronizer.SnychronizePartialNoThrow (itemsToSync, logger);
        }

        GC.Collect();
        GC.WaitForPendingFinalizers();
        var synchronizationReport = logger.GetReport();
        _reportSink.PostReport (synchronizationReport);
      }
      catch (Exception x)
      {
        s_logger.Error (null, x);
      }
    }
 protected virtual void OnItemSavedOrDeleted(IOutlookId entryId)
 {
     ItemSavedOrDeleted?.Invoke(
         this,
         new ItemSavedEventArgs(entryId));
 }
 protected virtual void OnItemSavedOrDeleted (IOutlookId entryId)
 {
   ItemSavedOrDeleted?.Invoke (
       this,
       new ItemSavedEventArgs (entryId));
 }