protected override HierarchySyncMetadataItem CreateItem(IStoreSession session, IFolder folder) { HierarchySyncMetadataItem hierarchySyncMetadataItem = ItemBuilder.CreateNewItem <HierarchySyncMetadataItem>(session as StoreSession, folder.Id, ItemCreateInfo.HierarchySyncMetadataInfo, CreateMessageType.Associated); hierarchySyncMetadataItem[StoreObjectSchema.ItemClass] = "IPM.HierarchySync.Metadata"; return(hierarchySyncMetadataItem); }
public static MailboxAssociationGroup Create(StoreSession session, StoreId folderId) { MailboxAssociationGroup mailboxAssociationGroup = ItemBuilder.CreateNewItem <MailboxAssociationGroup>(session, folderId, ItemCreateInfo.MailboxAssociationGroupInfo); mailboxAssociationGroup[StoreObjectSchema.ItemClass] = "IPM.MailboxAssociation.Group"; return(mailboxAssociationGroup); }
public static MeetingCancellation CreateMeetingCancellationSeries(MailboxSession mailboxSession) { MeetingCancellation meetingCancellation = ItemBuilder.CreateNewItem <MeetingCancellation>(mailboxSession, mailboxSession.GetDefaultFolderId(DefaultFolderType.Drafts), ItemCreateInfo.MeetingCancellationSeriesInfo); meetingCancellation.Initialize("IPM.MeetingMessageSeries.Canceled"); return(meetingCancellation); }
internal static MeetingForwardNotification Create(MeetingRequest request) { MailboxSession mailboxSession = request.Session as MailboxSession; if (mailboxSession == null) { throw new NotSupportedException(); } MeetingForwardNotification meetingForwardNotification = null; bool flag = false; MeetingForwardNotification result; try { StoreObjectId defaultFolderId = mailboxSession.GetDefaultFolderId((mailboxSession.LogonType == LogonType.Transport) ? DefaultFolderType.SentItems : DefaultFolderType.Drafts); meetingForwardNotification = ItemBuilder.CreateNewItem <MeetingForwardNotification>(mailboxSession, defaultFolderId, request.IsSeriesMessage ? ItemCreateInfo.MeetingForwardNotificationSeriesInfo : ItemCreateInfo.MeetingForwardNotificationInfo); meetingForwardNotification.Load(InternalSchema.ContentConversionProperties); meetingForwardNotification.Initialize(request, request.IsSeriesMessage ? "IPM.MeetingMessageSeries.Notification.Forward" : "IPM.Schedule.Meeting.Notification.Forward"); flag = true; result = meetingForwardNotification; } finally { if (!flag && meetingForwardNotification != null) { meetingForwardNotification.Dispose(); } } return(result); }
public static MeetingResponse CreateMeetingResponseSeries(MailboxSession mailboxSession, ResponseType responseType) { MeetingResponse meetingResponse = ItemBuilder.CreateNewItem <MeetingResponse>(mailboxSession, CalendarItemBase.GetDraftsFolderIdOrThrow(mailboxSession), ItemCreateInfo.MeetingResponseSeriesInfo); meetingResponse.Initialize("IPM.MeetingMessageSeries.Resp", responseType); return(meetingResponse); }
public static MailboxAssociationUser Create(StoreSession session, StoreId folderId) { MailboxAssociationUser mailboxAssociationUser = ItemBuilder.CreateNewItem <MailboxAssociationUser>(session, folderId, ItemCreateInfo.MailboxAssociationUserInfo); mailboxAssociationUser[StoreObjectSchema.ItemClass] = "IPM.MailboxAssociation.User"; return(mailboxAssociationUser); }
public static MeetingRequest CreateMeetingRequestSeries(MailboxSession mailboxSession) { MeetingRequest meetingRequest = ItemBuilder.CreateNewItem <MeetingRequest>(mailboxSession, mailboxSession.GetDefaultFolderId(DefaultFolderType.Drafts), ItemCreateInfo.MeetingRequestSeriesInfo); meetingRequest.Initialize("IPM.MeetingMessageSeries.Request"); return(meetingRequest); }
public static TaskGroup Create(MailboxSession session) { Util.ThrowOnNullArgument(session, "session"); TaskGroup taskGroup = ItemBuilder.CreateNewItem <TaskGroup>(session, session.GetDefaultFolderId(DefaultFolderType.CommonViews), ItemCreateInfo.TaskGroupInfo, CreateMessageType.Associated); taskGroup.MailboxSession = session; return(taskGroup); }
internal static TaskGroupEntry Create(MailboxSession session, Guid parentGroupClassId, string parentGroupName) { Util.ThrowOnNullArgument(session, "session"); TaskGroupEntry taskGroupEntry = ItemBuilder.CreateNewItem <TaskGroupEntry>(session, session.GetDefaultFolderId(DefaultFolderType.CommonViews), ItemCreateInfo.TaskGroupEntryInfo, CreateMessageType.Associated); taskGroupEntry.MailboxSession = session; taskGroupEntry.ParentGroupClassId = parentGroupClassId; taskGroupEntry.ParentGroupName = parentGroupName; return(taskGroupEntry); }
public static ShortcutMessage Create(MailboxSession session, byte[] longTermFolderId, string folderName) { Util.ThrowOnNullArgument(session, "session"); Util.ThrowOnNullArgument(longTermFolderId, "longTermFolderId"); ShortcutMessage shortcutMessage = ItemBuilder.CreateNewItem <ShortcutMessage>(session, session.GetDefaultFolderId(DefaultFolderType.LegacyShortcuts), ItemCreateInfo.ShortcutMessageInfo, CreateMessageType.Normal); shortcutMessage.FavoriteDisplayName = folderName; shortcutMessage.FavPublicSourceKey = longTermFolderId; return(shortcutMessage); }
public static ParkedMeetingMessage Create(MailboxSession mailboxSession) { StoreObjectId storeObjectId = mailboxSession.GetDefaultFolderId(DefaultFolderType.ParkedMessages); if (storeObjectId == null) { storeObjectId = mailboxSession.CreateDefaultFolder(DefaultFolderType.ParkedMessages); } ParkedMeetingMessage parkedMeetingMessage = ItemBuilder.CreateNewItem <ParkedMeetingMessage>(mailboxSession, storeObjectId, ItemCreateInfo.ParkedMeetingMessageInfo); parkedMeetingMessage[StoreObjectSchema.ItemClass] = "IPM.Parked.MeetingMessage"; return(parkedMeetingMessage); }
private static ConversationActionItem InternalCreate(MailboxSession session, ConversationId conversationId, string conversationTopic) { StoreId conversationActionsFolderId = ConversationActionItem.GetConversationActionsFolderId(session, true); if (conversationActionsFolderId == null) { throw new NotSupportedException("Failed to get conversation actions folder"); } ConversationActionItem conversationActionItem = ItemBuilder.CreateNewItem <ConversationActionItem>(session, conversationActionsFolderId, ItemCreateInfo.ConversationActionInfo, CreateMessageType.Associated); conversationActionItem[ItemSchema.ConversationTopic] = conversationTopic; conversationActionItem[ItemSchema.Subject] = conversationTopic; conversationActionItem[StoreObjectSchema.ItemClass] = "IPM.ConversationAction"; conversationActionItem[ItemSchema.ConversationId] = conversationId; conversationActionItem.SetExpiration(); conversationActionItem[ConversationActionItemSchema.ConversationActionVersion] = ConversationActionItem.MakeVersion(); return(conversationActionItem); }
public static CalendarItemSeries CreateSeries(StoreSession session, StoreId parentFolderId, bool forOrganizer = true) { if (parentFolderId == null) { throw new ArgumentNullException("parentFolderId"); } CalendarItemSeries result; using (DisposeGuard disposeGuard = default(DisposeGuard)) { CalendarItemSeries calendarItemSeries = ItemBuilder.CreateNewItem <CalendarItemSeries>(session, parentFolderId, ItemCreateInfo.CalendarItemSeriesInfo); disposeGuard.Add <CalendarItemSeries>(calendarItemSeries); calendarItemSeries.Initialize(forOrganizer); disposeGuard.Success(); result = calendarItemSeries; } return(result); }
public static RightsManagedMessageItem Create(MailboxSession session, StoreId destFolderId, OutboundConversionOptions options) { Util.ThrowOnNullArgument(session, "session"); Util.ThrowOnNullArgument(destFolderId, "destFolderId"); Util.ThrowOnNullArgument(options, "options"); RightsManagedMessageItem.CheckSession(session); RightsManagedMessageItem rightsManagedMessageItem = null; using (DisposeGuard disposeGuard = default(DisposeGuard)) { rightsManagedMessageItem = ItemBuilder.CreateNewItem <RightsManagedMessageItem>(session, destFolderId, ItemCreateInfo.RightsManagedMessageItemInfo, CreateMessageType.Normal); disposeGuard.Add <RightsManagedMessageItem>(rightsManagedMessageItem); rightsManagedMessageItem[InternalSchema.ItemClass] = "IPM.Note"; rightsManagedMessageItem.InitNewItem(options); rightsManagedMessageItem.SetDefaultEnvelopeBody(null); disposeGuard.Success(); } return(rightsManagedMessageItem); }
public static FavoriteFolderEntry Create(MailboxSession session, StoreObjectId folderId, FolderTreeDataType dataType, FavoriteFolderType favoriteFolderType) { Util.ThrowOnNullArgument(session, "session"); Util.ThrowOnNullArgument(session, "folderId"); EnumValidator.ThrowIfInvalid <FolderTreeDataType>(dataType, "dataType"); EnumValidator.ThrowIfInvalid <FavoriteFolderType>(favoriteFolderType, "favoriteFolderType"); FolderTreeDataSection groupSection = FavoriteFolderEntry.FavoritesGroupSectionByFolderType[favoriteFolderType]; byte[] favoritesClassIdValue = FavoriteFolderEntry.FavoritesClassIdValueByFolderType[favoriteFolderType]; FavoriteFolderEntry favoriteFolderEntry = ItemBuilder.CreateNewItem <FavoriteFolderEntry>(session, session.GetDefaultFolderId(DefaultFolderType.CommonViews), ItemCreateInfo.FavoriteFolderEntryInfo, CreateMessageType.Associated); byte[] favoritesParentGroupClassIdValue = (FavoriteFolderType.Contact == favoriteFolderType || FavoriteFolderType.Calendar == favoriteFolderType) ? NavigationNodeParentGroup.OtherFoldersClassId.AsBytes : null; FolderTreeDataFlags additionalFolderTreeDataFlags = FolderTreeDataFlags.None; if (folderId.IsLegacyPublicFolderType()) { additionalFolderTreeDataFlags = FavoriteFolderEntry.PublicFolderTreeDataFlagsByFolderType[favoriteFolderType]; } favoriteFolderEntry.SetPropertiesOfFavoriteFolderEntry(session, folderId, dataType, groupSection, favoritesClassIdValue, favoritesParentGroupClassIdValue, additionalFolderTreeDataFlags); return(favoriteFolderEntry); }
private static SharingMessageItem InternalCreate(MailboxSession mailboxSession, StoreId destFolderId, StoreId folderIdToShare, SharingProvider provider) { Util.ThrowOnNullArgument(mailboxSession, "mailboxSession"); Util.ThrowOnNullArgument(destFolderId, "destFolderId"); Util.ThrowOnNullArgument(folderIdToShare, "folderIdToShare"); SharingMessageItem result; using (DisposeGuard disposeGuard = default(DisposeGuard)) { SharingMessageItem sharingMessageItem = ItemBuilder.CreateNewItem <SharingMessageItem>(mailboxSession, destFolderId, ItemCreateInfo.SharingMessageItemInfo, CreateMessageType.Normal); disposeGuard.Add <SharingMessageItem>(sharingMessageItem); sharingMessageItem[InternalSchema.ItemClass] = "IPM.Sharing"; using (Folder folder = Folder.Bind(mailboxSession, folderIdToShare)) { sharingMessageItem.SharingContext = new SharingContext(folder, provider); } disposeGuard.Success(); result = sharingMessageItem; } return(result); }
public static PostItem Create(StoreSession session, StoreId destFolderId) { if (session == null) { ExTraceGlobals.StorageTracer.TraceError <string>(0L, "PostItem::Create. {0} should not be null.", "session"); throw new ArgumentNullException(ServerStrings.ExNullParameter("session", 1)); } if (destFolderId == null) { ExTraceGlobals.StorageTracer.TraceError <string>(0L, "PostItem::Create. {0} should not be null.", "destFolderId"); throw new ArgumentNullException(ServerStrings.ExNullParameter("destFolderId", 1)); } PostItem postItem = null; bool flag = false; PostItem result; try { postItem = ItemBuilder.CreateNewItem <PostItem>(session, destFolderId, ItemCreateInfo.PostInfo); postItem[InternalSchema.ItemClass] = "IPM.Post"; postItem[InternalSchema.IconIndex] = IconIndex.PostItem; MailboxSession mailboxSession = session as MailboxSession; if (mailboxSession != null) { postItem.From = new Participant(mailboxSession.MailboxOwner.MailboxInfo.DisplayName, mailboxSession.MailboxOwnerLegacyDN, "EX"); } postItem.IsRead = false; flag = true; result = postItem; } finally { if (!flag && postItem != null) { postItem.Dispose(); postItem = null; } } return(result); }
public static UserConfiguration Create(Folder folder, UserConfigurationName configurationName, UserConfigurationTypes type) { EnumValidator.ThrowIfInvalid <UserConfigurationTypes>(type, "type"); IList <IStorePropertyBag> list = null; try { list = UserConfiguration.QueryConfigurations(folder, null, configurationName, UserConfigurationSearchFlags.FullString, 1, new PropertyDefinition[0]); } catch (InvalidOperationException innerException) { throw new InvalidOperationException(ServerStrings.ExCannotQueryAssociatedTable, innerException); } if (list.Count > 0) { ExTraceGlobals.StorageTracer.TraceError <UserConfigurationName>(0L, "UserConfiguration::Create. The configuration object has existed. ConfigName = {0}.", configurationName); throw new ObjectExistedException(ServerStrings.ExConfigExisted(configurationName.Name)); } ConfigurationItem configurationItem = null; bool flag = false; UserConfiguration result; try { configurationItem = ItemBuilder.CreateNewItem <ConfigurationItem>(folder.Session, folder.Id, ItemCreateInfo.ConfigurationItemInfo, CreateMessageType.Associated); bool openMode = false; UserConfiguration userConfiguration = new UserConfiguration(configurationItem, folder.StoreObjectId, configurationName, type, openMode); flag = true; result = userConfiguration; } finally { if (!flag) { Util.DisposeIfPresent(configurationItem); } } return(result); }
public static ReminderMessage CreateReminderMessage(StoreSession session, StoreId destFolderId, string itemClass) { ReminderMessage reminderMessage = null; bool flag = false; ReminderMessage result; try { reminderMessage = ItemBuilder.CreateNewItem <ReminderMessage>(session, destFolderId, ItemCreateInfo.ReminderMessageInfo); reminderMessage[InternalSchema.ItemClass] = itemClass; flag = true; result = reminderMessage; } finally { if (!flag && reminderMessage != null) { reminderMessage.Dispose(); reminderMessage = null; } } return(result); }
public static MeetingInquiryMessage Create(MailboxSession session, StoreId parentFolderId, RumInfo rumInfo) { MeetingInquiryMessage meetingInquiryMessage = null; bool flag = false; try { meetingInquiryMessage = ItemBuilder.CreateNewItem <MeetingInquiryMessage>(session, parentFolderId, ItemCreateInfo.MeetingInquiryInfo); meetingInquiryMessage.LocationIdentifierHelperInstance.SetLocationIdentifier(39191U, LastChangeAction.Create); meetingInquiryMessage[StoreObjectSchema.ItemClass] = "IPM.Schedule.Inquiry"; RumDecorator rumDecorator = RumDecorator.CreateInstance(rumInfo); rumDecorator.AdjustRumMessage(meetingInquiryMessage.MailboxSession, meetingInquiryMessage, rumInfo, null, false); flag = true; } finally { if (!flag && meetingInquiryMessage != null) { meetingInquiryMessage.Dispose(); } } return(meetingInquiryMessage); }
public static Contact Create(StoreSession session, StoreId contactFolderId) { return(ItemBuilder.CreateNewItem <Contact>(session, contactFolderId, ItemCreateInfo.ContactInfo)); }
public static DistributionList Create(StoreSession session, StoreId contactFolderId) { return(ItemBuilder.CreateNewItem <DistributionList>(session, contactFolderId, ItemCreateInfo.DistributionListInfo)); }
public static GroupMailboxJoinRequestMessageItem Create(MailboxSession mailboxSession, StoreObjectId folderId) { return(ItemBuilder.CreateNewItem <GroupMailboxJoinRequestMessageItem>(mailboxSession, folderId, ItemCreateInfo.GroupMailboxJoinRequestMessageInfo)); }
internal static T CreateNewItem <T>(StoreSession session, StoreId parentFolderId, ItemCreateInfo itemCreateInfo, CreateMessageType createMessageType) where T : Item { return(ItemBuilder.CreateNewItem <T>(session, itemCreateInfo, () => Folder.InternalCreateMapiMessage(session, parentFolderId, createMessageType))); }
public IOutlookServiceSubscriptionItem CreateOutlookServiceSubscriptionItem(IStoreSession session, StoreId destFolderId) { return(ItemBuilder.CreateNewItem <OutlookServiceSubscriptionItem>((StoreSession)session, destFolderId, ItemCreateInfo.OutlookServiceSubscriptionItemInfo)); }
public IPushNotificationSubscriptionItem CreatePushNotificationSubscriptionItem(IStoreSession session, StoreId destFolderId) { return(ItemBuilder.CreateNewItem <PushNotificationSubscriptionItem>((StoreSession)session, destFolderId, ItemCreateInfo.PushNotificationSubscriptionItemInfo)); }
public new static Place Create(StoreSession session, StoreId contactFolderId) { return(ItemBuilder.CreateNewItem <Place>(session, contactFolderId, ItemCreateInfo.PlaceInfo)); }
internal static T CreateNewItem <T>(StoreSession session, StoreId parentFolderId, ItemCreateInfo itemCreateInfo) where T : Item { return(ItemBuilder.CreateNewItem <T>(session, parentFolderId, itemCreateInfo, CreateMessageType.Normal)); }