/// <summary> /// Set this item as manually syncable, briefly. As a side effect of making the change triggers sync. /// </summary> /// <remarks>In order to allow manual sync, we need to be able to override the disablement of syncing - /// but only briefly.</remarks> /// <param name="olItem">The item which may be synced despite syncing being disabled</param> public static void SetManualOverride(this Outlook.ContactItem olItem) { var p = olItem.UserProperties.Add(OverridePropertyName, Outlook.OlUserPropertyType.olDateTime); p.Value = DateTime.UtcNow; olItem.Save(); }
public static void ClearCrmId(this Outlook.ContactItem olItem) { var state = SyncStateManager.Instance.GetExistingSyncState(olItem); olItem.ClearUserProperty(SyncStateManager.CrmIdPropertyName); if (state != null) { state.CrmEntryId = null; } olItem.Save(); }
public static void ChangeCrmId(this Outlook.ContactItem olItem, string text) { var crmId = new CrmId(text); var state = SyncStateManager.Instance.GetExistingSyncState(olItem); var userProperty = olItem.UserProperties.Find(SyncStateManager.CrmIdPropertyName) ?? olItem.UserProperties.Add(SyncStateManager.CrmIdPropertyName, Outlook.OlUserPropertyType.olText); userProperty.Value = crmId.ToString(); if (state != null) { state.CrmEntryId = crmId; } olItem.Save(); }