示例#1
0
        protected override void StampItemFromDataObject(Item item, SharingBindingData bindingData)
        {
            item[BindingItemSchema.SharingInitiatorName]  = bindingData.InitiatorName;
            item[BindingItemSchema.SharingInitiatorSmtp]  = bindingData.InitiatorSmtpAddress;
            item[BindingItemSchema.SharingRemoteName]     = bindingData.RemoteFolderName;
            item[BindingItemSchema.SharingRemoteFolderId] = bindingData.RemoteFolderId;
            item[BindingItemSchema.SharingLocalName]      = bindingData.LocalFolderName;
            if (bindingData.LastSyncTimeUtc != null)
            {
                item[BindingItemSchema.SharingLastSync] = new ExDateTime(ExTimeZone.UtcTimeZone, bindingData.LastSyncTimeUtc.Value.ToUniversalTime());
            }
            item[BindingItemSchema.SharingRemoteType] = (item[BindingItemSchema.SharingLocalType] = bindingData.DataType.ContainerClass);
            StoreObjectId storeObjectId = StoreId.GetStoreObjectId(bindingData.LocalFolderId);

            bindingData.LocalFolderId = storeObjectId;
            item[BindingItemSchema.SharingLocalUid]         = storeObjectId.ToHexEntryId();
            item[BindingItemSchema.SharingLocalFolderEwsId] = StoreId.StoreIdToEwsId(this.mailboxSession.MailboxOwner.MailboxInfo.MailboxGuid, storeObjectId);
            int num = 11;

            if (bindingData.IsDefaultFolderShared)
            {
                num |= 131072;
            }
            item[BindingItemSchema.SharingFlavor]       = num;
            item[BindingItemSchema.SharingRoamLog]      = SharingContextRoamLog.UnroamedBinding;
            item[BindingItemSchema.SharingStatus]       = SharingContextStatus.Configured;
            item[BindingItemSchema.SharingProviderGuid] = SharingBindingManager.ExternalSharingProviderGuid;
            item[BindingItemSchema.SharingProviderName] = "Microsoft Exchange";
            item[BindingItemSchema.SharingProviderUrl]  = "http://www.microsoft.com/exchange/";
            item[StoreObjectSchema.ItemClass]           = "IPM.Sharing.Binding.In";
        }
示例#2
0
 public static void SyncFolder(MailboxSession mailboxSession, StoreObjectId folderId)
 {
     Util.ThrowOnNullArgument(mailboxSession, "mailboxSession");
     Util.ThrowOnNullArgument(folderId, "folderId");
     using (AssistantsRpcClient assistantsRpcClient = new AssistantsRpcClient(mailboxSession.MailboxOwner.MailboxInfo.Location.ServerFqdn))
     {
         try
         {
             assistantsRpcClient.StartWithParams("CalendarSyncAssistant", mailboxSession.MailboxOwner.MailboxInfo.MailboxGuid, mailboxSession.MailboxOwner.MailboxInfo.GetDatabaseGuid(), folderId.ToHexEntryId());
         }
         catch (RpcException arg)
         {
             ExTraceGlobals.SharingTracer.TraceDebug <IExchangePrincipal, StoreObjectId, RpcException>(0L, "{0}: SyncAssistantInvoker.SyncFolder for folder id {1} failed with exception {2}.", mailboxSession.MailboxOwner, folderId, arg);
         }
     }
 }