diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f3c2dc8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,28 @@ +.bundle +db/*.sqlite3* +log/*.log +*.log +*.log.* +tmp/**/* +tmp/* +doc/api +doc/app +*.swp +*~ +.DS_Store +bin/ +obj/ +debug +*.suo +*.resharper +*.user +*ReSharper* +*ReSharper*/ +*TestResults* +*.log +*.log.* +*Publish.xml +*.sln.cache +js.js +app.js +css.css \ No newline at end of file diff --git a/Code/Channels/AOL/AolConfiguration.cs b/Code/Channels/AOL/AolConfiguration.cs new file mode 100644 index 0000000..9cd2384 --- /dev/null +++ b/Code/Channels/AOL/AolConfiguration.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Linq; +using System.Text; +using System.Xml.Serialization; +using Inbox2.Channels.Imap2; +using Inbox2.Channels.Smtp; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Framework.Extensions; + +namespace Inbox2.Channels.AOL +{ + [Serializable] + [Export(typeof(ChannelConfiguration))] + public class AolConfiguration : ChannelConfiguration + { + public AolConfiguration() + { + InnerInputChannel = new Channel { Type = typeof(Imap2ClientChannel), Hostname = "imap.aol.com", Port = 143, IsSecured = false, MaxConcurrentConnections = 1 }; + InnerOutputChannel = new Channel { Type = typeof(SmtpClientChannel), Hostname = "smtp.aol.com", Port = 587, IsSecured = false, MaxConcurrentConnections = 1 }; + } + + public override string DisplayName + { + get { return "AOL"; } + } + + public override string DefaultDomain + { + get { return "aol.com"; } + } + + public override int PreferredSortOrder + { + get { return 30; } + } + + public override ChannelCharasteristics Charasteristics + { + get + { + var charasteristics = ChannelCharasteristics.Default; + + charasteristics.SupportsReadStates = true; + charasteristics.CanCustomize = true; + + return charasteristics; + } + } + + public override ChannelConfiguration Clone() + { + return this.DeepCopy(new XmlSerializer(typeof(AolConfiguration))); + } + } +} diff --git a/Code/Channels/AOL/Inbox2.Channels.AOL.csproj b/Code/Channels/AOL/Inbox2.Channels.AOL.csproj new file mode 100644 index 0000000..84aa7a4 --- /dev/null +++ b/Code/Channels/AOL/Inbox2.Channels.AOL.csproj @@ -0,0 +1,187 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {E485016E-4E4E-4275-8161-975B6E621F0E} + Library + Properties + Inbox2.Channels.AOL + Inbox2.Channels.AOL + v3.5 + 512 + OnOutputUpdated + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\..\Stable Assemblies\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + Auto + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + + False + ..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + {43B96CD2-D7DA-4286-A209-EE9585EF6927} + Inbox2.Platform.Channels + + + {FB90E43A-0E32-41D5-A7AB-83EA0D936E5E} + Inbox2.Platform.Framework + + + {B9CE1540-1D68-43B2-83DB-47EC21D158A6} + Inbox2.Platform.Interfaces + + + {6AE2A2AF-9B61-45B0-A375-666C5225A5B4} + Inbox2.Platform.Logging + + + {528A7823-5CED-4E31-ABDF-E1F6F821FCFD} + Inbox2.Channels.Imap2 + + + {D977B2FC-E1BE-410E-8544-8B7263AB44C6} + Inbox2.Channels.Smtp + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Code/Channels/AOL/Properties/AssemblyInfo.cs b/Code/Channels/AOL/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9174f1f --- /dev/null +++ b/Code/Channels/AOL/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2.Channels.AOL")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2.Channels.AOL")] +[assembly: AssemblyCopyright("Copyright © Tabdeelee 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("63707b35-cace-49c8-8287-b0d861314556")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Code/Channels/AOL/Resources/icon-10.png b/Code/Channels/AOL/Resources/icon-10.png new file mode 100644 index 0000000..c357d51 Binary files /dev/null and b/Code/Channels/AOL/Resources/icon-10.png differ diff --git a/Code/Channels/AOL/Resources/icon-13.png b/Code/Channels/AOL/Resources/icon-13.png new file mode 100644 index 0000000..2ec912c Binary files /dev/null and b/Code/Channels/AOL/Resources/icon-13.png differ diff --git a/Code/Channels/AOL/Resources/icon-64.png b/Code/Channels/AOL/Resources/icon-64.png new file mode 100644 index 0000000..53d5542 Binary files /dev/null and b/Code/Channels/AOL/Resources/icon-64.png differ diff --git a/Code/Channels/Exchange/ChannelHelper.cs b/Code/Channels/Exchange/ChannelHelper.cs new file mode 100644 index 0000000..7d0b26b --- /dev/null +++ b/Code/Channels/Exchange/ChannelHelper.cs @@ -0,0 +1,27 @@ +using System; +using System.Net; +using ExchangeServicesWsdlClient; + +namespace Inbox2.Channels.Exchange +{ + internal static class ChannelHelper + { + internal static ExchangeServiceBinding BuildChannel(string hostname, string username, string password) + { + // First, set up the binding to Exchange Web Services. + ExchangeServiceBinding binding = new ExchangeServiceBinding(); + + Uri epUri = new Uri(hostname); + + // Add prefix unless user specifies one himself + if (!hostname.EndsWith(".asmx", StringComparison.InvariantCultureIgnoreCase)) + epUri = new Uri(epUri, "/EWS/Exchange.asmx"); + + binding.Credentials = new NetworkCredential(username, password); + binding.Url = epUri.ToString(); + binding.RequestServerVersionValue = new RequestServerVersion { Version = ExchangeVersionType.Exchange2007_SP1 }; + + return binding; + } + } +} diff --git a/Code/Channels/Exchange/ExchangeClient.cs b/Code/Channels/Exchange/ExchangeClient.cs new file mode 100644 index 0000000..e5e2008 --- /dev/null +++ b/Code/Channels/Exchange/ExchangeClient.cs @@ -0,0 +1,547 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using ExchangeServicesWsdlClient; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Framework.Interop; + +namespace Inbox2.Channels.Exchange +{ + public class ExchangeClient + { + private readonly string hostname; + private readonly string username; + private readonly string password; + + public ExchangeClient(string hostname, IChannelCredentialsProvider provider) + { + var creds = provider.GetCredentials(); + + this.hostname = hostname; + this.username = creds.Claim; + this.password = creds.Evidence; + } + + public ExchangeClient(string hostname, string username, string password) + { + this.hostname = hostname; + this.username = username; + this.password = password; + } + + public BaseFolderType GetFolder(DistinguishedFolderIdNameType folderType) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + var getFolderType = new GetFolderType + { + FolderIds = new[] { new DistinguishedFolderIdType { Id = folderType } }, + FolderShape = new FolderResponseShapeType { BaseShape = DefaultShapeNamesType.AllProperties } + }; + + var getFolderResponse = binding.GetFolder(getFolderType); + + if (getFolderResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(getFolderResponse.ResponseMessages.Items[0].MessageText); + + return ((FolderInfoResponseMessageType) getFolderResponse.ResponseMessages.Items[0]).Folders[0]; + } + + public BaseFolderType GetRootFolder() + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + var findFolderType = new FindFolderType + { + Traversal = FolderQueryTraversalType.Shallow, + ParentFolderIds = new[] { new DistinguishedFolderIdType { Id = DistinguishedFolderIdNameType.root } }, + FolderShape = new FolderResponseShapeType { BaseShape = DefaultShapeNamesType.AllProperties } + }; + + var findFolderResponse = binding.FindFolder(findFolderType); + + if (findFolderResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(findFolderResponse.ResponseMessages.Items[0].MessageText); + + BaseFolderType[] bft = ((FindFolderResponseMessageType)findFolderResponse.ResponseMessages.Items[0]).RootFolder.Folders; + + return bft[0]; + } + + /// + /// Returns all folders in the exchange box. + /// + /// + public IEnumerable FindAllFolders(string id) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + var findFolderType = new FindFolderType + { + Traversal = FolderQueryTraversalType.Shallow, + ParentFolderIds = new[] { new FolderIdType { Id = id } }, + FolderShape = new FolderResponseShapeType { BaseShape = DefaultShapeNamesType.AllProperties } + }; + + FindFolderResponseType findFolderResponse = binding.FindFolder(findFolderType); + + if (findFolderResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(findFolderResponse.ResponseMessages.Items[0].MessageText); + + var folders = ((FindFolderResponseMessageType)findFolderResponse.ResponseMessages.Items[0]).RootFolder.Folders; + + foreach (var baseFolderType in folders) + { + yield return baseFolderType; + + // Find children of current folder + foreach (var folderType in FindAllFolders(baseFolderType.FolderId.Id)) + yield return folderType; + } + } + + /// + /// Gets a list of all the items in the mailbox with all their properties. + /// + /// + public IEnumerable GetHeaders(ChannelFolder folder) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + var findItemRequest = new FindItemType { Traversal = ItemQueryTraversalType.Shallow }; + var itemProperties = new ItemResponseShapeType { BaseShape = DefaultShapeNamesType.AllProperties }; + + findItemRequest.ItemShape = itemProperties; + findItemRequest.ParentFolderIds = new BaseFolderIdType[] { new FolderIdType { Id = folder.FolderId } }; + + FindItemResponseType findItemResponse = binding.FindItem(findItemRequest); + + foreach (FindItemResponseMessageType responseMessage in findItemResponse.ResponseMessages.Items) + { + if (responseMessage.ResponseClass == ResponseClassType.Success) + { + ArrayOfRealItemsType mailboxItems = (ArrayOfRealItemsType) responseMessage.RootFolder.Item; + + if (mailboxItems.Items == null) + yield break; + + foreach (MessageType inboxItem in mailboxItems.Items) + yield return inboxItem; + } + } + } + + /// + /// Gets a specific message from exchange by id (attachments are only loaded shallow). + /// + /// + /// + public MessageType GetMessage(string messageId) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + ItemIdType itemId = new ItemIdType(); + itemId.Id = messageId; + + GetItemType getItemRequest = new GetItemType(); + getItemRequest.ItemShape = new ItemResponseShapeType { BaseShape = DefaultShapeNamesType.AllProperties }; + getItemRequest.ItemIds = new[] { itemId }; + + GetItemResponseType getItemResponse = binding.GetItem(getItemRequest); + + if (getItemResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(getItemResponse.ResponseMessages.Items[0].MessageText); + + var getItemResponseMessage = (ItemInfoResponseMessageType)getItemResponse.ResponseMessages.Items[0]; + + if (getItemResponseMessage.Items.Items == null || getItemResponseMessage.Items.Items.Length == 0) + throw new ApplicationException("Error in GetMessage, empty ItemInfoResponseMessageType"); + + return (MessageType)getItemResponseMessage.Items.Items[0]; + } + + /// + /// Gets the id and changekey of a specific message by id. + /// + /// + /// + public MessageType GetMessageId(string messageId) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + ItemIdType itemId = new ItemIdType(); + itemId.Id = messageId; + + // Re-get item and changekey from exchange + GetItemResponseType getItemResponse = binding.GetItem(new GetItemType + { + ItemShape = new ItemResponseShapeType { BaseShape = DefaultShapeNamesType.IdOnly }, + ItemIds = new[] { itemId } + }); + + if (getItemResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(getItemResponse.ResponseMessages.Items[0].MessageText); + + return (MessageType)((ItemInfoResponseMessageType)getItemResponse.ResponseMessages.Items[0]).Items.Items[0]; + } + + /// + /// Asks Exchange to send a specific message. + /// + /// + public void SendMessage(ItemIdType messageId) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + // Send message + var sendItem = new SendItemType { ItemIds = new BaseItemIdType[1], SavedItemFolderId = new TargetFolderIdType() }; + var siSentItemsFolder = new DistinguishedFolderIdType { Id = DistinguishedFolderIdNameType.sentitems }; + + sendItem.SavedItemFolderId.Item = siSentItemsFolder; + sendItem.SaveItemToFolder = true; + sendItem.ItemIds[0] = messageId; + + SendItemResponseType sendItemResponse = binding.SendItem(sendItem); + + if (sendItemResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(sendItemResponse.ResponseMessages.Items[0].MessageText); + } + + /// + /// Gets a specific attachment from exchange by id. + /// + /// + /// + public FileAttachmentType GetAttachment(string id) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + var getAttachmentRequest = new GetAttachmentType(); + + var attachmentIdArray = new RequestAttachmentIdType[1]; + attachmentIdArray[0] = new RequestAttachmentIdType { Id = id }; + + getAttachmentRequest.AttachmentIds = attachmentIdArray; + + GetAttachmentResponseType getAttachmentResponse = binding.GetAttachment(getAttachmentRequest); + + if (getAttachmentResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(getAttachmentResponse.ResponseMessages.Items[0].MessageText); + + var attachmentResponseMessage = + (AttachmentInfoResponseMessageType)getAttachmentResponse.ResponseMessages.Items[0]; + + if (attachmentResponseMessage.Attachments == null || attachmentResponseMessage.Attachments.Length == 0) + throw new ApplicationException("Error in GetAttachment, empty AttachmentInfoResponseMessageType"); + + return (FileAttachmentType)attachmentResponseMessage.Attachments[0]; + } + + /// + /// Saves the given message to the drafts folder. + /// + /// + /// + public ItemIdType SaveMessage(ChannelMessage message) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + var createItemRequest = new CreateItemType(); + + // Indicate that we want to save only at first + createItemRequest.MessageDisposition = MessageDispositionType.SaveOnly; + createItemRequest.MessageDispositionSpecified = true; + createItemRequest.Items = new NonEmptyArrayOfAllItemsType(); + + // Create a single e-mail message. + var exchMessage = new MessageType(); + exchMessage.Subject = message.Context; + exchMessage.Body = new BodyType { BodyType1 = BodyTypeType.HTML, Value = message.BodyHtml.ReadString() }; + exchMessage.ItemClass = "IPM.Note"; + exchMessage.Sender = new SingleRecipientType(); + exchMessage.Sender.Item = new EmailAddressType { EmailAddress = message.From.Address }; + + exchMessage.ToRecipients = new EmailAddressType[message.To.Count]; + exchMessage.CcRecipients = new EmailAddressType[message.CC.Count]; + exchMessage.BccRecipients = new EmailAddressType[message.BCC.Count]; + + for (int i = 0; i < message.To.Count; i++) + exchMessage.ToRecipients[i] = new EmailAddressType { EmailAddress = message.To[i].Address }; + + for (int i = 0; i < message.CC.Count; i++) + exchMessage.CcRecipients[i] = new EmailAddressType { EmailAddress = message.CC[i].Address }; + + for (int i = 0; i < message.BCC.Count; i++) + exchMessage.BccRecipients[i] = new EmailAddressType { EmailAddress = message.BCC[i].Address }; + + exchMessage.Sensitivity = SensitivityChoicesType.Normal; + + // Add the message to the array of items to be created. + createItemRequest.Items.Items = new ItemType[1]; + createItemRequest.Items.Items[0] = exchMessage; + + // Send the request to create and send the e-mail item, and get the response. + CreateItemResponseType createItemResponse = binding.CreateItem(createItemRequest); + + // Determine whether the request was a success. + if (createItemResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(createItemResponse.ResponseMessages.Items[0].MessageText); + + return ((ItemInfoResponseMessageType)createItemResponse.ResponseMessages.Items[0]).Items.Items[0].ItemId; + } + + /// + /// Saves all attachments belonging to a specific message. This method can only be called after the message + /// has been saved in exchange. + /// + /// + /// + /// + public IEnumerable SaveAttachments(ItemIdType messageId, ChannelMessage message) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + // Create add attachment request. + var attachementRequest = new CreateAttachmentType(); + attachementRequest.ParentItemId = messageId; + attachementRequest.Attachments = new AttachmentType[message.Attachments.Count]; + + for (int i = 0; i < message.Attachments.Count; i++) + { + var channelAttachment = message.Attachments[i]; + var exchAttachment = new FileAttachmentType(); + + exchAttachment.Name = channelAttachment.Filename; + exchAttachment.ContentType = MimeHelper.GetMimeType(channelAttachment.Filename); + exchAttachment.Content = channelAttachment.ContentStream.GetBytes(); + + attachementRequest.Attachments[i] = exchAttachment; + + var saveAttachmentResponse = binding.CreateAttachment(attachementRequest); + + // Determine whether the request was a success. + if (saveAttachmentResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(saveAttachmentResponse.ResponseMessages.Items[0].MessageText); + + AttachmentIdType attachmentId = ((AttachmentInfoResponseMessageType)saveAttachmentResponse.ResponseMessages.Items[0]).Attachments[0].AttachmentId; + + yield return new ItemIdType { ChangeKey = attachmentId.RootItemChangeKey, Id = attachmentId.RootItemId }; + } + } + + /// + /// Delete the given message permanatly. + /// + /// + public void DeleteMessage(ItemIdType messageId) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + var deleteItemRequest = new DeleteItemType + { + ItemIds = new BaseItemIdType[] {messageId}, + DeleteType = DisposalType.HardDelete + }; + + DeleteItemResponseType deleteResponse = binding.DeleteItem(deleteItemRequest); + + if (deleteResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(deleteResponse.ResponseMessages.Items[0].MessageText); + } + + /// + /// Sets the message readstate. + /// + public void SetMessageReadState(ItemIdType messageId, bool isRead) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + var setField = new SetItemFieldType + { + Item1 = new MessageType { IsRead = isRead, IsReadSpecified = true }, + Item = new PathToUnindexedFieldType { FieldURI = UnindexedFieldURIType.messageIsRead } + }; + + var updatedItems = new[] + { + new ItemChangeType + { + Updates = new ItemChangeDescriptionType[] { setField }, + Item = messageId + } + }; + + var request = new UpdateItemType + { + ItemChanges = updatedItems, + ConflictResolution = ConflictResolutionType.AutoResolve, + MessageDisposition = MessageDispositionType.SaveOnly, + MessageDispositionSpecified = true + }; + + UpdateItemResponseType updateItemResponse = binding.UpdateItem(request); + + if (updateItemResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(updateItemResponse.ResponseMessages.Items[0].MessageText); + } + + /// + /// Sets the message importance flag. + /// + public void SetMessageImportance(ItemIdType messageId, bool isStarred) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + var setField = new SetItemFieldType + { + Item1 = new MessageType { Importance = isStarred ? ImportanceChoicesType.High : ImportanceChoicesType.Normal, ImportanceSpecified = true }, + Item = new PathToUnindexedFieldType { FieldURI = UnindexedFieldURIType.itemImportance } + }; + + var updatedItems = new[] + { + new ItemChangeType + { + Updates = new ItemChangeDescriptionType[] { setField }, + Item = messageId + } + }; + + var request = new UpdateItemType + { + ItemChanges = updatedItems, + ConflictResolution = ConflictResolutionType.AutoResolve, + MessageDisposition = MessageDispositionType.SaveOnly, + MessageDispositionSpecified = true + }; + + UpdateItemResponseType updateItemResponse = binding.UpdateItem(request); + + if (updateItemResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(updateItemResponse.ResponseMessages.Items[0].MessageText); + } + + /// + /// Creates a folder with the given name and returns the associated folderid. + /// + /// + /// + /// + public string CreateFolder(string name, string parentFolderId) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + var request = new CreateFolderType + { + Folders = new BaseFolderType[] { new FolderType { DisplayName = name } }, + ParentFolderId = new TargetFolderIdType { Item = new FolderIdType { Id = parentFolderId } } + }; + + CreateFolderResponseType moveItemResponse = binding.CreateFolder(request); + + if (moveItemResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(moveItemResponse.ResponseMessages.Items[0].MessageText); + + var response = (FolderInfoResponseMessageType) moveItemResponse.ResponseMessages.Items[0]; + return response.Folders[0].FolderId.Id; + } + + /// + /// Moves the given message to the given folder. + /// + public void MoveMessageToFolder(ItemIdType messageId, string folderId) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + var request = new MoveItemType + { + ItemIds = new BaseItemIdType[] { messageId }, + ToFolderId = new TargetFolderIdType { Item = new FolderIdType { Id = folderId } } + }; + + MoveItemResponseType moveItemResponse = binding.MoveItem(request); + + if (moveItemResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(moveItemResponse.ResponseMessages.Items[0].MessageText); + } + + /// + /// Moves the given message to the given folder. + /// + public void CopyMessageToFolder(ItemIdType messageId, string folderId) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + var request = new CopyItemType + { + ItemIds = new BaseItemIdType[] { messageId }, + ToFolderId = new TargetFolderIdType { Item = new FolderIdType { Id = folderId } } + }; + + CopyItemResponseType moveItemResponse = binding.CopyItem(request); + + if (moveItemResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(moveItemResponse.ResponseMessages.Items[0].MessageText); + } + + /// + /// Gets the nr of items in a given folder + /// + /// + public long GetNrItemsInFolder(ChannelFolder folder) + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + var findItemRequest = new FindItemType { Traversal = ItemQueryTraversalType.Shallow }; + var itemProperties = new ItemResponseShapeType { BaseShape = DefaultShapeNamesType.AllProperties }; + findItemRequest.ItemShape = itemProperties; + + var folderIdArray = new DistinguishedFolderIdType[2]; + folderIdArray[0] = new DistinguishedFolderIdType { Id = DistinguishedFolderIdNameType.inbox }; + + findItemRequest.ParentFolderIds = folderIdArray; + + FindItemResponseType findItemResponse = binding.FindItem(findItemRequest); + + // Determine whether the request was a success. + if (findItemResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(findItemResponse.ResponseMessages.Items[0].MessageText); + + var responseMessage = + (FindItemResponseMessageType) findItemResponse.ResponseMessages.Items[0]; + + var mailboxItems = (ArrayOfRealItemsType)responseMessage.RootFolder.Item; + + if (mailboxItems.Items == null) return 0; + + return mailboxItems.Items.Length; + } + + /// + /// Retrieves contacts from exchange database. + /// + /// + public IEnumerable GetContacts() + { + var binding = ChannelHelper.BuildChannel(hostname, username, password); + + var findItemRequest = new FindItemType + { + ItemShape = new ItemResponseShapeType {BaseShape = DefaultShapeNamesType.AllProperties}, + ParentFolderIds = new[] { new DistinguishedFolderIdType { Id = DistinguishedFolderIdNameType.contacts } } + }; + + FindItemResponseType findItemResponse = binding.FindItem(findItemRequest); + + // Determine whether the request was a success. + if (findItemResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) + throw new Exception(findItemResponse.ResponseMessages.Items[0].MessageText); + + var responseMessage = (FindItemResponseMessageType)findItemResponse.ResponseMessages.Items[0]; + var contactItems = (ArrayOfRealItemsType)responseMessage.RootFolder.Item; + + return contactItems.Items.Cast(); + } + } +} diff --git a/Code/Channels/Exchange/ExchangeClientChannel.cs b/Code/Channels/Exchange/ExchangeClientChannel.cs new file mode 100644 index 0000000..66da8ef --- /dev/null +++ b/Code/Channels/Exchange/ExchangeClientChannel.cs @@ -0,0 +1,415 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.IO; +using System.Net; +using ExchangeServicesWsdlClient; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Logging; +using Logger = Inbox2.Platform.Logging.Logger; + +namespace Inbox2.Channels.Exchange +{ + public class ExchangeClientChannel : IClientInputChannel, IClientOutputChannel, IPagableChannel, IReadStateChannel, IClientContactsChannel, ILabelsChannel + { + private ChannelFolder folder; + private List folders; + + #region Properties + + public long StartIndex { get; set; } + + public long EndIndex { get; set; } + + public long PageSize { get; set; } + + public ChannelProgressDelegate BytesRead { get; set; } + + public ChannelProgressDelegate BytesWritten { get; set; } + + public string Hostname { get; set; } + + public int Port { get; set; } + + public bool IsSecured { get; set; } + + public string Username + { + get { return CredentialsProvider.GetCredentials().Claim; } + } + + public string Password + { + get { return CredentialsProvider.GetCredentials().Evidence; } + } + + public bool IsEnabled { get; set; } + + public int MaxConcurrentConnections { get; set; } + + public IChannelCredentialsProvider CredentialsProvider { get; set; } + + public string Protocol + { + get { return "ExchangeWS"; } + } + + public string SourceAdress + { + get + { + string username = CredentialsProvider.GetCredentials().Claim; + + return username.Contains("@") ? username : String.Format("{0}@{1}", username, Hostname); + } + } + + public LabelsSupport LabelsSupport + { + get { return LabelsSupport.Folders; } + } + + public string AuthMessage { get; private set; } + + #endregion + + public ConnectResult Connect() + { + var credentials = CredentialsProvider.GetCredentials(); + var binding = ChannelHelper.BuildChannel(Hostname, credentials.Claim, credentials.Evidence); + + folders = new List(); + + // Try connecting + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(binding.Url); + request.AllowAutoRedirect = false; + request.Credentials = new NetworkCredential(credentials.Claim, credentials.Evidence); + + try + { + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + Logger.Debug("Server {0} returned status-code {1}", LogSource.Channel, binding.Url, response.StatusCode); + + if (response.StatusCode == HttpStatusCode.OK || response.StatusCode == HttpStatusCode.Found) + return ConnectResult.Success; + + AuthMessage = String.Format("Statuscode {0}", response.StatusCode); + + return ConnectResult.AuthFailure; + } + catch (Exception ex) + { + AuthMessage = ex.Message; + + return ConnectResult.AuthFailure; + } + } + + public IEnumerable GetFolders() + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + + // inbox + var inbox = client.GetFolder(DistinguishedFolderIdNameType.inbox); + folders.Add(new ChannelFolder(inbox.FolderId.Id, inbox.DisplayName, ChannelFolderType.Inbox)); + folders.AddRange(GetChildFolders(client, inbox.FolderId.Id, ChannelFolderType.Label)); + + // sent items + var sent = client.GetFolder(DistinguishedFolderIdNameType.sentitems); + folders.Add(new ChannelFolder(sent.FolderId.Id, sent.DisplayName, ChannelFolderType.SentItems)); + folders.AddRange(GetChildFolders(client, sent.FolderId.Id, ChannelFolderType.SentItems)); + + // trash + var trash = client.GetFolder(DistinguishedFolderIdNameType.deleteditems); + folders.Add(new ChannelFolder(trash.FolderId.Id, trash.DisplayName, ChannelFolderType.Trash)); + + // spam + var spam = client.GetFolder(DistinguishedFolderIdNameType.junkemail); + folders.Add(new ChannelFolder(spam.FolderId.Id, spam.DisplayName, ChannelFolderType.Spam)); + + return folders; + } + + IEnumerable GetChildFolders(ExchangeClient client, string folderId, ChannelFolderType folderType) + { + var childFolders = client.FindAllFolders(folderId); + + return childFolders.Select(f => new ChannelFolder(f.FolderId.Id, f.DisplayName, folderType)); + } + + public void SelectFolder(ChannelFolder folder) + { + this.folder = folder; + } + + public IEnumerable GetHeaders() + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + + foreach (MessageType inboxItem in client.GetHeaders(folder).Reverse().Skip((int)StartIndex).Take((int)PageSize)) + { + var header = new ChannelMessageHeader + { + MessageNumber = inboxItem.ItemId.Id, + MessageIdentifier = inboxItem.InternetMessageId, + Context = inboxItem.Subject, + // Not sending size because exchange changes can the size due + // to user actions usch as change priority. + //Size = inboxItem.Size, + DateReceived = inboxItem.DateTimeReceived, + IsRead = inboxItem.IsRead, + // Not processing IsStarred because somebody could send you an + // email with importance: high and would end up getting starred; + // feature just asking for abuse :-) + //IsStarred = inboxItem.Importance == ImportanceChoicesType.High, + }; + + yield return header; + } + } + + public IEnumerable GetMessage(ChannelMessageHeader header) + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + + ChannelMessage message = new ChannelMessage(); + MessageType inboxItem = client.GetMessage(header.MessageNumber); + + // Now the message Body is there. + BodyType messageBody = inboxItem.Body; + + message.Size = header.Size; + message.MessageNumber = header.MessageNumber; + message.MessageIdentifier = header.MessageIdentifier; + message.Context = header.Context; + message.From = new SourceAddress(inboxItem.From.Item.EmailAddress, inboxItem.From.Item.Name); + + if (inboxItem.ToRecipients != null) + foreach (var toRecipient in inboxItem.ToRecipients) + message.To.Add(new SourceAddress(toRecipient.EmailAddress, toRecipient.Name)); + + if (inboxItem.CcRecipients != null) + foreach (var ccRecipient in inboxItem.CcRecipients) + message.CC.Add(new SourceAddress(ccRecipient.EmailAddress, ccRecipient.Name)); + + if (inboxItem.BccRecipients != null) + foreach (var bccRecipient in inboxItem.BccRecipients) + message.BCC.Add(new SourceAddress(bccRecipient.EmailAddress, bccRecipient.Name)); + + message.InReplyTo = inboxItem.InReplyTo; + message.Metadata = header.Metadata; + message.IsRead = inboxItem.IsRead; + message.BodyHtml = messageBody.Value.ToStream(); + message.DateReceived = header.DateReceived; + + if (inboxItem.Attachments != null) + { + foreach (AttachmentType exchAttachment in inboxItem.Attachments) + { + var fileAttachment = client.GetAttachment(exchAttachment.AttachmentId.Id); + + message.Attachments.Add(new ChannelAttachment + { + Filename = fileAttachment.Name, + ContentType = ContentType.Attachment, + ContentStream = new MemoryStream(fileAttachment.Content) + }); + } + } + + yield return message; + } + + public void Send(ChannelMessage message) + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + + var messageId = client.SaveMessage(message); + + // Upload attachments + if (message.Attachments.Count > 0) + client.SaveAttachments(messageId, message); + + // Refresh and send message by message-id + client.SendMessage(client.GetMessageId(messageId.Id).ItemId); + } + + public bool Disconnect() + { + return true; + } + + public IClientInputChannel Clone() + { + return new ExchangeClientChannel + { + Hostname = Hostname, + Port = Port, + IsSecured = IsSecured, + MaxConcurrentConnections = MaxConcurrentConnections, + CredentialsProvider = CredentialsProvider + }; + } + + public void Dispose() + { + } + + public long GetNumberOfItems() + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + + return client.GetNrItemsInFolder(folder); + } + + public void MarkRead(ChannelMessageHeader message) + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + var messageId = client.GetMessageId(message.MessageNumber).ItemId; + + client.SetMessageReadState(messageId, true); + } + + public void MarkUnread(ChannelMessageHeader message) + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + var messageId = client.GetMessageId(message.MessageNumber).ItemId; + + client.SetMessageReadState(messageId, false); + } + + public void MarkDeleted(ChannelMessageHeader message) + { + var trash = GetFolders().First(f => f.FolderType == ChannelFolderType.Trash); + + var client = new ExchangeClient(Hostname, CredentialsProvider); + var messageId = client.GetMessageId(message.MessageNumber).ItemId; + + client.MoveMessageToFolder(messageId, trash.FolderId); + } + + public void SetStarred(ChannelMessageHeader message, bool starred) + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + var messageId = client.GetMessageId(message.MessageNumber).ItemId; + + client.SetMessageImportance(messageId, starred); + } + + public void Purge(ChannelMessageHeader message) + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + var messageId = client.GetMessageId(message.MessageNumber).ItemId; + + client.DeleteMessage(messageId); + } + + public ChannelFolder CreateFolder(string folderName) + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + var folderId = client.CreateFolder(folderName, folders.First(f => f.FolderType == ChannelFolderType.Inbox).FolderId); + + var newFolder = new ChannelFolder(folderId, folderName, ChannelFolderType.Label); + + folders.Add(newFolder); + + return newFolder; + } + + public void MoveToFolder(ChannelMessageHeader message, ChannelFolder folder) + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + var messageId = client.GetMessageId(message.MessageNumber).ItemId; + + client.MoveMessageToFolder(messageId, folder.FolderId); + } + + public void CopyToFolder(ChannelMessageHeader message, ChannelFolder folder) + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + var messageId = client.GetMessageId(message.MessageNumber).ItemId; + + client.CopyMessageToFolder(messageId, folder.FolderId); + } + + public void RemoveFromFolder(ChannelMessageHeader message, ChannelFolder folder) + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + var messageId = client.GetMessageId(message.MessageNumber).ItemId; + + client.DeleteMessage(messageId); + } + + public void AddLabel(ChannelMessageHeader message, string labelname) + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + var messageId = client.GetMessageId(message.MessageNumber).ItemId; + + client.CopyMessageToFolder(messageId, folders.First(f => f.Name.ToLower() == labelname.ToLower()).FolderId); + } + + public void RemoveLabel(string messagenumber, string labelname) + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + var messageId = client.GetMessageId(messagenumber).ItemId; + + client.DeleteMessage(messageId); + } + + public IEnumerable GetContacts() + { + var client = new ExchangeClient(Hostname, CredentialsProvider); + + foreach (var contactItem in client.GetContacts()) + { + if (contactItem.EmailAddresses == null || contactItem.EmailAddresses.Length == 0) + { + Logger.Warn("Contact {0} had no email address, ignoring", LogSource.Sync, contactItem.DisplayName); + + continue; + } + + var contact = new ChannelContact(); + + contact.Profile.ChannelProfileKey = contactItem.ItemId.Id; + contact.Profile.SourceAddress = new SourceAddress(contactItem.EmailAddresses[0].Value, contactItem.DisplayName); + + contact.Person.Lastname = contactItem.Surname; + contact.Person.Firstname = contactItem.GivenName; + + if (contactItem.BirthdaySpecified) + contact.Person.DateOfBirth = contactItem.Birthday; + + contact.Profile.ScreenName = contactItem.Nickname; + contact.Profile.Title = contactItem.JobTitle; + contact.Profile.ScreenName = contactItem.DisplayName; + contact.Profile.CompanyName = contactItem.CompanyName; + + if (contactItem.PhysicalAddresses.Length > 0) + { + contact.Profile.Street = contactItem.PhysicalAddresses[0].Street; + contact.Profile.ZipCode = contactItem.PhysicalAddresses[0].PostalCode; + contact.Profile.City = contactItem.PhysicalAddresses[0].City; + contact.Profile.Country = contactItem.PhysicalAddresses[0].CountryOrRegion; + } + + yield return contact; + } + } + + IClientContactsChannel IClientContactsChannel.Clone() + { + return new ExchangeClientChannel() + { + Hostname = Hostname, + Port = Port, + IsSecured = IsSecured, + MaxConcurrentConnections = MaxConcurrentConnections, + CredentialsProvider = CredentialsProvider + }; + } + } +} diff --git a/Code/Channels/Exchange/ExchangeConfiguration.cs b/Code/Channels/Exchange/ExchangeConfiguration.cs new file mode 100644 index 0000000..6c81ed4 --- /dev/null +++ b/Code/Channels/Exchange/ExchangeConfiguration.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Linq; +using System.Text; +using System.Xml.Serialization; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Interfaces.Enumerations; + +namespace Inbox2.Channels.Exchange +{ + [Serializable] + [Export(typeof(ChannelConfiguration))] + public class ExchangeConfiguration : ChannelConfiguration + { + public ExchangeConfiguration() + { + InnerInputChannel = new Channel { Type = typeof(ExchangeClientChannel), Port = 80, IsSecured = false, MaxConcurrentConnections = 2 }; + InnerOutputChannel = new Channel { Type = typeof(ExchangeClientChannel), Port = 80, IsSecured = false, MaxConcurrentConnections = 2 }; + InnerContactsChannel = new Channel { Type = typeof(ExchangeClientChannel), Port = 80, IsSecured = false, MaxConcurrentConnections = 2 }; + } + + public override string DisplayName + { + get { return "Exchange"; } + } + + public override DisplayStyle DisplayStyle + { + get { return DisplayStyle.Advanced; } + } + + public override ChannelCharasteristics Charasteristics + { + get + { + var charasteristics = ChannelCharasteristics.Default; + + charasteristics.SupportsReadStates = true; + charasteristics.SupportsLabels = true; + + return charasteristics; + } + } + + public override ChannelConfiguration Clone() + { + return this.DeepCopy(new XmlSerializer(typeof(ExchangeConfiguration))); + } + } +} \ No newline at end of file diff --git a/Code/Channels/Exchange/ExchangeWebService.cs b/Code/Channels/Exchange/ExchangeWebService.cs new file mode 100644 index 0000000..47bd4e6 --- /dev/null +++ b/Code/Channels/Exchange/ExchangeWebService.cs @@ -0,0 +1,23747 @@ +using System; +using System.ComponentModel; +using System.Diagnostics; +using System.Web.Services; +using System.Web.Services.Protocols; +using System.Xml.Serialization; + +namespace ExchangeServicesWsdlClient +{ + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "ExchangeServiceBinding", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AttendeeConflictData))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseSubscriptionRequestType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseGroupByType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RecurrenceRangeBaseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RecurrencePatternBaseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AttachmentType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ChangeDescriptionType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BasePagingType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BasePermissionType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFolderType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseItemIdType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseEmailAddressType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseFolderIdType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseRequestType))] + public partial class ExchangeServiceBinding : System.Web.Services.Protocols.SoapHttpClientProtocol + { + + private ExchangeImpersonationType exchangeImpersonationField; + + private SerializedSecurityContextType serializedSecurityContextField; + + private language mailboxCultureField; + + private RequestServerVersion requestServerVersionValueField; + + private ServerVersionInfo serverVersionInfoValueField; + + private System.Threading.SendOrPostCallback ResolveNamesOperationCompleted; + + private System.Threading.SendOrPostCallback ExpandDLOperationCompleted; + + private System.Threading.SendOrPostCallback FindFolderOperationCompleted; + + private System.Threading.SendOrPostCallback FindItemOperationCompleted; + + private System.Threading.SendOrPostCallback GetFolderOperationCompleted; + + private System.Threading.SendOrPostCallback ConvertIdOperationCompleted; + + private System.Threading.SendOrPostCallback CreateFolderOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteFolderOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateFolderOperationCompleted; + + private System.Threading.SendOrPostCallback MoveFolderOperationCompleted; + + private System.Threading.SendOrPostCallback CopyFolderOperationCompleted; + + private System.Threading.SendOrPostCallback SubscribeOperationCompleted; + + private System.Threading.SendOrPostCallback UnsubscribeOperationCompleted; + + private System.Threading.SendOrPostCallback GetEventsOperationCompleted; + + private System.Threading.SendOrPostCallback SyncFolderHierarchyOperationCompleted; + + private System.Threading.SendOrPostCallback SyncFolderItemsOperationCompleted; + + private System.Threading.SendOrPostCallback CreateManagedFolderOperationCompleted; + + private System.Threading.SendOrPostCallback GetItemOperationCompleted; + + private System.Threading.SendOrPostCallback CreateItemOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteItemOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateItemOperationCompleted; + + private System.Threading.SendOrPostCallback SendItemOperationCompleted; + + private System.Threading.SendOrPostCallback MoveItemOperationCompleted; + + private System.Threading.SendOrPostCallback CopyItemOperationCompleted; + + private System.Threading.SendOrPostCallback CreateAttachmentOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteAttachmentOperationCompleted; + + private System.Threading.SendOrPostCallback GetAttachmentOperationCompleted; + + private System.Threading.SendOrPostCallback GetDelegateOperationCompleted; + + private System.Threading.SendOrPostCallback AddDelegateOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveDelegateOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateDelegateOperationCompleted; + + private AvailabilityProxyRequestType proxyRequestTypeHeaderField; + + private System.Threading.SendOrPostCallback GetUserAvailabilityOperationCompleted; + + private System.Threading.SendOrPostCallback GetUserOofSettingsOperationCompleted; + + private System.Threading.SendOrPostCallback SetUserOofSettingsOperationCompleted; + + /// + public ExchangeServiceBinding() + { + } + + public ExchangeImpersonationType ExchangeImpersonation + { + get + { + return this.exchangeImpersonationField; + } + set + { + this.exchangeImpersonationField = value; + } + } + + public SerializedSecurityContextType SerializedSecurityContext + { + get + { + return this.serializedSecurityContextField; + } + set + { + this.serializedSecurityContextField = value; + } + } + + public language MailboxCulture + { + get + { + return this.mailboxCultureField; + } + set + { + this.mailboxCultureField = value; + } + } + + public RequestServerVersion RequestServerVersionValue + { + get + { + return this.requestServerVersionValueField; + } + set + { + this.requestServerVersionValueField = value; + } + } + + public ServerVersionInfo ServerVersionInfoValue + { + get + { + return this.serverVersionInfoValueField; + } + set + { + this.serverVersionInfoValueField = value; + } + } + + public AvailabilityProxyRequestType ProxyRequestTypeHeader + { + get + { + return this.proxyRequestTypeHeaderField; + } + set + { + this.proxyRequestTypeHeaderField = value; + } + } + + /// + public event ResolveNamesCompletedEventHandler ResolveNamesCompleted; + + /// + public event ExpandDLCompletedEventHandler ExpandDLCompleted; + + /// + public event FindFolderCompletedEventHandler FindFolderCompleted; + + /// + public event FindItemCompletedEventHandler FindItemCompleted; + + /// + public event GetFolderCompletedEventHandler GetFolderCompleted; + + /// + public event ConvertIdCompletedEventHandler ConvertIdCompleted; + + /// + public event CreateFolderCompletedEventHandler CreateFolderCompleted; + + /// + public event DeleteFolderCompletedEventHandler DeleteFolderCompleted; + + /// + public event UpdateFolderCompletedEventHandler UpdateFolderCompleted; + + /// + public event MoveFolderCompletedEventHandler MoveFolderCompleted; + + /// + public event CopyFolderCompletedEventHandler CopyFolderCompleted; + + /// + public event SubscribeCompletedEventHandler SubscribeCompleted; + + /// + public event UnsubscribeCompletedEventHandler UnsubscribeCompleted; + + /// + public event GetEventsCompletedEventHandler GetEventsCompleted; + + /// + public event SyncFolderHierarchyCompletedEventHandler SyncFolderHierarchyCompleted; + + /// + public event SyncFolderItemsCompletedEventHandler SyncFolderItemsCompleted; + + /// + public event CreateManagedFolderCompletedEventHandler CreateManagedFolderCompleted; + + /// + public event GetItemCompletedEventHandler GetItemCompleted; + + /// + public event CreateItemCompletedEventHandler CreateItemCompleted; + + /// + public event DeleteItemCompletedEventHandler DeleteItemCompleted; + + /// + public event UpdateItemCompletedEventHandler UpdateItemCompleted; + + /// + public event SendItemCompletedEventHandler SendItemCompleted; + + /// + public event MoveItemCompletedEventHandler MoveItemCompleted; + + /// + public event CopyItemCompletedEventHandler CopyItemCompleted; + + /// + public event CreateAttachmentCompletedEventHandler CreateAttachmentCompleted; + + /// + public event DeleteAttachmentCompletedEventHandler DeleteAttachmentCompleted; + + /// + public event GetAttachmentCompletedEventHandler GetAttachmentCompleted; + + /// + public event GetDelegateCompletedEventHandler GetDelegateCompleted; + + /// + public event AddDelegateCompletedEventHandler AddDelegateCompleted; + + /// + public event RemoveDelegateCompletedEventHandler RemoveDelegateCompleted; + + /// + public event UpdateDelegateCompletedEventHandler UpdateDelegateCompleted; + + /// + public event GetUserAvailabilityCompletedEventHandler GetUserAvailabilityCompleted; + + /// + public event GetUserOofSettingsCompletedEventHandler GetUserOofSettingsCompleted; + + /// + public event SetUserOofSettingsCompletedEventHandler SetUserOofSettingsCompleted; + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/ResolveNames", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("ResolveNamesResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public ResolveNamesResponseType ResolveNames([System.Xml.Serialization.XmlElementAttribute("ResolveNames", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] ResolveNamesType ResolveNames1) + { + object[] results = this.Invoke("ResolveNames", new object[] { + ResolveNames1}); + return ((ResolveNamesResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginResolveNames(ResolveNamesType ResolveNames1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("ResolveNames", new object[] { + ResolveNames1}, callback, asyncState); + } + + /// + public ResolveNamesResponseType EndResolveNames(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResolveNamesResponseType)(results[0])); + } + + /// + public void ResolveNamesAsync(ResolveNamesType ResolveNames1) + { + this.ResolveNamesAsync(ResolveNames1, null); + } + + /// + public void ResolveNamesAsync(ResolveNamesType ResolveNames1, object userState) + { + if ((this.ResolveNamesOperationCompleted == null)) + { + this.ResolveNamesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnResolveNamesOperationCompleted); + } + this.InvokeAsync("ResolveNames", new object[] { + ResolveNames1}, this.ResolveNamesOperationCompleted, userState); + } + + private void OnResolveNamesOperationCompleted(object arg) + { + if ((this.ResolveNamesCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ResolveNamesCompleted(this, new ResolveNamesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/ExpandDL", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("ExpandDLResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public ExpandDLResponseType ExpandDL([System.Xml.Serialization.XmlElementAttribute("ExpandDL", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] ExpandDLType ExpandDL1) + { + object[] results = this.Invoke("ExpandDL", new object[] { + ExpandDL1}); + return ((ExpandDLResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginExpandDL(ExpandDLType ExpandDL1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("ExpandDL", new object[] { + ExpandDL1}, callback, asyncState); + } + + /// + public ExpandDLResponseType EndExpandDL(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ExpandDLResponseType)(results[0])); + } + + /// + public void ExpandDLAsync(ExpandDLType ExpandDL1) + { + this.ExpandDLAsync(ExpandDL1, null); + } + + /// + public void ExpandDLAsync(ExpandDLType ExpandDL1, object userState) + { + if ((this.ExpandDLOperationCompleted == null)) + { + this.ExpandDLOperationCompleted = new System.Threading.SendOrPostCallback(this.OnExpandDLOperationCompleted); + } + this.InvokeAsync("ExpandDL", new object[] { + ExpandDL1}, this.ExpandDLOperationCompleted, userState); + } + + private void OnExpandDLOperationCompleted(object arg) + { + if ((this.ExpandDLCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ExpandDLCompleted(this, new ExpandDLCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/FindFolder", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("FindFolderResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public FindFolderResponseType FindFolder([System.Xml.Serialization.XmlElementAttribute("FindFolder", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] FindFolderType FindFolder1) + { + object[] results = this.Invoke("FindFolder", new object[] { + FindFolder1}); + return ((FindFolderResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginFindFolder(FindFolderType FindFolder1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("FindFolder", new object[] { + FindFolder1}, callback, asyncState); + } + + /// + public FindFolderResponseType EndFindFolder(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((FindFolderResponseType)(results[0])); + } + + /// + public void FindFolderAsync(FindFolderType FindFolder1) + { + this.FindFolderAsync(FindFolder1, null); + } + + /// + public void FindFolderAsync(FindFolderType FindFolder1, object userState) + { + if ((this.FindFolderOperationCompleted == null)) + { + this.FindFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnFindFolderOperationCompleted); + } + this.InvokeAsync("FindFolder", new object[] { + FindFolder1}, this.FindFolderOperationCompleted, userState); + } + + private void OnFindFolderOperationCompleted(object arg) + { + if ((this.FindFolderCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.FindFolderCompleted(this, new FindFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/FindItem", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("FindItemResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public FindItemResponseType FindItem([System.Xml.Serialization.XmlElementAttribute("FindItem", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] FindItemType FindItem1) + { + object[] results = this.Invoke("FindItem", new object[] { + FindItem1}); + return ((FindItemResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginFindItem(FindItemType FindItem1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("FindItem", new object[] { + FindItem1}, callback, asyncState); + } + + /// + public FindItemResponseType EndFindItem(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((FindItemResponseType)(results[0])); + } + + /// + public void FindItemAsync(FindItemType FindItem1) + { + this.FindItemAsync(FindItem1, null); + } + + /// + public void FindItemAsync(FindItemType FindItem1, object userState) + { + if ((this.FindItemOperationCompleted == null)) + { + this.FindItemOperationCompleted = new System.Threading.SendOrPostCallback(this.OnFindItemOperationCompleted); + } + this.InvokeAsync("FindItem", new object[] { + FindItem1}, this.FindItemOperationCompleted, userState); + } + + private void OnFindItemOperationCompleted(object arg) + { + if ((this.FindItemCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.FindItemCompleted(this, new FindItemCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/GetFolder", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("GetFolderResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public GetFolderResponseType GetFolder([System.Xml.Serialization.XmlElementAttribute("GetFolder", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] GetFolderType GetFolder1) + { + object[] results = this.Invoke("GetFolder", new object[] { + GetFolder1}); + return ((GetFolderResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginGetFolder(GetFolderType GetFolder1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetFolder", new object[] { + GetFolder1}, callback, asyncState); + } + + /// + public GetFolderResponseType EndGetFolder(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((GetFolderResponseType)(results[0])); + } + + /// + public void GetFolderAsync(GetFolderType GetFolder1) + { + this.GetFolderAsync(GetFolder1, null); + } + + /// + public void GetFolderAsync(GetFolderType GetFolder1, object userState) + { + if ((this.GetFolderOperationCompleted == null)) + { + this.GetFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFolderOperationCompleted); + } + this.InvokeAsync("GetFolder", new object[] { + GetFolder1}, this.GetFolderOperationCompleted, userState); + } + + private void OnGetFolderOperationCompleted(object arg) + { + if ((this.GetFolderCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetFolderCompleted(this, new GetFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/ConvertId", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("ConvertIdResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public ConvertIdResponseType ConvertId([System.Xml.Serialization.XmlElementAttribute("ConvertId", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] ConvertIdType ConvertId1) + { + object[] results = this.Invoke("ConvertId", new object[] { + ConvertId1}); + return ((ConvertIdResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginConvertId(ConvertIdType ConvertId1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("ConvertId", new object[] { + ConvertId1}, callback, asyncState); + } + + /// + public ConvertIdResponseType EndConvertId(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ConvertIdResponseType)(results[0])); + } + + /// + public void ConvertIdAsync(ConvertIdType ConvertId1) + { + this.ConvertIdAsync(ConvertId1, null); + } + + /// + public void ConvertIdAsync(ConvertIdType ConvertId1, object userState) + { + if ((this.ConvertIdOperationCompleted == null)) + { + this.ConvertIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnConvertIdOperationCompleted); + } + this.InvokeAsync("ConvertId", new object[] { + ConvertId1}, this.ConvertIdOperationCompleted, userState); + } + + private void OnConvertIdOperationCompleted(object arg) + { + if ((this.ConvertIdCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ConvertIdCompleted(this, new ConvertIdCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/CreateFolder", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("CreateFolderResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public CreateFolderResponseType CreateFolder([System.Xml.Serialization.XmlElementAttribute("CreateFolder", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] CreateFolderType CreateFolder1) + { + object[] results = this.Invoke("CreateFolder", new object[] { + CreateFolder1}); + return ((CreateFolderResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateFolder(CreateFolderType CreateFolder1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("CreateFolder", new object[] { + CreateFolder1}, callback, asyncState); + } + + /// + public CreateFolderResponseType EndCreateFolder(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((CreateFolderResponseType)(results[0])); + } + + /// + public void CreateFolderAsync(CreateFolderType CreateFolder1) + { + this.CreateFolderAsync(CreateFolder1, null); + } + + /// + public void CreateFolderAsync(CreateFolderType CreateFolder1, object userState) + { + if ((this.CreateFolderOperationCompleted == null)) + { + this.CreateFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateFolderOperationCompleted); + } + this.InvokeAsync("CreateFolder", new object[] { + CreateFolder1}, this.CreateFolderOperationCompleted, userState); + } + + private void OnCreateFolderOperationCompleted(object arg) + { + if ((this.CreateFolderCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateFolderCompleted(this, new CreateFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/DeleteFolder", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("DeleteFolderResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public DeleteFolderResponseType DeleteFolder([System.Xml.Serialization.XmlElementAttribute("DeleteFolder", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] DeleteFolderType DeleteFolder1) + { + object[] results = this.Invoke("DeleteFolder", new object[] { + DeleteFolder1}); + return ((DeleteFolderResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteFolder(DeleteFolderType DeleteFolder1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("DeleteFolder", new object[] { + DeleteFolder1}, callback, asyncState); + } + + /// + public DeleteFolderResponseType EndDeleteFolder(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((DeleteFolderResponseType)(results[0])); + } + + /// + public void DeleteFolderAsync(DeleteFolderType DeleteFolder1) + { + this.DeleteFolderAsync(DeleteFolder1, null); + } + + /// + public void DeleteFolderAsync(DeleteFolderType DeleteFolder1, object userState) + { + if ((this.DeleteFolderOperationCompleted == null)) + { + this.DeleteFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteFolderOperationCompleted); + } + this.InvokeAsync("DeleteFolder", new object[] { + DeleteFolder1}, this.DeleteFolderOperationCompleted, userState); + } + + private void OnDeleteFolderOperationCompleted(object arg) + { + if ((this.DeleteFolderCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteFolderCompleted(this, new DeleteFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/UpdateFolder", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("UpdateFolderResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public UpdateFolderResponseType UpdateFolder([System.Xml.Serialization.XmlElementAttribute("UpdateFolder", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] UpdateFolderType UpdateFolder1) + { + object[] results = this.Invoke("UpdateFolder", new object[] { + UpdateFolder1}); + return ((UpdateFolderResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginUpdateFolder(UpdateFolderType UpdateFolder1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("UpdateFolder", new object[] { + UpdateFolder1}, callback, asyncState); + } + + /// + public UpdateFolderResponseType EndUpdateFolder(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((UpdateFolderResponseType)(results[0])); + } + + /// + public void UpdateFolderAsync(UpdateFolderType UpdateFolder1) + { + this.UpdateFolderAsync(UpdateFolder1, null); + } + + /// + public void UpdateFolderAsync(UpdateFolderType UpdateFolder1, object userState) + { + if ((this.UpdateFolderOperationCompleted == null)) + { + this.UpdateFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateFolderOperationCompleted); + } + this.InvokeAsync("UpdateFolder", new object[] { + UpdateFolder1}, this.UpdateFolderOperationCompleted, userState); + } + + private void OnUpdateFolderOperationCompleted(object arg) + { + if ((this.UpdateFolderCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateFolderCompleted(this, new UpdateFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/MoveFolder", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("MoveFolderResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public MoveFolderResponseType MoveFolder([System.Xml.Serialization.XmlElementAttribute("MoveFolder", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] MoveFolderType MoveFolder1) + { + object[] results = this.Invoke("MoveFolder", new object[] { + MoveFolder1}); + return ((MoveFolderResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginMoveFolder(MoveFolderType MoveFolder1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("MoveFolder", new object[] { + MoveFolder1}, callback, asyncState); + } + + /// + public MoveFolderResponseType EndMoveFolder(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((MoveFolderResponseType)(results[0])); + } + + /// + public void MoveFolderAsync(MoveFolderType MoveFolder1) + { + this.MoveFolderAsync(MoveFolder1, null); + } + + /// + public void MoveFolderAsync(MoveFolderType MoveFolder1, object userState) + { + if ((this.MoveFolderOperationCompleted == null)) + { + this.MoveFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnMoveFolderOperationCompleted); + } + this.InvokeAsync("MoveFolder", new object[] { + MoveFolder1}, this.MoveFolderOperationCompleted, userState); + } + + private void OnMoveFolderOperationCompleted(object arg) + { + if ((this.MoveFolderCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.MoveFolderCompleted(this, new MoveFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/CopyFolder", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("CopyFolderResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public CopyFolderResponseType CopyFolder([System.Xml.Serialization.XmlElementAttribute("CopyFolder", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] CopyFolderType CopyFolder1) + { + object[] results = this.Invoke("CopyFolder", new object[] { + CopyFolder1}); + return ((CopyFolderResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginCopyFolder(CopyFolderType CopyFolder1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("CopyFolder", new object[] { + CopyFolder1}, callback, asyncState); + } + + /// + public CopyFolderResponseType EndCopyFolder(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((CopyFolderResponseType)(results[0])); + } + + /// + public void CopyFolderAsync(CopyFolderType CopyFolder1) + { + this.CopyFolderAsync(CopyFolder1, null); + } + + /// + public void CopyFolderAsync(CopyFolderType CopyFolder1, object userState) + { + if ((this.CopyFolderOperationCompleted == null)) + { + this.CopyFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCopyFolderOperationCompleted); + } + this.InvokeAsync("CopyFolder", new object[] { + CopyFolder1}, this.CopyFolderOperationCompleted, userState); + } + + private void OnCopyFolderOperationCompleted(object arg) + { + if ((this.CopyFolderCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CopyFolderCompleted(this, new CopyFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/Subscribe", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("SubscribeResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public SubscribeResponseType Subscribe([System.Xml.Serialization.XmlElementAttribute("Subscribe", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] SubscribeType Subscribe1) + { + object[] results = this.Invoke("Subscribe", new object[] { + Subscribe1}); + return ((SubscribeResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginSubscribe(SubscribeType Subscribe1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("Subscribe", new object[] { + Subscribe1}, callback, asyncState); + } + + /// + public SubscribeResponseType EndSubscribe(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((SubscribeResponseType)(results[0])); + } + + /// + public void SubscribeAsync(SubscribeType Subscribe1) + { + this.SubscribeAsync(Subscribe1, null); + } + + /// + public void SubscribeAsync(SubscribeType Subscribe1, object userState) + { + if ((this.SubscribeOperationCompleted == null)) + { + this.SubscribeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSubscribeOperationCompleted); + } + this.InvokeAsync("Subscribe", new object[] { + Subscribe1}, this.SubscribeOperationCompleted, userState); + } + + private void OnSubscribeOperationCompleted(object arg) + { + if ((this.SubscribeCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SubscribeCompleted(this, new SubscribeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/Unsubscribe", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("UnsubscribeResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public UnsubscribeResponseType Unsubscribe([System.Xml.Serialization.XmlElementAttribute("Unsubscribe", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] UnsubscribeType Unsubscribe1) + { + object[] results = this.Invoke("Unsubscribe", new object[] { + Unsubscribe1}); + return ((UnsubscribeResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginUnsubscribe(UnsubscribeType Unsubscribe1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("Unsubscribe", new object[] { + Unsubscribe1}, callback, asyncState); + } + + /// + public UnsubscribeResponseType EndUnsubscribe(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((UnsubscribeResponseType)(results[0])); + } + + /// + public void UnsubscribeAsync(UnsubscribeType Unsubscribe1) + { + this.UnsubscribeAsync(Unsubscribe1, null); + } + + /// + public void UnsubscribeAsync(UnsubscribeType Unsubscribe1, object userState) + { + if ((this.UnsubscribeOperationCompleted == null)) + { + this.UnsubscribeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUnsubscribeOperationCompleted); + } + this.InvokeAsync("Unsubscribe", new object[] { + Unsubscribe1}, this.UnsubscribeOperationCompleted, userState); + } + + private void OnUnsubscribeOperationCompleted(object arg) + { + if ((this.UnsubscribeCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UnsubscribeCompleted(this, new UnsubscribeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/GetEvents", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("GetEventsResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public GetEventsResponseType GetEvents([System.Xml.Serialization.XmlElementAttribute("GetEvents", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] GetEventsType GetEvents1) + { + object[] results = this.Invoke("GetEvents", new object[] { + GetEvents1}); + return ((GetEventsResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginGetEvents(GetEventsType GetEvents1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetEvents", new object[] { + GetEvents1}, callback, asyncState); + } + + /// + public GetEventsResponseType EndGetEvents(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((GetEventsResponseType)(results[0])); + } + + /// + public void GetEventsAsync(GetEventsType GetEvents1) + { + this.GetEventsAsync(GetEvents1, null); + } + + /// + public void GetEventsAsync(GetEventsType GetEvents1, object userState) + { + if ((this.GetEventsOperationCompleted == null)) + { + this.GetEventsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetEventsOperationCompleted); + } + this.InvokeAsync("GetEvents", new object[] { + GetEvents1}, this.GetEventsOperationCompleted, userState); + } + + private void OnGetEventsOperationCompleted(object arg) + { + if ((this.GetEventsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetEventsCompleted(this, new GetEventsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/SyncFolderHierarchy", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("SyncFolderHierarchyResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public SyncFolderHierarchyResponseType SyncFolderHierarchy([System.Xml.Serialization.XmlElementAttribute("SyncFolderHierarchy", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] SyncFolderHierarchyType SyncFolderHierarchy1) + { + object[] results = this.Invoke("SyncFolderHierarchy", new object[] { + SyncFolderHierarchy1}); + return ((SyncFolderHierarchyResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginSyncFolderHierarchy(SyncFolderHierarchyType SyncFolderHierarchy1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("SyncFolderHierarchy", new object[] { + SyncFolderHierarchy1}, callback, asyncState); + } + + /// + public SyncFolderHierarchyResponseType EndSyncFolderHierarchy(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((SyncFolderHierarchyResponseType)(results[0])); + } + + /// + public void SyncFolderHierarchyAsync(SyncFolderHierarchyType SyncFolderHierarchy1) + { + this.SyncFolderHierarchyAsync(SyncFolderHierarchy1, null); + } + + /// + public void SyncFolderHierarchyAsync(SyncFolderHierarchyType SyncFolderHierarchy1, object userState) + { + if ((this.SyncFolderHierarchyOperationCompleted == null)) + { + this.SyncFolderHierarchyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSyncFolderHierarchyOperationCompleted); + } + this.InvokeAsync("SyncFolderHierarchy", new object[] { + SyncFolderHierarchy1}, this.SyncFolderHierarchyOperationCompleted, userState); + } + + private void OnSyncFolderHierarchyOperationCompleted(object arg) + { + if ((this.SyncFolderHierarchyCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SyncFolderHierarchyCompleted(this, new SyncFolderHierarchyCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/SyncFolderItems", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("SyncFolderItemsResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public SyncFolderItemsResponseType SyncFolderItems([System.Xml.Serialization.XmlElementAttribute("SyncFolderItems", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] SyncFolderItemsType SyncFolderItems1) + { + object[] results = this.Invoke("SyncFolderItems", new object[] { + SyncFolderItems1}); + return ((SyncFolderItemsResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginSyncFolderItems(SyncFolderItemsType SyncFolderItems1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("SyncFolderItems", new object[] { + SyncFolderItems1}, callback, asyncState); + } + + /// + public SyncFolderItemsResponseType EndSyncFolderItems(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((SyncFolderItemsResponseType)(results[0])); + } + + /// + public void SyncFolderItemsAsync(SyncFolderItemsType SyncFolderItems1) + { + this.SyncFolderItemsAsync(SyncFolderItems1, null); + } + + /// + public void SyncFolderItemsAsync(SyncFolderItemsType SyncFolderItems1, object userState) + { + if ((this.SyncFolderItemsOperationCompleted == null)) + { + this.SyncFolderItemsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSyncFolderItemsOperationCompleted); + } + this.InvokeAsync("SyncFolderItems", new object[] { + SyncFolderItems1}, this.SyncFolderItemsOperationCompleted, userState); + } + + private void OnSyncFolderItemsOperationCompleted(object arg) + { + if ((this.SyncFolderItemsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SyncFolderItemsCompleted(this, new SyncFolderItemsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/CreateManagedFolder", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("CreateManagedFolderResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public CreateManagedFolderResponseType CreateManagedFolder([System.Xml.Serialization.XmlElementAttribute("CreateManagedFolder", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] CreateManagedFolderRequestType CreateManagedFolder1) + { + object[] results = this.Invoke("CreateManagedFolder", new object[] { + CreateManagedFolder1}); + return ((CreateManagedFolderResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateManagedFolder(CreateManagedFolderRequestType CreateManagedFolder1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("CreateManagedFolder", new object[] { + CreateManagedFolder1}, callback, asyncState); + } + + /// + public CreateManagedFolderResponseType EndCreateManagedFolder(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((CreateManagedFolderResponseType)(results[0])); + } + + /// + public void CreateManagedFolderAsync(CreateManagedFolderRequestType CreateManagedFolder1) + { + this.CreateManagedFolderAsync(CreateManagedFolder1, null); + } + + /// + public void CreateManagedFolderAsync(CreateManagedFolderRequestType CreateManagedFolder1, object userState) + { + if ((this.CreateManagedFolderOperationCompleted == null)) + { + this.CreateManagedFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateManagedFolderOperationCompleted); + } + this.InvokeAsync("CreateManagedFolder", new object[] { + CreateManagedFolder1}, this.CreateManagedFolderOperationCompleted, userState); + } + + private void OnCreateManagedFolderOperationCompleted(object arg) + { + if ((this.CreateManagedFolderCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateManagedFolderCompleted(this, new CreateManagedFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/GetItem", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("GetItemResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public GetItemResponseType GetItem([System.Xml.Serialization.XmlElementAttribute("GetItem", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] GetItemType GetItem1) + { + object[] results = this.Invoke("GetItem", new object[] { + GetItem1}); + return ((GetItemResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginGetItem(GetItemType GetItem1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetItem", new object[] { + GetItem1}, callback, asyncState); + } + + /// + public GetItemResponseType EndGetItem(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((GetItemResponseType)(results[0])); + } + + /// + public void GetItemAsync(GetItemType GetItem1) + { + this.GetItemAsync(GetItem1, null); + } + + /// + public void GetItemAsync(GetItemType GetItem1, object userState) + { + if ((this.GetItemOperationCompleted == null)) + { + this.GetItemOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetItemOperationCompleted); + } + this.InvokeAsync("GetItem", new object[] { + GetItem1}, this.GetItemOperationCompleted, userState); + } + + private void OnGetItemOperationCompleted(object arg) + { + if ((this.GetItemCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetItemCompleted(this, new GetItemCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/CreateItem", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("CreateItemResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public CreateItemResponseType CreateItem([System.Xml.Serialization.XmlElementAttribute("CreateItem", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] CreateItemType CreateItem1) + { + object[] results = this.Invoke("CreateItem", new object[] { + CreateItem1}); + return ((CreateItemResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateItem(CreateItemType CreateItem1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("CreateItem", new object[] { + CreateItem1}, callback, asyncState); + } + + /// + public CreateItemResponseType EndCreateItem(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((CreateItemResponseType)(results[0])); + } + + /// + public void CreateItemAsync(CreateItemType CreateItem1) + { + this.CreateItemAsync(CreateItem1, null); + } + + /// + public void CreateItemAsync(CreateItemType CreateItem1, object userState) + { + if ((this.CreateItemOperationCompleted == null)) + { + this.CreateItemOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateItemOperationCompleted); + } + this.InvokeAsync("CreateItem", new object[] { + CreateItem1}, this.CreateItemOperationCompleted, userState); + } + + private void OnCreateItemOperationCompleted(object arg) + { + if ((this.CreateItemCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateItemCompleted(this, new CreateItemCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/DeleteItem", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("DeleteItemResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public DeleteItemResponseType DeleteItem([System.Xml.Serialization.XmlElementAttribute("DeleteItem", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] DeleteItemType DeleteItem1) + { + object[] results = this.Invoke("DeleteItem", new object[] { + DeleteItem1}); + return ((DeleteItemResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteItem(DeleteItemType DeleteItem1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("DeleteItem", new object[] { + DeleteItem1}, callback, asyncState); + } + + /// + public DeleteItemResponseType EndDeleteItem(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((DeleteItemResponseType)(results[0])); + } + + /// + public void DeleteItemAsync(DeleteItemType DeleteItem1) + { + this.DeleteItemAsync(DeleteItem1, null); + } + + /// + public void DeleteItemAsync(DeleteItemType DeleteItem1, object userState) + { + if ((this.DeleteItemOperationCompleted == null)) + { + this.DeleteItemOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteItemOperationCompleted); + } + this.InvokeAsync("DeleteItem", new object[] { + DeleteItem1}, this.DeleteItemOperationCompleted, userState); + } + + private void OnDeleteItemOperationCompleted(object arg) + { + if ((this.DeleteItemCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteItemCompleted(this, new DeleteItemCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/UpdateItem", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("UpdateItemResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public UpdateItemResponseType UpdateItem([System.Xml.Serialization.XmlElementAttribute("UpdateItem", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] UpdateItemType UpdateItem1) + { + object[] results = this.Invoke("UpdateItem", new object[] { + UpdateItem1}); + return ((UpdateItemResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginUpdateItem(UpdateItemType UpdateItem1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("UpdateItem", new object[] { + UpdateItem1}, callback, asyncState); + } + + /// + public UpdateItemResponseType EndUpdateItem(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((UpdateItemResponseType)(results[0])); + } + + /// + public void UpdateItemAsync(UpdateItemType UpdateItem1) + { + this.UpdateItemAsync(UpdateItem1, null); + } + + /// + public void UpdateItemAsync(UpdateItemType UpdateItem1, object userState) + { + if ((this.UpdateItemOperationCompleted == null)) + { + this.UpdateItemOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateItemOperationCompleted); + } + this.InvokeAsync("UpdateItem", new object[] { + UpdateItem1}, this.UpdateItemOperationCompleted, userState); + } + + private void OnUpdateItemOperationCompleted(object arg) + { + if ((this.UpdateItemCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateItemCompleted(this, new UpdateItemCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/SendItem", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("SendItemResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public SendItemResponseType SendItem([System.Xml.Serialization.XmlElementAttribute("SendItem", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] SendItemType SendItem1) + { + object[] results = this.Invoke("SendItem", new object[] { + SendItem1}); + return ((SendItemResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginSendItem(SendItemType SendItem1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("SendItem", new object[] { + SendItem1}, callback, asyncState); + } + + /// + public SendItemResponseType EndSendItem(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((SendItemResponseType)(results[0])); + } + + /// + public void SendItemAsync(SendItemType SendItem1) + { + this.SendItemAsync(SendItem1, null); + } + + /// + public void SendItemAsync(SendItemType SendItem1, object userState) + { + if ((this.SendItemOperationCompleted == null)) + { + this.SendItemOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendItemOperationCompleted); + } + this.InvokeAsync("SendItem", new object[] { + SendItem1}, this.SendItemOperationCompleted, userState); + } + + private void OnSendItemOperationCompleted(object arg) + { + if ((this.SendItemCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SendItemCompleted(this, new SendItemCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/MoveItem", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("MoveItemResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public MoveItemResponseType MoveItem([System.Xml.Serialization.XmlElementAttribute("MoveItem", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] MoveItemType MoveItem1) + { + object[] results = this.Invoke("MoveItem", new object[] { + MoveItem1}); + return ((MoveItemResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginMoveItem(MoveItemType MoveItem1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("MoveItem", new object[] { + MoveItem1}, callback, asyncState); + } + + /// + public MoveItemResponseType EndMoveItem(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((MoveItemResponseType)(results[0])); + } + + /// + public void MoveItemAsync(MoveItemType MoveItem1) + { + this.MoveItemAsync(MoveItem1, null); + } + + /// + public void MoveItemAsync(MoveItemType MoveItem1, object userState) + { + if ((this.MoveItemOperationCompleted == null)) + { + this.MoveItemOperationCompleted = new System.Threading.SendOrPostCallback(this.OnMoveItemOperationCompleted); + } + this.InvokeAsync("MoveItem", new object[] { + MoveItem1}, this.MoveItemOperationCompleted, userState); + } + + private void OnMoveItemOperationCompleted(object arg) + { + if ((this.MoveItemCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.MoveItemCompleted(this, new MoveItemCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/CopyItem", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("CopyItemResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public CopyItemResponseType CopyItem([System.Xml.Serialization.XmlElementAttribute("CopyItem", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] CopyItemType CopyItem1) + { + object[] results = this.Invoke("CopyItem", new object[] { + CopyItem1}); + return ((CopyItemResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginCopyItem(CopyItemType CopyItem1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("CopyItem", new object[] { + CopyItem1}, callback, asyncState); + } + + /// + public CopyItemResponseType EndCopyItem(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((CopyItemResponseType)(results[0])); + } + + /// + public void CopyItemAsync(CopyItemType CopyItem1) + { + this.CopyItemAsync(CopyItem1, null); + } + + /// + public void CopyItemAsync(CopyItemType CopyItem1, object userState) + { + if ((this.CopyItemOperationCompleted == null)) + { + this.CopyItemOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCopyItemOperationCompleted); + } + this.InvokeAsync("CopyItem", new object[] { + CopyItem1}, this.CopyItemOperationCompleted, userState); + } + + private void OnCopyItemOperationCompleted(object arg) + { + if ((this.CopyItemCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CopyItemCompleted(this, new CopyItemCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/CreateAttachment", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("CreateAttachmentResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public CreateAttachmentResponseType CreateAttachment([System.Xml.Serialization.XmlElementAttribute("CreateAttachment", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] CreateAttachmentType CreateAttachment1) + { + object[] results = this.Invoke("CreateAttachment", new object[] { + CreateAttachment1}); + return ((CreateAttachmentResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateAttachment(CreateAttachmentType CreateAttachment1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("CreateAttachment", new object[] { + CreateAttachment1}, callback, asyncState); + } + + /// + public CreateAttachmentResponseType EndCreateAttachment(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((CreateAttachmentResponseType)(results[0])); + } + + /// + public void CreateAttachmentAsync(CreateAttachmentType CreateAttachment1) + { + this.CreateAttachmentAsync(CreateAttachment1, null); + } + + /// + public void CreateAttachmentAsync(CreateAttachmentType CreateAttachment1, object userState) + { + if ((this.CreateAttachmentOperationCompleted == null)) + { + this.CreateAttachmentOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateAttachmentOperationCompleted); + } + this.InvokeAsync("CreateAttachment", new object[] { + CreateAttachment1}, this.CreateAttachmentOperationCompleted, userState); + } + + private void OnCreateAttachmentOperationCompleted(object arg) + { + if ((this.CreateAttachmentCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateAttachmentCompleted(this, new CreateAttachmentCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/DeleteAttachment", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("DeleteAttachmentResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public DeleteAttachmentResponseType DeleteAttachment([System.Xml.Serialization.XmlElementAttribute("DeleteAttachment", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] DeleteAttachmentType DeleteAttachment1) + { + object[] results = this.Invoke("DeleteAttachment", new object[] { + DeleteAttachment1}); + return ((DeleteAttachmentResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteAttachment(DeleteAttachmentType DeleteAttachment1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("DeleteAttachment", new object[] { + DeleteAttachment1}, callback, asyncState); + } + + /// + public DeleteAttachmentResponseType EndDeleteAttachment(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((DeleteAttachmentResponseType)(results[0])); + } + + /// + public void DeleteAttachmentAsync(DeleteAttachmentType DeleteAttachment1) + { + this.DeleteAttachmentAsync(DeleteAttachment1, null); + } + + /// + public void DeleteAttachmentAsync(DeleteAttachmentType DeleteAttachment1, object userState) + { + if ((this.DeleteAttachmentOperationCompleted == null)) + { + this.DeleteAttachmentOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteAttachmentOperationCompleted); + } + this.InvokeAsync("DeleteAttachment", new object[] { + DeleteAttachment1}, this.DeleteAttachmentOperationCompleted, userState); + } + + private void OnDeleteAttachmentOperationCompleted(object arg) + { + if ((this.DeleteAttachmentCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteAttachmentCompleted(this, new DeleteAttachmentCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/GetAttachment", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("GetAttachmentResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public GetAttachmentResponseType GetAttachment([System.Xml.Serialization.XmlElementAttribute("GetAttachment", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] GetAttachmentType GetAttachment1) + { + object[] results = this.Invoke("GetAttachment", new object[] { + GetAttachment1}); + return ((GetAttachmentResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginGetAttachment(GetAttachmentType GetAttachment1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetAttachment", new object[] { + GetAttachment1}, callback, asyncState); + } + + /// + public GetAttachmentResponseType EndGetAttachment(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((GetAttachmentResponseType)(results[0])); + } + + /// + public void GetAttachmentAsync(GetAttachmentType GetAttachment1) + { + this.GetAttachmentAsync(GetAttachment1, null); + } + + /// + public void GetAttachmentAsync(GetAttachmentType GetAttachment1, object userState) + { + if ((this.GetAttachmentOperationCompleted == null)) + { + this.GetAttachmentOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAttachmentOperationCompleted); + } + this.InvokeAsync("GetAttachment", new object[] { + GetAttachment1}, this.GetAttachmentOperationCompleted, userState); + } + + private void OnGetAttachmentOperationCompleted(object arg) + { + if ((this.GetAttachmentCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetAttachmentCompleted(this, new GetAttachmentCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/GetDelegate", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("GetDelegateResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public GetDelegateResponseMessageType GetDelegate([System.Xml.Serialization.XmlElementAttribute("GetDelegate", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] GetDelegateType GetDelegate1) + { + object[] results = this.Invoke("GetDelegate", new object[] { + GetDelegate1}); + return ((GetDelegateResponseMessageType)(results[0])); + } + + /// + public System.IAsyncResult BeginGetDelegate(GetDelegateType GetDelegate1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetDelegate", new object[] { + GetDelegate1}, callback, asyncState); + } + + /// + public GetDelegateResponseMessageType EndGetDelegate(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((GetDelegateResponseMessageType)(results[0])); + } + + /// + public void GetDelegateAsync(GetDelegateType GetDelegate1) + { + this.GetDelegateAsync(GetDelegate1, null); + } + + /// + public void GetDelegateAsync(GetDelegateType GetDelegate1, object userState) + { + if ((this.GetDelegateOperationCompleted == null)) + { + this.GetDelegateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDelegateOperationCompleted); + } + this.InvokeAsync("GetDelegate", new object[] { + GetDelegate1}, this.GetDelegateOperationCompleted, userState); + } + + private void OnGetDelegateOperationCompleted(object arg) + { + if ((this.GetDelegateCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetDelegateCompleted(this, new GetDelegateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/AddDelegate", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("AddDelegateResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public AddDelegateResponseMessageType AddDelegate([System.Xml.Serialization.XmlElementAttribute("AddDelegate", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] AddDelegateType AddDelegate1) + { + object[] results = this.Invoke("AddDelegate", new object[] { + AddDelegate1}); + return ((AddDelegateResponseMessageType)(results[0])); + } + + /// + public System.IAsyncResult BeginAddDelegate(AddDelegateType AddDelegate1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddDelegate", new object[] { + AddDelegate1}, callback, asyncState); + } + + /// + public AddDelegateResponseMessageType EndAddDelegate(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((AddDelegateResponseMessageType)(results[0])); + } + + /// + public void AddDelegateAsync(AddDelegateType AddDelegate1) + { + this.AddDelegateAsync(AddDelegate1, null); + } + + /// + public void AddDelegateAsync(AddDelegateType AddDelegate1, object userState) + { + if ((this.AddDelegateOperationCompleted == null)) + { + this.AddDelegateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddDelegateOperationCompleted); + } + this.InvokeAsync("AddDelegate", new object[] { + AddDelegate1}, this.AddDelegateOperationCompleted, userState); + } + + private void OnAddDelegateOperationCompleted(object arg) + { + if ((this.AddDelegateCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddDelegateCompleted(this, new AddDelegateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/RemoveDelegate", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("RemoveDelegateResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public RemoveDelegateResponseMessageType RemoveDelegate([System.Xml.Serialization.XmlElementAttribute("RemoveDelegate", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] RemoveDelegateType RemoveDelegate1) + { + object[] results = this.Invoke("RemoveDelegate", new object[] { + RemoveDelegate1}); + return ((RemoveDelegateResponseMessageType)(results[0])); + } + + /// + public System.IAsyncResult BeginRemoveDelegate(RemoveDelegateType RemoveDelegate1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("RemoveDelegate", new object[] { + RemoveDelegate1}, callback, asyncState); + } + + /// + public RemoveDelegateResponseMessageType EndRemoveDelegate(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((RemoveDelegateResponseMessageType)(results[0])); + } + + /// + public void RemoveDelegateAsync(RemoveDelegateType RemoveDelegate1) + { + this.RemoveDelegateAsync(RemoveDelegate1, null); + } + + /// + public void RemoveDelegateAsync(RemoveDelegateType RemoveDelegate1, object userState) + { + if ((this.RemoveDelegateOperationCompleted == null)) + { + this.RemoveDelegateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveDelegateOperationCompleted); + } + this.InvokeAsync("RemoveDelegate", new object[] { + RemoveDelegate1}, this.RemoveDelegateOperationCompleted, userState); + } + + private void OnRemoveDelegateOperationCompleted(object arg) + { + if ((this.RemoveDelegateCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveDelegateCompleted(this, new RemoveDelegateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("MailboxCulture")] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ExchangeImpersonation")] + [System.Web.Services.Protocols.SoapHeaderAttribute("RequestServerVersionValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/UpdateDelegate", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("UpdateDelegateResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public UpdateDelegateResponseMessageType UpdateDelegate([System.Xml.Serialization.XmlElementAttribute("UpdateDelegate", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] UpdateDelegateType UpdateDelegate1) + { + object[] results = this.Invoke("UpdateDelegate", new object[] { + UpdateDelegate1}); + return ((UpdateDelegateResponseMessageType)(results[0])); + } + + /// + public System.IAsyncResult BeginUpdateDelegate(UpdateDelegateType UpdateDelegate1, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("UpdateDelegate", new object[] { + UpdateDelegate1}, callback, asyncState); + } + + /// + public UpdateDelegateResponseMessageType EndUpdateDelegate(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((UpdateDelegateResponseMessageType)(results[0])); + } + + /// + public void UpdateDelegateAsync(UpdateDelegateType UpdateDelegate1) + { + this.UpdateDelegateAsync(UpdateDelegate1, null); + } + + /// + public void UpdateDelegateAsync(UpdateDelegateType UpdateDelegate1, object userState) + { + if ((this.UpdateDelegateOperationCompleted == null)) + { + this.UpdateDelegateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateDelegateOperationCompleted); + } + this.InvokeAsync("UpdateDelegate", new object[] { + UpdateDelegate1}, this.UpdateDelegateOperationCompleted, userState); + } + + private void OnUpdateDelegateOperationCompleted(object arg) + { + if ((this.UpdateDelegateCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateDelegateCompleted(this, new UpdateDelegateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapHeaderAttribute("SerializedSecurityContext")] + [System.Web.Services.Protocols.SoapHeaderAttribute("ProxyRequestTypeHeader")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/GetUserAvailability", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("GetUserAvailabilityResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public GetUserAvailabilityResponseType GetUserAvailability([System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] GetUserAvailabilityRequestType GetUserAvailabilityRequest) + { + object[] results = this.Invoke("GetUserAvailability", new object[] { + GetUserAvailabilityRequest}); + return ((GetUserAvailabilityResponseType)(results[0])); + } + + /// + public System.IAsyncResult BeginGetUserAvailability(GetUserAvailabilityRequestType GetUserAvailabilityRequest, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetUserAvailability", new object[] { + GetUserAvailabilityRequest}, callback, asyncState); + } + + /// + public GetUserAvailabilityResponseType EndGetUserAvailability(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((GetUserAvailabilityResponseType)(results[0])); + } + + /// + public void GetUserAvailabilityAsync(GetUserAvailabilityRequestType GetUserAvailabilityRequest) + { + this.GetUserAvailabilityAsync(GetUserAvailabilityRequest, null); + } + + /// + public void GetUserAvailabilityAsync(GetUserAvailabilityRequestType GetUserAvailabilityRequest, object userState) + { + if ((this.GetUserAvailabilityOperationCompleted == null)) + { + this.GetUserAvailabilityOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUserAvailabilityOperationCompleted); + } + this.InvokeAsync("GetUserAvailability", new object[] { + GetUserAvailabilityRequest}, this.GetUserAvailabilityOperationCompleted, userState); + } + + private void OnGetUserAvailabilityOperationCompleted(object arg) + { + if ((this.GetUserAvailabilityCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetUserAvailabilityCompleted(this, new GetUserAvailabilityCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/GetUserOofSettings", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("GetUserOofSettingsResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public GetUserOofSettingsResponse GetUserOofSettings([System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] GetUserOofSettingsRequest GetUserOofSettingsRequest) + { + object[] results = this.Invoke("GetUserOofSettings", new object[] { + GetUserOofSettingsRequest}); + return ((GetUserOofSettingsResponse)(results[0])); + } + + /// + public System.IAsyncResult BeginGetUserOofSettings(GetUserOofSettingsRequest GetUserOofSettingsRequest, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetUserOofSettings", new object[] { + GetUserOofSettingsRequest}, callback, asyncState); + } + + /// + public GetUserOofSettingsResponse EndGetUserOofSettings(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((GetUserOofSettingsResponse)(results[0])); + } + + /// + public void GetUserOofSettingsAsync(GetUserOofSettingsRequest GetUserOofSettingsRequest) + { + this.GetUserOofSettingsAsync(GetUserOofSettingsRequest, null); + } + + /// + public void GetUserOofSettingsAsync(GetUserOofSettingsRequest GetUserOofSettingsRequest, object userState) + { + if ((this.GetUserOofSettingsOperationCompleted == null)) + { + this.GetUserOofSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUserOofSettingsOperationCompleted); + } + this.InvokeAsync("GetUserOofSettings", new object[] { + GetUserOofSettingsRequest}, this.GetUserOofSettingsOperationCompleted, userState); + } + + private void OnGetUserOofSettingsOperationCompleted(object arg) + { + if ((this.GetUserOofSettingsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetUserOofSettingsCompleted(this, new GetUserOofSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServerVersionInfoValue", Direction = System.Web.Services.Protocols.SoapHeaderDirection.Out)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/exchange/services/2006/messages/SetUserOofSettings", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)] + [return: System.Xml.Serialization.XmlElementAttribute("SetUserOofSettingsResponse", Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public SetUserOofSettingsResponse SetUserOofSettings([System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] SetUserOofSettingsRequest SetUserOofSettingsRequest) + { + object[] results = this.Invoke("SetUserOofSettings", new object[] { + SetUserOofSettingsRequest}); + return ((SetUserOofSettingsResponse)(results[0])); + } + + /// + public System.IAsyncResult BeginSetUserOofSettings(SetUserOofSettingsRequest SetUserOofSettingsRequest, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("SetUserOofSettings", new object[] { + SetUserOofSettingsRequest}, callback, asyncState); + } + + /// + public SetUserOofSettingsResponse EndSetUserOofSettings(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((SetUserOofSettingsResponse)(results[0])); + } + + /// + public void SetUserOofSettingsAsync(SetUserOofSettingsRequest SetUserOofSettingsRequest) + { + this.SetUserOofSettingsAsync(SetUserOofSettingsRequest, null); + } + + /// + public void SetUserOofSettingsAsync(SetUserOofSettingsRequest SetUserOofSettingsRequest, object userState) + { + if ((this.SetUserOofSettingsOperationCompleted == null)) + { + this.SetUserOofSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserOofSettingsOperationCompleted); + } + this.InvokeAsync("SetUserOofSettings", new object[] { + SetUserOofSettingsRequest}, this.SetUserOofSettingsOperationCompleted, userState); + } + + private void OnSetUserOofSettingsOperationCompleted(object arg) + { + if ((this.SetUserOofSettingsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetUserOofSettingsCompleted(this, new SetUserOofSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) + { + base.CancelAsync(userState); + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public partial class ServerVersionInfo : System.Web.Services.Protocols.SoapHeader + { + + private int majorVersionField; + + private bool majorVersionFieldSpecified; + + private int minorVersionField; + + private bool minorVersionFieldSpecified; + + private int majorBuildNumberField; + + private bool majorBuildNumberFieldSpecified; + + private int minorBuildNumberField; + + private bool minorBuildNumberFieldSpecified; + + private string versionField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int MajorVersion + { + get + { + return this.majorVersionField; + } + set + { + this.majorVersionField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MajorVersionSpecified + { + get + { + return this.majorVersionFieldSpecified; + } + set + { + this.majorVersionFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int MinorVersion + { + get + { + return this.minorVersionField; + } + set + { + this.minorVersionField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MinorVersionSpecified + { + get + { + return this.minorVersionFieldSpecified; + } + set + { + this.minorVersionFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int MajorBuildNumber + { + get + { + return this.majorBuildNumberField; + } + set + { + this.majorBuildNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MajorBuildNumberSpecified + { + get + { + return this.majorBuildNumberFieldSpecified; + } + set + { + this.majorBuildNumberFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int MinorBuildNumber + { + get + { + return this.minorBuildNumberField; + } + set + { + this.minorBuildNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MinorBuildNumberSpecified + { + get + { + return this.minorBuildNumberFieldSpecified; + } + set + { + this.minorBuildNumberFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string Version + { + get + { + return this.versionField; + } + set + { + this.versionField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SetUserOofSettingsResponse + { + + private ResponseMessageType responseMessageField; + + /// + public ResponseMessageType ResponseMessage + { + get + { + return this.responseMessageField; + } + set + { + this.responseMessageField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseDelegateResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UpdateDelegateResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RemoveDelegateResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AddDelegateResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetDelegateResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DelegateUserResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConvertIdResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SyncFolderItemsResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SyncFolderHierarchyResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SendNotificationResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetEventsResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubscribeResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpandDLResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResolveNamesResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FindItemResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteAttachmentResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AttachmentInfoResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ItemInfoResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UpdateItemResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FindFolderResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FolderInfoResponseMessageType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class ResponseMessageType + { + + private string messageTextField; + + private ResponseCodeType responseCodeField; + + private bool responseCodeFieldSpecified; + + private int descriptiveLinkKeyField; + + private bool descriptiveLinkKeyFieldSpecified; + + private ResponseMessageTypeMessageXml messageXmlField; + + private ResponseClassType responseClassField; + + /// + public string MessageText + { + get + { + return this.messageTextField; + } + set + { + this.messageTextField = value; + } + } + + /// + public ResponseCodeType ResponseCode + { + get + { + return this.responseCodeField; + } + set + { + this.responseCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ResponseCodeSpecified + { + get + { + return this.responseCodeFieldSpecified; + } + set + { + this.responseCodeFieldSpecified = value; + } + } + + /// + public int DescriptiveLinkKey + { + get + { + return this.descriptiveLinkKeyField; + } + set + { + this.descriptiveLinkKeyField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DescriptiveLinkKeySpecified + { + get + { + return this.descriptiveLinkKeyFieldSpecified; + } + set + { + this.descriptiveLinkKeyFieldSpecified = value; + } + } + + /// + public ResponseMessageTypeMessageXml MessageXml + { + get + { + return this.messageXmlField; + } + set + { + this.messageXmlField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public ResponseClassType ResponseClass + { + get + { + return this.responseClassField; + } + set + { + this.responseClassField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public enum ResponseCodeType + { + + /// + NoError, + + /// + ErrorAccessDenied, + + /// + ErrorAccountDisabled, + + /// + ErrorAddDelegatesFailed, + + /// + ErrorAddressSpaceNotFound, + + /// + ErrorADOperation, + + /// + ErrorADSessionFilter, + + /// + ErrorADUnavailable, + + /// + ErrorAutoDiscoverFailed, + + /// + ErrorAffectedTaskOccurrencesRequired, + + /// + ErrorAttachmentSizeLimitExceeded, + + /// + ErrorAvailabilityConfigNotFound, + + /// + ErrorBatchProcessingStopped, + + /// + ErrorCalendarCannotMoveOrCopyOccurrence, + + /// + ErrorCalendarCannotUpdateDeletedItem, + + /// + ErrorCalendarCannotUseIdForOccurrenceId, + + /// + ErrorCalendarCannotUseIdForRecurringMasterId, + + /// + ErrorCalendarDurationIsTooLong, + + /// + ErrorCalendarEndDateIsEarlierThanStartDate, + + /// + ErrorCalendarFolderIsInvalidForCalendarView, + + /// + ErrorCalendarInvalidAttributeValue, + + /// + ErrorCalendarInvalidDayForTimeChangePattern, + + /// + ErrorCalendarInvalidDayForWeeklyRecurrence, + + /// + ErrorCalendarInvalidPropertyState, + + /// + ErrorCalendarInvalidPropertyValue, + + /// + ErrorCalendarInvalidRecurrence, + + /// + ErrorCalendarInvalidTimeZone, + + /// + ErrorCalendarIsDelegatedForAccept, + + /// + ErrorCalendarIsDelegatedForDecline, + + /// + ErrorCalendarIsDelegatedForRemove, + + /// + ErrorCalendarIsDelegatedForTentative, + + /// + ErrorCalendarIsNotOrganizer, + + /// + ErrorCalendarIsOrganizerForAccept, + + /// + ErrorCalendarIsOrganizerForDecline, + + /// + ErrorCalendarIsOrganizerForRemove, + + /// + ErrorCalendarIsOrganizerForTentative, + + /// + ErrorCalendarOccurrenceIndexIsOutOfRecurrenceRange, + + /// + ErrorCalendarOccurrenceIsDeletedFromRecurrence, + + /// + ErrorCalendarOutOfRange, + + /// + ErrorCalendarMeetingRequestIsOutOfDate, + + /// + ErrorCalendarViewRangeTooBig, + + /// + ErrorCannotCreateCalendarItemInNonCalendarFolder, + + /// + ErrorCannotCreateContactInNonContactFolder, + + /// + ErrorCannotCreatePostItemInNonMailFolder, + + /// + ErrorCannotCreateTaskInNonTaskFolder, + + /// + ErrorCannotDeleteObject, + + /// + ErrorCannotOpenFileAttachment, + + /// + ErrorCannotDeleteTaskOccurrence, + + /// + ErrorCannotSetCalendarPermissionOnNonCalendarFolder, + + /// + ErrorCannotSetNonCalendarPermissionOnCalendarFolder, + + /// + ErrorCannotSetPermissionUnknownEntries, + + /// + ErrorCannotUseFolderIdForItemId, + + /// + ErrorCannotUseItemIdForFolderId, + + /// + ErrorChangeKeyRequired, + + /// + ErrorChangeKeyRequiredForWriteOperations, + + /// + ErrorConnectionFailed, + + /// + ErrorContentConversionFailed, + + /// + ErrorCorruptData, + + /// + ErrorCreateItemAccessDenied, + + /// + ErrorCreateManagedFolderPartialCompletion, + + /// + ErrorCreateSubfolderAccessDenied, + + /// + ErrorCrossMailboxMoveCopy, + + /// + ErrorDataSizeLimitExceeded, + + /// + ErrorDataSourceOperation, + + /// + ErrorDelegateAlreadyExists, + + /// + ErrorDelegateCannotAddOwner, + + /// + ErrorDelegateMissingConfiguration, + + /// + ErrorDelegateNoUser, + + /// + ErrorDelegateValidationFailed, + + /// + ErrorDeleteDistinguishedFolder, + + /// + ErrorDeleteItemsFailed, + + /// + ErrorDistinguishedUserNotSupported, + + /// + ErrorDuplicateInputFolderNames, + + /// + ErrorDuplicateUserIdsSpecified, + + /// + ErrorEmailAddressMismatch, + + /// + ErrorEventNotFound, + + /// + ErrorExpiredSubscription, + + /// + ErrorFolderCorrupt, + + /// + ErrorFolderNotFound, + + /// + ErrorFolderPropertRequestFailed, + + /// + ErrorFolderSave, + + /// + ErrorFolderSaveFailed, + + /// + ErrorFolderSavePropertyError, + + /// + ErrorFolderExists, + + /// + ErrorFreeBusyGenerationFailed, + + /// + ErrorGetServerSecurityDescriptorFailed, + + /// + ErrorImpersonateUserDenied, + + /// + ErrorImpersonationDenied, + + /// + ErrorImpersonationFailed, + + /// + ErrorIncorrectSchemaVersion, + + /// + ErrorIncorrectUpdatePropertyCount, + + /// + ErrorIndividualMailboxLimitReached, + + /// + ErrorInsufficientResources, + + /// + ErrorInternalServerError, + + /// + ErrorInternalServerTransientError, + + /// + ErrorInvalidAccessLevel, + + /// + ErrorInvalidAttachmentId, + + /// + ErrorInvalidAttachmentSubfilter, + + /// + ErrorInvalidAttachmentSubfilterTextFilter, + + /// + ErrorInvalidAuthorizationContext, + + /// + ErrorInvalidChangeKey, + + /// + ErrorInvalidClientSecurityContext, + + /// + ErrorInvalidCompleteDate, + + /// + ErrorInvalidCrossForestCredentials, + + /// + ErrorInvalidDelegatePermission, + + /// + ErrorInvalidDelegateUserId, + + /// + ErrorInvalidExcludesRestriction, + + /// + ErrorInvalidExpressionTypeForSubFilter, + + /// + ErrorInvalidExtendedProperty, + + /// + ErrorInvalidExtendedPropertyValue, + + /// + ErrorInvalidFolderId, + + /// + ErrorInvalidFolderTypeForOperation, + + /// + ErrorInvalidFractionalPagingParameters, + + /// + ErrorInvalidFreeBusyViewType, + + /// + ErrorInvalidId, + + /// + ErrorInvalidIdEmpty, + + /// + ErrorInvalidIdMalformed, + + /// + ErrorInvalidIdMalformedEwsLegacyIdFormat, + + /// + ErrorInvalidIdMonikerTooLong, + + /// + ErrorInvalidIdNotAnItemAttachmentId, + + /// + ErrorInvalidIdReturnedByResolveNames, + + /// + ErrorInvalidIdStoreObjectIdTooLong, + + /// + ErrorInvalidIdTooManyAttachmentLevels, + + /// + ErrorInvalidIdXml, + + /// + ErrorInvalidIndexedPagingParameters, + + /// + ErrorInvalidInternetHeaderChildNodes, + + /// + ErrorInvalidItemForOperationCreateItemAttachment, + + /// + ErrorInvalidItemForOperationCreateItem, + + /// + ErrorInvalidItemForOperationAcceptItem, + + /// + ErrorInvalidItemForOperationDeclineItem, + + /// + ErrorInvalidItemForOperationCancelItem, + + /// + ErrorInvalidItemForOperationExpandDL, + + /// + ErrorInvalidItemForOperationRemoveItem, + + /// + ErrorInvalidItemForOperationSendItem, + + /// + ErrorInvalidItemForOperationTentative, + + /// + ErrorInvalidManagedFolderProperty, + + /// + ErrorInvalidManagedFolderQuota, + + /// + ErrorInvalidManagedFolderSize, + + /// + ErrorInvalidMergedFreeBusyInterval, + + /// + ErrorInvalidNameForNameResolution, + + /// + ErrorInvalidOperation, + + /// + ErrorInvalidNetworkServiceContext, + + /// + ErrorInvalidOofParameter, + + /// + ErrorInvalidPagingMaxRows, + + /// + ErrorInvalidParentFolder, + + /// + ErrorInvalidPercentCompleteValue, + + /// + ErrorInvalidPermissionSettings, + + /// + ErrorInvalidUserInfo, + + /// + ErrorInvalidPropertyAppend, + + /// + ErrorInvalidPropertyDelete, + + /// + ErrorInvalidPropertyForExists, + + /// + ErrorInvalidPropertyForOperation, + + /// + ErrorInvalidPropertyRequest, + + /// + ErrorInvalidPropertySet, + + /// + ErrorInvalidPropertyUpdateSentMessage, + + /// + ErrorInvalidProxySecurityContext, + + /// + ErrorInvalidPullSubscriptionId, + + /// + ErrorInvalidPushSubscriptionUrl, + + /// + ErrorInvalidRecipients, + + /// + ErrorInvalidRecipientSubfilter, + + /// + ErrorInvalidRecipientSubfilterComparison, + + /// + ErrorInvalidRecipientSubfilterOrder, + + /// + ErrorInvalidRecipientSubfilterTextFilter, + + /// + ErrorInvalidReferenceItem, + + /// + ErrorInvalidRequest, + + /// + ErrorInvalidRestriction, + + /// + ErrorInvalidRoutingType, + + /// + ErrorInvalidScheduledOofDuration, + + /// + ErrorInvalidSecurityDescriptor, + + /// + ErrorInvalidSendItemSaveSettings, + + /// + ErrorInvalidSerializedAccessToken, + + /// + ErrorInvalidServerVersion, + + /// + ErrorInvalidSid, + + /// + ErrorInvalidSmtpAddress, + + /// + ErrorInvalidSubfilterType, + + /// + ErrorInvalidSubfilterTypeNotAttendeeType, + + /// + ErrorInvalidSubfilterTypeNotRecipientType, + + /// + ErrorInvalidSubscription, + + /// + ErrorInvalidSubscriptionRequest, + + /// + ErrorInvalidSyncStateData, + + /// + ErrorInvalidTimeInterval, + + /// + ErrorInvalidUserOofSettings, + + /// + ErrorInvalidUserPrincipalName, + + /// + ErrorInvalidUserSid, + + /// + ErrorInvalidUserSidMissingUPN, + + /// + ErrorInvalidValueForProperty, + + /// + ErrorInvalidWatermark, + + /// + ErrorIrresolvableConflict, + + /// + ErrorItemCorrupt, + + /// + ErrorItemNotFound, + + /// + ErrorItemPropertyRequestFailed, + + /// + ErrorItemSave, + + /// + ErrorItemSavePropertyError, + + /// + ErrorLegacyMailboxFreeBusyViewTypeNotMerged, + + /// + ErrorLocalServerObjectNotFound, + + /// + ErrorLogonAsNetworkServiceFailed, + + /// + ErrorMailboxConfiguration, + + /// + ErrorMailboxDataArrayEmpty, + + /// + ErrorMailboxDataArrayTooBig, + + /// + ErrorMailboxLogonFailed, + + /// + ErrorMailboxMoveInProgress, + + /// + ErrorMailboxStoreUnavailable, + + /// + ErrorMailRecipientNotFound, + + /// + ErrorManagedFolderAlreadyExists, + + /// + ErrorManagedFolderNotFound, + + /// + ErrorManagedFoldersRootFailure, + + /// + ErrorMeetingSuggestionGenerationFailed, + + /// + ErrorMessageDispositionRequired, + + /// + ErrorMessageSizeExceeded, + + /// + ErrorMimeContentConversionFailed, + + /// + ErrorMimeContentInvalid, + + /// + ErrorMimeContentInvalidBase64String, + + /// + ErrorMissingArgument, + + /// + ErrorMissingEmailAddress, + + /// + ErrorMissingEmailAddressForManagedFolder, + + /// + ErrorMissingInformationEmailAddress, + + /// + ErrorMissingInformationReferenceItemId, + + /// + ErrorMissingItemForCreateItemAttachment, + + /// + ErrorMissingManagedFolderId, + + /// + ErrorMissingRecipients, + + /// + ErrorMissingUserIdInformation, + + /// + ErrorMoreThanOneAccessModeSpecified, + + /// + ErrorMoveCopyFailed, + + /// + ErrorMoveDistinguishedFolder, + + /// + ErrorNameResolutionMultipleResults, + + /// + ErrorNameResolutionNoMailbox, + + /// + ErrorNameResolutionNoResults, + + /// + ErrorNoCalendar, + + /// + ErrorNoDestinationCASDueToKerberosRequirements, + + /// + ErrorNoDestinationCASDueToSSLRequirements, + + /// + ErrorNoDestinationCASDueToVersionMismatch, + + /// + ErrorNoFolderClassOverride, + + /// + ErrorNoFreeBusyAccess, + + /// + ErrorNonExistentMailbox, + + /// + ErrorNonPrimarySmtpAddress, + + /// + ErrorNoPropertyTagForCustomProperties, + + /// + ErrorNoPublicFolderReplicaAvailable, + + /// + ErrorNoRespondingCASInDestinationSite, + + /// + ErrorNotDelegate, + + /// + ErrorNotEnoughMemory, + + /// + ErrorObjectTypeChanged, + + /// + ErrorOccurrenceCrossingBoundary, + + /// + ErrorOccurrenceTimeSpanTooBig, + + /// + ErrorOperationNotAllowedWithPublicFolderRoot, + + /// + ErrorParentFolderIdRequired, + + /// + ErrorParentFolderNotFound, + + /// + ErrorPasswordChangeRequired, + + /// + ErrorPasswordExpired, + + /// + ErrorPropertyUpdate, + + /// + ErrorPropertyValidationFailure, + + /// + ErrorProxiedSubscriptionCallFailure, + + /// + ErrorProxyCallFailed, + + /// + ErrorProxyGroupSidLimitExceeded, + + /// + ErrorProxyRequestNotAllowed, + + /// + ErrorProxyRequestProcessingFailed, + + /// + ErrorProxyTokenExpired, + + /// + ErrorPublicFolderRequestProcessingFailed, + + /// + ErrorPublicFolderServerNotFound, + + /// + ErrorQueryFilterTooLong, + + /// + ErrorQuotaExceeded, + + /// + ErrorReadEventsFailed, + + /// + ErrorReadReceiptNotPending, + + /// + ErrorRecurrenceEndDateTooBig, + + /// + ErrorRecurrenceHasNoOccurrence, + + /// + ErrorRemoveDelegatesFailed, + + /// + ErrorRequestAborted, + + /// + ErrorRequestStreamTooBig, + + /// + ErrorRequiredPropertyMissing, + + /// + ErrorResolveNamesInvalidFolderType, + + /// + ErrorResolveNamesOnlyOneContactsFolderAllowed, + + /// + ErrorResponseSchemaValidation, + + /// + ErrorRestrictionTooLong, + + /// + ErrorRestrictionTooComplex, + + /// + ErrorResultSetTooBig, + + /// + ErrorInvalidExchangeImpersonationHeaderData, + + /// + ErrorSavedItemFolderNotFound, + + /// + ErrorSchemaValidation, + + /// + ErrorSearchFolderNotInitialized, + + /// + ErrorSendAsDenied, + + /// + ErrorSendMeetingCancellationsRequired, + + /// + ErrorSendMeetingInvitationsOrCancellationsRequired, + + /// + ErrorSendMeetingInvitationsRequired, + + /// + ErrorSentMeetingRequestUpdate, + + /// + ErrorSentTaskRequestUpdate, + + /// + ErrorServerBusy, + + /// + ErrorServiceDiscoveryFailed, + + /// + ErrorStaleObject, + + /// + ErrorSubscriptionAccessDenied, + + /// + ErrorSubscriptionDelegateAccessNotSupported, + + /// + ErrorSubscriptionNotFound, + + /// + ErrorSyncFolderNotFound, + + /// + ErrorTimeIntervalTooBig, + + /// + ErrorTimeoutExpired, + + /// + ErrorToFolderNotFound, + + /// + ErrorTokenSerializationDenied, + + /// + ErrorUpdatePropertyMismatch, + + /// + ErrorUnableToGetUserOofSettings, + + /// + ErrorUnsupportedSubFilter, + + /// + ErrorUnsupportedCulture, + + /// + ErrorUnsupportedMapiPropertyType, + + /// + ErrorUnsupportedMimeConversion, + + /// + ErrorUnsupportedPathForQuery, + + /// + ErrorUnsupportedPathForSortGroup, + + /// + ErrorUnsupportedPropertyDefinition, + + /// + ErrorUnsupportedQueryFilter, + + /// + ErrorUnsupportedRecurrence, + + /// + ErrorUnsupportedTypeForConversion, + + /// + ErrorUpdateDelegatesFailed, + + /// + ErrorVoiceMailNotImplemented, + + /// + ErrorVirusDetected, + + /// + ErrorVirusMessageDeleted, + + /// + ErrorWebRequestInInvalidState, + + /// + ErrorWin32InteropError, + + /// + ErrorWorkingHoursSaveFailed, + + /// + ErrorWorkingHoursXmlMalformed, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class ResponseMessageTypeMessageXml + { + + private System.Xml.XmlElement[] anyField; + + /// + [System.Xml.Serialization.XmlAnyElementAttribute()] + public System.Xml.XmlElement[] Any + { + get + { + return this.anyField; + } + set + { + this.anyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum ResponseClassType + { + + /// + Success, + + /// + Warning, + + /// + Error, + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UpdateDelegateResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RemoveDelegateResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AddDelegateResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetDelegateResponseMessageType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public abstract partial class BaseDelegateResponseMessageType : ResponseMessageType + { + + private DelegateUserResponseMessageType[] responseMessagesField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable = false)] + public DelegateUserResponseMessageType[] ResponseMessages + { + get + { + return this.responseMessagesField; + } + set + { + this.responseMessagesField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class DelegateUserResponseMessageType : ResponseMessageType + { + + private DelegateUserType delegateUserField; + + /// + public DelegateUserType DelegateUser + { + get + { + return this.delegateUserField; + } + set + { + this.delegateUserField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class DelegateUserType + { + + private UserIdType userIdField; + + private DelegatePermissionsType delegatePermissionsField; + + private bool receiveCopiesOfMeetingMessagesField; + + private bool receiveCopiesOfMeetingMessagesFieldSpecified; + + private bool viewPrivateItemsField; + + private bool viewPrivateItemsFieldSpecified; + + /// + public UserIdType UserId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + + /// + public DelegatePermissionsType DelegatePermissions + { + get + { + return this.delegatePermissionsField; + } + set + { + this.delegatePermissionsField = value; + } + } + + /// + public bool ReceiveCopiesOfMeetingMessages + { + get + { + return this.receiveCopiesOfMeetingMessagesField; + } + set + { + this.receiveCopiesOfMeetingMessagesField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ReceiveCopiesOfMeetingMessagesSpecified + { + get + { + return this.receiveCopiesOfMeetingMessagesFieldSpecified; + } + set + { + this.receiveCopiesOfMeetingMessagesFieldSpecified = value; + } + } + + /// + public bool ViewPrivateItems + { + get + { + return this.viewPrivateItemsField; + } + set + { + this.viewPrivateItemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ViewPrivateItemsSpecified + { + get + { + return this.viewPrivateItemsFieldSpecified; + } + set + { + this.viewPrivateItemsFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class UserIdType + { + + private string sIDField; + + private string primarySmtpAddressField; + + private string displayNameField; + + private DistinguishedUserType distinguishedUserField; + + private bool distinguishedUserFieldSpecified; + + /// + public string SID + { + get + { + return this.sIDField; + } + set + { + this.sIDField = value; + } + } + + /// + public string PrimarySmtpAddress + { + get + { + return this.primarySmtpAddressField; + } + set + { + this.primarySmtpAddressField = value; + } + } + + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameField = value; + } + } + + /// + public DistinguishedUserType DistinguishedUser + { + get + { + return this.distinguishedUserField; + } + set + { + this.distinguishedUserField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DistinguishedUserSpecified + { + get + { + return this.distinguishedUserFieldSpecified; + } + set + { + this.distinguishedUserFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum DistinguishedUserType + { + + /// + Default, + + /// + Anonymous, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class DelegatePermissionsType + { + + private DelegateFolderPermissionLevelType calendarFolderPermissionLevelField; + + private bool calendarFolderPermissionLevelFieldSpecified; + + private DelegateFolderPermissionLevelType tasksFolderPermissionLevelField; + + private bool tasksFolderPermissionLevelFieldSpecified; + + private DelegateFolderPermissionLevelType inboxFolderPermissionLevelField; + + private bool inboxFolderPermissionLevelFieldSpecified; + + private DelegateFolderPermissionLevelType contactsFolderPermissionLevelField; + + private bool contactsFolderPermissionLevelFieldSpecified; + + private DelegateFolderPermissionLevelType notesFolderPermissionLevelField; + + private bool notesFolderPermissionLevelFieldSpecified; + + private DelegateFolderPermissionLevelType journalFolderPermissionLevelField; + + private bool journalFolderPermissionLevelFieldSpecified; + + /// + public DelegateFolderPermissionLevelType CalendarFolderPermissionLevel + { + get + { + return this.calendarFolderPermissionLevelField; + } + set + { + this.calendarFolderPermissionLevelField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool CalendarFolderPermissionLevelSpecified + { + get + { + return this.calendarFolderPermissionLevelFieldSpecified; + } + set + { + this.calendarFolderPermissionLevelFieldSpecified = value; + } + } + + /// + public DelegateFolderPermissionLevelType TasksFolderPermissionLevel + { + get + { + return this.tasksFolderPermissionLevelField; + } + set + { + this.tasksFolderPermissionLevelField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool TasksFolderPermissionLevelSpecified + { + get + { + return this.tasksFolderPermissionLevelFieldSpecified; + } + set + { + this.tasksFolderPermissionLevelFieldSpecified = value; + } + } + + /// + public DelegateFolderPermissionLevelType InboxFolderPermissionLevel + { + get + { + return this.inboxFolderPermissionLevelField; + } + set + { + this.inboxFolderPermissionLevelField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool InboxFolderPermissionLevelSpecified + { + get + { + return this.inboxFolderPermissionLevelFieldSpecified; + } + set + { + this.inboxFolderPermissionLevelFieldSpecified = value; + } + } + + /// + public DelegateFolderPermissionLevelType ContactsFolderPermissionLevel + { + get + { + return this.contactsFolderPermissionLevelField; + } + set + { + this.contactsFolderPermissionLevelField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ContactsFolderPermissionLevelSpecified + { + get + { + return this.contactsFolderPermissionLevelFieldSpecified; + } + set + { + this.contactsFolderPermissionLevelFieldSpecified = value; + } + } + + /// + public DelegateFolderPermissionLevelType NotesFolderPermissionLevel + { + get + { + return this.notesFolderPermissionLevelField; + } + set + { + this.notesFolderPermissionLevelField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool NotesFolderPermissionLevelSpecified + { + get + { + return this.notesFolderPermissionLevelFieldSpecified; + } + set + { + this.notesFolderPermissionLevelFieldSpecified = value; + } + } + + /// + public DelegateFolderPermissionLevelType JournalFolderPermissionLevel + { + get + { + return this.journalFolderPermissionLevelField; + } + set + { + this.journalFolderPermissionLevelField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool JournalFolderPermissionLevelSpecified + { + get + { + return this.journalFolderPermissionLevelFieldSpecified; + } + set + { + this.journalFolderPermissionLevelFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum DelegateFolderPermissionLevelType + { + + /// + None, + + /// + Editor, + + /// + Reviewer, + + /// + Author, + + /// + Custom, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class UpdateDelegateResponseMessageType : BaseDelegateResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class RemoveDelegateResponseMessageType : BaseDelegateResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class AddDelegateResponseMessageType : BaseDelegateResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetDelegateResponseMessageType : BaseDelegateResponseMessageType + { + + private DeliverMeetingRequestsType deliverMeetingRequestsField; + + private bool deliverMeetingRequestsFieldSpecified; + + /// + public DeliverMeetingRequestsType DeliverMeetingRequests + { + get + { + return this.deliverMeetingRequestsField; + } + set + { + this.deliverMeetingRequestsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DeliverMeetingRequestsSpecified + { + get + { + return this.deliverMeetingRequestsFieldSpecified; + } + set + { + this.deliverMeetingRequestsFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum DeliverMeetingRequestsType + { + + /// + DelegatesOnly, + + /// + DelegatesAndMe, + + /// + DelegatesAndSendInformationToMe, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class ConvertIdResponseMessageType : ResponseMessageType + { + + private AlternateIdBaseType alternateIdField; + + /// + public AlternateIdBaseType AlternateId + { + get + { + return this.alternateIdField; + } + set + { + this.alternateIdField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlternatePublicFolderIdType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlternatePublicFolderItemIdType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlternateIdType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class AlternateIdBaseType + { + + private IdFormatType formatField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public IdFormatType Format + { + get + { + return this.formatField; + } + set + { + this.formatField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum IdFormatType + { + + /// + EwsLegacyId, + + /// + EwsId, + + /// + EntryId, + + /// + HexEntryId, + + /// + StoreId, + + /// + OwaId, + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AlternatePublicFolderItemIdType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class AlternatePublicFolderIdType : AlternateIdBaseType + { + + private string folderIdField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string FolderId + { + get + { + return this.folderIdField; + } + set + { + this.folderIdField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class AlternatePublicFolderItemIdType : AlternatePublicFolderIdType + { + + private string itemIdField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string ItemId + { + get + { + return this.itemIdField; + } + set + { + this.itemIdField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class AlternateIdType : AlternateIdBaseType + { + + private string idField; + + private string mailboxField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string Id + { + get + { + return this.idField; + } + set + { + this.idField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string Mailbox + { + get + { + return this.mailboxField; + } + set + { + this.mailboxField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SyncFolderItemsResponseMessageType : ResponseMessageType + { + + private string syncStateField; + + private bool includesLastItemInRangeField; + + private bool includesLastItemInRangeFieldSpecified; + + private SyncFolderItemsChangesType changesField; + + /// + public string SyncState + { + get + { + return this.syncStateField; + } + set + { + this.syncStateField = value; + } + } + + /// + public bool IncludesLastItemInRange + { + get + { + return this.includesLastItemInRangeField; + } + set + { + this.includesLastItemInRangeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IncludesLastItemInRangeSpecified + { + get + { + return this.includesLastItemInRangeFieldSpecified; + } + set + { + this.includesLastItemInRangeFieldSpecified = value; + } + } + + /// + public SyncFolderItemsChangesType Changes + { + get + { + return this.changesField; + } + set + { + this.changesField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SyncFolderItemsChangesType + { + + private object[] itemsField; + + private ItemsChoiceType2[] itemsElementNameField; + + /// + [System.Xml.Serialization.XmlElementAttribute("Create", typeof(SyncFolderItemsCreateOrUpdateType))] + [System.Xml.Serialization.XmlElementAttribute("Delete", typeof(SyncFolderItemsDeleteType))] + [System.Xml.Serialization.XmlElementAttribute("ReadFlagChange", typeof(SyncFolderItemsReadFlagType))] + [System.Xml.Serialization.XmlElementAttribute("Update", typeof(SyncFolderItemsCreateOrUpdateType))] + [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")] + public object[] Items + { + get + { + return this.itemsField; + } + set + { + this.itemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("ItemsElementName")] + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ItemsChoiceType2[] ItemsElementName + { + get + { + return this.itemsElementNameField; + } + set + { + this.itemsElementNameField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SyncFolderItemsCreateOrUpdateType + { + + private ItemType itemField; + + /// + [System.Xml.Serialization.XmlElementAttribute("CalendarItem", typeof(CalendarItemType))] + [System.Xml.Serialization.XmlElementAttribute("Contact", typeof(ContactItemType))] + [System.Xml.Serialization.XmlElementAttribute("DistributionList", typeof(DistributionListType))] + [System.Xml.Serialization.XmlElementAttribute("Item", typeof(ItemType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingCancellation", typeof(MeetingCancellationMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingMessage", typeof(MeetingMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingRequest", typeof(MeetingRequestMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingResponse", typeof(MeetingResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("Message", typeof(MessageType))] + [System.Xml.Serialization.XmlElementAttribute("PostItem", typeof(PostItemType))] + [System.Xml.Serialization.XmlElementAttribute("Task", typeof(TaskType))] + public ItemType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class CalendarItemType : ItemType + { + + private string uIDField; + + private System.DateTime recurrenceIdField; + + private bool recurrenceIdFieldSpecified; + + private System.DateTime dateTimeStampField; + + private bool dateTimeStampFieldSpecified; + + private System.DateTime startField; + + private bool startFieldSpecified; + + private System.DateTime endField; + + private bool endFieldSpecified; + + private System.DateTime originalStartField; + + private bool originalStartFieldSpecified; + + private bool isAllDayEventField; + + private bool isAllDayEventFieldSpecified; + + private LegacyFreeBusyType legacyFreeBusyStatusField; + + private bool legacyFreeBusyStatusFieldSpecified; + + private string locationField; + + private string whenField; + + private bool isMeetingField; + + private bool isMeetingFieldSpecified; + + private bool isCancelledField; + + private bool isCancelledFieldSpecified; + + private bool isRecurringField; + + private bool isRecurringFieldSpecified; + + private bool meetingRequestWasSentField; + + private bool meetingRequestWasSentFieldSpecified; + + private bool isResponseRequestedField; + + private bool isResponseRequestedFieldSpecified; + + private CalendarItemTypeType calendarItemType1Field; + + private bool calendarItemType1FieldSpecified; + + private ResponseTypeType myResponseTypeField; + + private bool myResponseTypeFieldSpecified; + + private SingleRecipientType organizerField; + + private AttendeeType[] requiredAttendeesField; + + private AttendeeType[] optionalAttendeesField; + + private AttendeeType[] resourcesField; + + private int conflictingMeetingCountField; + + private bool conflictingMeetingCountFieldSpecified; + + private int adjacentMeetingCountField; + + private bool adjacentMeetingCountFieldSpecified; + + private NonEmptyArrayOfAllItemsType conflictingMeetingsField; + + private NonEmptyArrayOfAllItemsType adjacentMeetingsField; + + private string durationField; + + private string timeZoneField; + + private System.DateTime appointmentReplyTimeField; + + private bool appointmentReplyTimeFieldSpecified; + + private int appointmentSequenceNumberField; + + private bool appointmentSequenceNumberFieldSpecified; + + private int appointmentStateField; + + private bool appointmentStateFieldSpecified; + + private RecurrenceType recurrenceField; + + private OccurrenceInfoType firstOccurrenceField; + + private OccurrenceInfoType lastOccurrenceField; + + private OccurrenceInfoType[] modifiedOccurrencesField; + + private DeletedOccurrenceInfoType[] deletedOccurrencesField; + + private TimeZoneType meetingTimeZoneField; + + private int conferenceTypeField; + + private bool conferenceTypeFieldSpecified; + + private bool allowNewTimeProposalField; + + private bool allowNewTimeProposalFieldSpecified; + + private bool isOnlineMeetingField; + + private bool isOnlineMeetingFieldSpecified; + + private string meetingWorkspaceUrlField; + + private string netShowUrlField; + + /// + public string UID + { + get + { + return this.uIDField; + } + set + { + this.uIDField = value; + } + } + + /// + public System.DateTime RecurrenceId + { + get + { + return this.recurrenceIdField; + } + set + { + this.recurrenceIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool RecurrenceIdSpecified + { + get + { + return this.recurrenceIdFieldSpecified; + } + set + { + this.recurrenceIdFieldSpecified = value; + } + } + + /// + public System.DateTime DateTimeStamp + { + get + { + return this.dateTimeStampField; + } + set + { + this.dateTimeStampField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DateTimeStampSpecified + { + get + { + return this.dateTimeStampFieldSpecified; + } + set + { + this.dateTimeStampFieldSpecified = value; + } + } + + /// + public System.DateTime Start + { + get + { + return this.startField; + } + set + { + this.startField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool StartSpecified + { + get + { + return this.startFieldSpecified; + } + set + { + this.startFieldSpecified = value; + } + } + + /// + public System.DateTime End + { + get + { + return this.endField; + } + set + { + this.endField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool EndSpecified + { + get + { + return this.endFieldSpecified; + } + set + { + this.endFieldSpecified = value; + } + } + + /// + public System.DateTime OriginalStart + { + get + { + return this.originalStartField; + } + set + { + this.originalStartField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool OriginalStartSpecified + { + get + { + return this.originalStartFieldSpecified; + } + set + { + this.originalStartFieldSpecified = value; + } + } + + /// + public bool IsAllDayEvent + { + get + { + return this.isAllDayEventField; + } + set + { + this.isAllDayEventField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsAllDayEventSpecified + { + get + { + return this.isAllDayEventFieldSpecified; + } + set + { + this.isAllDayEventFieldSpecified = value; + } + } + + /// + public LegacyFreeBusyType LegacyFreeBusyStatus + { + get + { + return this.legacyFreeBusyStatusField; + } + set + { + this.legacyFreeBusyStatusField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool LegacyFreeBusyStatusSpecified + { + get + { + return this.legacyFreeBusyStatusFieldSpecified; + } + set + { + this.legacyFreeBusyStatusFieldSpecified = value; + } + } + + /// + public string Location + { + get + { + return this.locationField; + } + set + { + this.locationField = value; + } + } + + /// + public string When + { + get + { + return this.whenField; + } + set + { + this.whenField = value; + } + } + + /// + public bool IsMeeting + { + get + { + return this.isMeetingField; + } + set + { + this.isMeetingField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsMeetingSpecified + { + get + { + return this.isMeetingFieldSpecified; + } + set + { + this.isMeetingFieldSpecified = value; + } + } + + /// + public bool IsCancelled + { + get + { + return this.isCancelledField; + } + set + { + this.isCancelledField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsCancelledSpecified + { + get + { + return this.isCancelledFieldSpecified; + } + set + { + this.isCancelledFieldSpecified = value; + } + } + + /// + public bool IsRecurring + { + get + { + return this.isRecurringField; + } + set + { + this.isRecurringField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsRecurringSpecified + { + get + { + return this.isRecurringFieldSpecified; + } + set + { + this.isRecurringFieldSpecified = value; + } + } + + /// + public bool MeetingRequestWasSent + { + get + { + return this.meetingRequestWasSentField; + } + set + { + this.meetingRequestWasSentField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MeetingRequestWasSentSpecified + { + get + { + return this.meetingRequestWasSentFieldSpecified; + } + set + { + this.meetingRequestWasSentFieldSpecified = value; + } + } + + /// + public bool IsResponseRequested + { + get + { + return this.isResponseRequestedField; + } + set + { + this.isResponseRequestedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsResponseRequestedSpecified + { + get + { + return this.isResponseRequestedFieldSpecified; + } + set + { + this.isResponseRequestedFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("CalendarItemType")] + public CalendarItemTypeType CalendarItemType1 + { + get + { + return this.calendarItemType1Field; + } + set + { + this.calendarItemType1Field = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool CalendarItemType1Specified + { + get + { + return this.calendarItemType1FieldSpecified; + } + set + { + this.calendarItemType1FieldSpecified = value; + } + } + + /// + public ResponseTypeType MyResponseType + { + get + { + return this.myResponseTypeField; + } + set + { + this.myResponseTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MyResponseTypeSpecified + { + get + { + return this.myResponseTypeFieldSpecified; + } + set + { + this.myResponseTypeFieldSpecified = value; + } + } + + /// + public SingleRecipientType Organizer + { + get + { + return this.organizerField; + } + set + { + this.organizerField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Attendee", IsNullable = false)] + public AttendeeType[] RequiredAttendees + { + get + { + return this.requiredAttendeesField; + } + set + { + this.requiredAttendeesField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Attendee", IsNullable = false)] + public AttendeeType[] OptionalAttendees + { + get + { + return this.optionalAttendeesField; + } + set + { + this.optionalAttendeesField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Attendee", IsNullable = false)] + public AttendeeType[] Resources + { + get + { + return this.resourcesField; + } + set + { + this.resourcesField = value; + } + } + + /// + public int ConflictingMeetingCount + { + get + { + return this.conflictingMeetingCountField; + } + set + { + this.conflictingMeetingCountField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ConflictingMeetingCountSpecified + { + get + { + return this.conflictingMeetingCountFieldSpecified; + } + set + { + this.conflictingMeetingCountFieldSpecified = value; + } + } + + /// + public int AdjacentMeetingCount + { + get + { + return this.adjacentMeetingCountField; + } + set + { + this.adjacentMeetingCountField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AdjacentMeetingCountSpecified + { + get + { + return this.adjacentMeetingCountFieldSpecified; + } + set + { + this.adjacentMeetingCountFieldSpecified = value; + } + } + + /// + public NonEmptyArrayOfAllItemsType ConflictingMeetings + { + get + { + return this.conflictingMeetingsField; + } + set + { + this.conflictingMeetingsField = value; + } + } + + /// + public NonEmptyArrayOfAllItemsType AdjacentMeetings + { + get + { + return this.adjacentMeetingsField; + } + set + { + this.adjacentMeetingsField = value; + } + } + + /// + public string Duration + { + get + { + return this.durationField; + } + set + { + this.durationField = value; + } + } + + /// + public string TimeZone + { + get + { + return this.timeZoneField; + } + set + { + this.timeZoneField = value; + } + } + + /// + public System.DateTime AppointmentReplyTime + { + get + { + return this.appointmentReplyTimeField; + } + set + { + this.appointmentReplyTimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AppointmentReplyTimeSpecified + { + get + { + return this.appointmentReplyTimeFieldSpecified; + } + set + { + this.appointmentReplyTimeFieldSpecified = value; + } + } + + /// + public int AppointmentSequenceNumber + { + get + { + return this.appointmentSequenceNumberField; + } + set + { + this.appointmentSequenceNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AppointmentSequenceNumberSpecified + { + get + { + return this.appointmentSequenceNumberFieldSpecified; + } + set + { + this.appointmentSequenceNumberFieldSpecified = value; + } + } + + /// + public int AppointmentState + { + get + { + return this.appointmentStateField; + } + set + { + this.appointmentStateField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AppointmentStateSpecified + { + get + { + return this.appointmentStateFieldSpecified; + } + set + { + this.appointmentStateFieldSpecified = value; + } + } + + /// + public RecurrenceType Recurrence + { + get + { + return this.recurrenceField; + } + set + { + this.recurrenceField = value; + } + } + + /// + public OccurrenceInfoType FirstOccurrence + { + get + { + return this.firstOccurrenceField; + } + set + { + this.firstOccurrenceField = value; + } + } + + /// + public OccurrenceInfoType LastOccurrence + { + get + { + return this.lastOccurrenceField; + } + set + { + this.lastOccurrenceField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Occurrence", IsNullable = false)] + public OccurrenceInfoType[] ModifiedOccurrences + { + get + { + return this.modifiedOccurrencesField; + } + set + { + this.modifiedOccurrencesField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("DeletedOccurrence", IsNullable = false)] + public DeletedOccurrenceInfoType[] DeletedOccurrences + { + get + { + return this.deletedOccurrencesField; + } + set + { + this.deletedOccurrencesField = value; + } + } + + /// + public TimeZoneType MeetingTimeZone + { + get + { + return this.meetingTimeZoneField; + } + set + { + this.meetingTimeZoneField = value; + } + } + + /// + public int ConferenceType + { + get + { + return this.conferenceTypeField; + } + set + { + this.conferenceTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ConferenceTypeSpecified + { + get + { + return this.conferenceTypeFieldSpecified; + } + set + { + this.conferenceTypeFieldSpecified = value; + } + } + + /// + public bool AllowNewTimeProposal + { + get + { + return this.allowNewTimeProposalField; + } + set + { + this.allowNewTimeProposalField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AllowNewTimeProposalSpecified + { + get + { + return this.allowNewTimeProposalFieldSpecified; + } + set + { + this.allowNewTimeProposalFieldSpecified = value; + } + } + + /// + public bool IsOnlineMeeting + { + get + { + return this.isOnlineMeetingField; + } + set + { + this.isOnlineMeetingField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsOnlineMeetingSpecified + { + get + { + return this.isOnlineMeetingFieldSpecified; + } + set + { + this.isOnlineMeetingFieldSpecified = value; + } + } + + /// + public string MeetingWorkspaceUrl + { + get + { + return this.meetingWorkspaceUrlField; + } + set + { + this.meetingWorkspaceUrlField = value; + } + } + + /// + public string NetShowUrl + { + get + { + return this.netShowUrlField; + } + set + { + this.netShowUrlField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum LegacyFreeBusyType + { + + /// + Free, + + /// + Tentative, + + /// + Busy, + + /// + OOF, + + /// + NoData, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum CalendarItemTypeType + { + + /// + Single, + + /// + Occurrence, + + /// + Exception, + + /// + RecurringMaster, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum ResponseTypeType + { + + /// + Unknown, + + /// + Organizer, + + /// + Tentative, + + /// + Accept, + + /// + Decline, + + /// + NoResponseReceived, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SingleRecipientType + { + + private EmailAddressType itemField; + + /// + [System.Xml.Serialization.XmlElementAttribute("Mailbox")] + public EmailAddressType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class EmailAddressType : BaseEmailAddressType + { + + private string nameField; + + private string emailAddressField; + + private string routingTypeField; + + private MailboxTypeType mailboxTypeField; + + private bool mailboxTypeFieldSpecified; + + private ItemIdType itemIdField; + + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameField = value; + } + } + + /// + public string EmailAddress + { + get + { + return this.emailAddressField; + } + set + { + this.emailAddressField = value; + } + } + + /// + public string RoutingType + { + get + { + return this.routingTypeField; + } + set + { + this.routingTypeField = value; + } + } + + /// + public MailboxTypeType MailboxType + { + get + { + return this.mailboxTypeField; + } + set + { + this.mailboxTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MailboxTypeSpecified + { + get + { + return this.mailboxTypeFieldSpecified; + } + set + { + this.mailboxTypeFieldSpecified = value; + } + } + + /// + public ItemIdType ItemId + { + get + { + return this.itemIdField; + } + set + { + this.itemIdField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum MailboxTypeType + { + + /// + Mailbox, + + /// + PublicDL, + + /// + PrivateDL, + + /// + Contact, + + /// + PublicFolder, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ItemIdType : BaseItemIdType + { + + private string idField; + + private string changeKeyField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string Id + { + get + { + return this.idField; + } + set + { + this.idField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string ChangeKey + { + get + { + return this.changeKeyField; + } + set + { + this.changeKeyField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RecurringMasterItemIdType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OccurrenceItemIdType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ItemIdType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RootItemIdType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RequestAttachmentIdType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AttachmentIdType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class BaseItemIdType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class RecurringMasterItemIdType : BaseItemIdType + { + + private string occurrenceIdField; + + private string changeKeyField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string OccurrenceId + { + get + { + return this.occurrenceIdField; + } + set + { + this.occurrenceIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string ChangeKey + { + get + { + return this.changeKeyField; + } + set + { + this.changeKeyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class OccurrenceItemIdType : BaseItemIdType + { + + private string recurringMasterIdField; + + private string changeKeyField; + + private int instanceIndexField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string RecurringMasterId + { + get + { + return this.recurringMasterIdField; + } + set + { + this.recurringMasterIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string ChangeKey + { + get + { + return this.changeKeyField; + } + set + { + this.changeKeyField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int InstanceIndex + { + get + { + return this.instanceIndexField; + } + set + { + this.instanceIndexField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class RootItemIdType : BaseItemIdType + { + + private string rootItemIdField; + + private string rootItemChangeKeyField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string RootItemId + { + get + { + return this.rootItemIdField; + } + set + { + this.rootItemIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string RootItemChangeKey + { + get + { + return this.rootItemChangeKeyField; + } + set + { + this.rootItemChangeKeyField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AttachmentIdType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class RequestAttachmentIdType : BaseItemIdType + { + + private string idField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string Id + { + get + { + return this.idField; + } + set + { + this.idField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class AttachmentIdType : RequestAttachmentIdType + { + + private string rootItemIdField; + + private string rootItemChangeKeyField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string RootItemId + { + get + { + return this.rootItemIdField; + } + set + { + this.rootItemIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string RootItemChangeKey + { + get + { + return this.rootItemChangeKeyField; + } + set + { + this.rootItemChangeKeyField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EmailAddressType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class BaseEmailAddressType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class AttendeeType + { + + private EmailAddressType mailboxField; + + private ResponseTypeType responseTypeField; + + private bool responseTypeFieldSpecified; + + private System.DateTime lastResponseTimeField; + + private bool lastResponseTimeFieldSpecified; + + /// + public EmailAddressType Mailbox + { + get + { + return this.mailboxField; + } + set + { + this.mailboxField = value; + } + } + + /// + public ResponseTypeType ResponseType + { + get + { + return this.responseTypeField; + } + set + { + this.responseTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ResponseTypeSpecified + { + get + { + return this.responseTypeFieldSpecified; + } + set + { + this.responseTypeFieldSpecified = value; + } + } + + /// + public System.DateTime LastResponseTime + { + get + { + return this.lastResponseTimeField; + } + set + { + this.lastResponseTimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool LastResponseTimeSpecified + { + get + { + return this.lastResponseTimeFieldSpecified; + } + set + { + this.lastResponseTimeFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class NonEmptyArrayOfAllItemsType + { + + private ItemType[] itemsField; + + /// + [System.Xml.Serialization.XmlElementAttribute("AcceptItem", typeof(AcceptItemType))] + [System.Xml.Serialization.XmlElementAttribute("CalendarItem", typeof(CalendarItemType))] + [System.Xml.Serialization.XmlElementAttribute("CancelCalendarItem", typeof(CancelCalendarItemType))] + [System.Xml.Serialization.XmlElementAttribute("Contact", typeof(ContactItemType))] + [System.Xml.Serialization.XmlElementAttribute("DeclineItem", typeof(DeclineItemType))] + [System.Xml.Serialization.XmlElementAttribute("DistributionList", typeof(DistributionListType))] + [System.Xml.Serialization.XmlElementAttribute("ForwardItem", typeof(ForwardItemType))] + [System.Xml.Serialization.XmlElementAttribute("Item", typeof(ItemType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingCancellation", typeof(MeetingCancellationMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingMessage", typeof(MeetingMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingRequest", typeof(MeetingRequestMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingResponse", typeof(MeetingResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("Message", typeof(MessageType))] + [System.Xml.Serialization.XmlElementAttribute("PostItem", typeof(PostItemType))] + [System.Xml.Serialization.XmlElementAttribute("PostReplyItem", typeof(PostReplyItemType))] + [System.Xml.Serialization.XmlElementAttribute("RemoveItem", typeof(RemoveItemType))] + [System.Xml.Serialization.XmlElementAttribute("ReplyAllToItem", typeof(ReplyAllToItemType))] + [System.Xml.Serialization.XmlElementAttribute("ReplyToItem", typeof(ReplyToItemType))] + [System.Xml.Serialization.XmlElementAttribute("SuppressReadReceipt", typeof(SuppressReadReceiptType))] + [System.Xml.Serialization.XmlElementAttribute("Task", typeof(TaskType))] + [System.Xml.Serialization.XmlElementAttribute("TentativelyAcceptItem", typeof(TentativelyAcceptItemType))] + public ItemType[] Items + { + get + { + return this.itemsField; + } + set + { + this.itemsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class AcceptItemType : WellKnownResponseObjectType + { + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeclineItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TentativelyAcceptItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AcceptItemType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class WellKnownResponseObjectType : ResponseObjectType + { + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostReplyItemBaseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostReplyItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RemoveItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReferenceItemResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SuppressReadReceiptType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SmartResponseBaseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SmartResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CancelCalendarItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForwardItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReplyAllToItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReplyToItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WellKnownResponseObjectType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeclineItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TentativelyAcceptItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AcceptItemType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class ResponseObjectType : ResponseObjectCoreType + { + + private string objectNameField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string ObjectName + { + get + { + return this.objectNameField; + } + set + { + this.objectNameField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResponseObjectType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostReplyItemBaseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostReplyItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RemoveItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReferenceItemResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SuppressReadReceiptType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SmartResponseBaseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SmartResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CancelCalendarItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForwardItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReplyAllToItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReplyToItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WellKnownResponseObjectType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeclineItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TentativelyAcceptItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AcceptItemType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class ResponseObjectCoreType : MessageType + { + + private ItemIdType referenceItemIdField; + + /// + public ItemIdType ReferenceItemId + { + get + { + return this.referenceItemIdField; + } + set + { + this.referenceItemIdField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeetingMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeetingCancellationMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeetingResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeetingRequestMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResponseObjectCoreType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResponseObjectType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostReplyItemBaseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostReplyItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RemoveItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReferenceItemResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SuppressReadReceiptType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SmartResponseBaseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SmartResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CancelCalendarItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForwardItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReplyAllToItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReplyToItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WellKnownResponseObjectType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeclineItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TentativelyAcceptItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AcceptItemType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class MessageType : ItemType + { + + private SingleRecipientType senderField; + + private EmailAddressType[] toRecipientsField; + + private EmailAddressType[] ccRecipientsField; + + private EmailAddressType[] bccRecipientsField; + + private bool isReadReceiptRequestedField; + + private bool isReadReceiptRequestedFieldSpecified; + + private bool isDeliveryReceiptRequestedField; + + private bool isDeliveryReceiptRequestedFieldSpecified; + + private byte[] conversationIndexField; + + private string conversationTopicField; + + private SingleRecipientType fromField; + + private string internetMessageIdField; + + private bool isReadField; + + private bool isReadFieldSpecified; + + private bool isResponseRequestedField; + + private bool isResponseRequestedFieldSpecified; + + private string referencesField; + + private EmailAddressType[] replyToField; + + private SingleRecipientType receivedByField; + + private SingleRecipientType receivedRepresentingField; + + /// + public SingleRecipientType Sender + { + get + { + return this.senderField; + } + set + { + this.senderField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Mailbox", IsNullable = false)] + public EmailAddressType[] ToRecipients + { + get + { + return this.toRecipientsField; + } + set + { + this.toRecipientsField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Mailbox", IsNullable = false)] + public EmailAddressType[] CcRecipients + { + get + { + return this.ccRecipientsField; + } + set + { + this.ccRecipientsField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Mailbox", IsNullable = false)] + public EmailAddressType[] BccRecipients + { + get + { + return this.bccRecipientsField; + } + set + { + this.bccRecipientsField = value; + } + } + + /// + public bool IsReadReceiptRequested + { + get + { + return this.isReadReceiptRequestedField; + } + set + { + this.isReadReceiptRequestedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsReadReceiptRequestedSpecified + { + get + { + return this.isReadReceiptRequestedFieldSpecified; + } + set + { + this.isReadReceiptRequestedFieldSpecified = value; + } + } + + /// + public bool IsDeliveryReceiptRequested + { + get + { + return this.isDeliveryReceiptRequestedField; + } + set + { + this.isDeliveryReceiptRequestedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsDeliveryReceiptRequestedSpecified + { + get + { + return this.isDeliveryReceiptRequestedFieldSpecified; + } + set + { + this.isDeliveryReceiptRequestedFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] ConversationIndex + { + get + { + return this.conversationIndexField; + } + set + { + this.conversationIndexField = value; + } + } + + /// + public string ConversationTopic + { + get + { + return this.conversationTopicField; + } + set + { + this.conversationTopicField = value; + } + } + + /// + public SingleRecipientType From + { + get + { + return this.fromField; + } + set + { + this.fromField = value; + } + } + + /// + public string InternetMessageId + { + get + { + return this.internetMessageIdField; + } + set + { + this.internetMessageIdField = value; + } + } + + /// + public bool IsRead + { + get + { + return this.isReadField; + } + set + { + this.isReadField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsReadSpecified + { + get + { + return this.isReadFieldSpecified; + } + set + { + this.isReadFieldSpecified = value; + } + } + + /// + public bool IsResponseRequested + { + get + { + return this.isResponseRequestedField; + } + set + { + this.isResponseRequestedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsResponseRequestedSpecified + { + get + { + return this.isResponseRequestedFieldSpecified; + } + set + { + this.isResponseRequestedFieldSpecified = value; + } + } + + /// + public string References + { + get + { + return this.referencesField; + } + set + { + this.referencesField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Mailbox", IsNullable = false)] + public EmailAddressType[] ReplyTo + { + get + { + return this.replyToField; + } + set + { + this.replyToField = value; + } + } + + /// + public SingleRecipientType ReceivedBy + { + get + { + return this.receivedByField; + } + set + { + this.receivedByField = value; + } + } + + /// + public SingleRecipientType ReceivedRepresenting + { + get + { + return this.receivedRepresentingField; + } + set + { + this.receivedRepresentingField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TaskType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DistributionListType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContactItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CalendarItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeetingMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeetingCancellationMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeetingResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeetingRequestMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResponseObjectCoreType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResponseObjectType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostReplyItemBaseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostReplyItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RemoveItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReferenceItemResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SuppressReadReceiptType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SmartResponseBaseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SmartResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CancelCalendarItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForwardItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReplyAllToItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReplyToItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WellKnownResponseObjectType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeclineItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TentativelyAcceptItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AcceptItemType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ItemType + { + + private MimeContentType mimeContentField; + + private ItemIdType itemIdField; + + private FolderIdType parentFolderIdField; + + private string itemClassField; + + private string subjectField; + + private SensitivityChoicesType sensitivityField; + + private bool sensitivityFieldSpecified; + + private BodyType bodyField; + + private AttachmentType[] attachmentsField; + + private System.DateTime dateTimeReceivedField; + + private bool dateTimeReceivedFieldSpecified; + + private int sizeField; + + private bool sizeFieldSpecified; + + private string[] categoriesField; + + private ImportanceChoicesType importanceField; + + private bool importanceFieldSpecified; + + private string inReplyToField; + + private bool isSubmittedField; + + private bool isSubmittedFieldSpecified; + + private bool isDraftField; + + private bool isDraftFieldSpecified; + + private bool isFromMeField; + + private bool isFromMeFieldSpecified; + + private bool isResendField; + + private bool isResendFieldSpecified; + + private bool isUnmodifiedField; + + private bool isUnmodifiedFieldSpecified; + + private InternetHeaderType[] internetMessageHeadersField; + + private System.DateTime dateTimeSentField; + + private bool dateTimeSentFieldSpecified; + + private System.DateTime dateTimeCreatedField; + + private bool dateTimeCreatedFieldSpecified; + + private ResponseObjectType[] responseObjectsField; + + private System.DateTime reminderDueByField; + + private bool reminderDueByFieldSpecified; + + private bool reminderIsSetField; + + private bool reminderIsSetFieldSpecified; + + private string reminderMinutesBeforeStartField; + + private string displayCcField; + + private string displayToField; + + private bool hasAttachmentsField; + + private bool hasAttachmentsFieldSpecified; + + private ExtendedPropertyType[] extendedPropertyField; + + private string cultureField; + + private EffectiveRightsType effectiveRightsField; + + private string lastModifiedNameField; + + private System.DateTime lastModifiedTimeField; + + private bool lastModifiedTimeFieldSpecified; + + /// + public MimeContentType MimeContent + { + get + { + return this.mimeContentField; + } + set + { + this.mimeContentField = value; + } + } + + /// + public ItemIdType ItemId + { + get + { + return this.itemIdField; + } + set + { + this.itemIdField = value; + } + } + + /// + public FolderIdType ParentFolderId + { + get + { + return this.parentFolderIdField; + } + set + { + this.parentFolderIdField = value; + } + } + + /// + public string ItemClass + { + get + { + return this.itemClassField; + } + set + { + this.itemClassField = value; + } + } + + /// + public string Subject + { + get + { + return this.subjectField; + } + set + { + this.subjectField = value; + } + } + + /// + public SensitivityChoicesType Sensitivity + { + get + { + return this.sensitivityField; + } + set + { + this.sensitivityField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool SensitivitySpecified + { + get + { + return this.sensitivityFieldSpecified; + } + set + { + this.sensitivityFieldSpecified = value; + } + } + + /// + public BodyType Body + { + get + { + return this.bodyField; + } + set + { + this.bodyField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("FileAttachment", typeof(FileAttachmentType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("ItemAttachment", typeof(ItemAttachmentType), IsNullable = false)] + public AttachmentType[] Attachments + { + get + { + return this.attachmentsField; + } + set + { + this.attachmentsField = value; + } + } + + /// + public System.DateTime DateTimeReceived + { + get + { + return this.dateTimeReceivedField; + } + set + { + this.dateTimeReceivedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DateTimeReceivedSpecified + { + get + { + return this.dateTimeReceivedFieldSpecified; + } + set + { + this.dateTimeReceivedFieldSpecified = value; + } + } + + /// + public int Size + { + get + { + return this.sizeField; + } + set + { + this.sizeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool SizeSpecified + { + get + { + return this.sizeFieldSpecified; + } + set + { + this.sizeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("String", IsNullable = false)] + public string[] Categories + { + get + { + return this.categoriesField; + } + set + { + this.categoriesField = value; + } + } + + /// + public ImportanceChoicesType Importance + { + get + { + return this.importanceField; + } + set + { + this.importanceField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ImportanceSpecified + { + get + { + return this.importanceFieldSpecified; + } + set + { + this.importanceFieldSpecified = value; + } + } + + /// + public string InReplyTo + { + get + { + return this.inReplyToField; + } + set + { + this.inReplyToField = value; + } + } + + /// + public bool IsSubmitted + { + get + { + return this.isSubmittedField; + } + set + { + this.isSubmittedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsSubmittedSpecified + { + get + { + return this.isSubmittedFieldSpecified; + } + set + { + this.isSubmittedFieldSpecified = value; + } + } + + /// + public bool IsDraft + { + get + { + return this.isDraftField; + } + set + { + this.isDraftField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsDraftSpecified + { + get + { + return this.isDraftFieldSpecified; + } + set + { + this.isDraftFieldSpecified = value; + } + } + + /// + public bool IsFromMe + { + get + { + return this.isFromMeField; + } + set + { + this.isFromMeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsFromMeSpecified + { + get + { + return this.isFromMeFieldSpecified; + } + set + { + this.isFromMeFieldSpecified = value; + } + } + + /// + public bool IsResend + { + get + { + return this.isResendField; + } + set + { + this.isResendField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsResendSpecified + { + get + { + return this.isResendFieldSpecified; + } + set + { + this.isResendFieldSpecified = value; + } + } + + /// + public bool IsUnmodified + { + get + { + return this.isUnmodifiedField; + } + set + { + this.isUnmodifiedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsUnmodifiedSpecified + { + get + { + return this.isUnmodifiedFieldSpecified; + } + set + { + this.isUnmodifiedFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("InternetMessageHeader", IsNullable = false)] + public InternetHeaderType[] InternetMessageHeaders + { + get + { + return this.internetMessageHeadersField; + } + set + { + this.internetMessageHeadersField = value; + } + } + + /// + public System.DateTime DateTimeSent + { + get + { + return this.dateTimeSentField; + } + set + { + this.dateTimeSentField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DateTimeSentSpecified + { + get + { + return this.dateTimeSentFieldSpecified; + } + set + { + this.dateTimeSentFieldSpecified = value; + } + } + + /// + public System.DateTime DateTimeCreated + { + get + { + return this.dateTimeCreatedField; + } + set + { + this.dateTimeCreatedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DateTimeCreatedSpecified + { + get + { + return this.dateTimeCreatedFieldSpecified; + } + set + { + this.dateTimeCreatedFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("AcceptItem", typeof(AcceptItemType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("CancelCalendarItem", typeof(CancelCalendarItemType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("DeclineItem", typeof(DeclineItemType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("ForwardItem", typeof(ForwardItemType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("PostReplyItem", typeof(PostReplyItemType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("RemoveItem", typeof(RemoveItemType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("ReplyAllToItem", typeof(ReplyAllToItemType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("ReplyToItem", typeof(ReplyToItemType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("SuppressReadReceipt", typeof(SuppressReadReceiptType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("TentativelyAcceptItem", typeof(TentativelyAcceptItemType), IsNullable = false)] + public ResponseObjectType[] ResponseObjects + { + get + { + return this.responseObjectsField; + } + set + { + this.responseObjectsField = value; + } + } + + /// + public System.DateTime ReminderDueBy + { + get + { + return this.reminderDueByField; + } + set + { + this.reminderDueByField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ReminderDueBySpecified + { + get + { + return this.reminderDueByFieldSpecified; + } + set + { + this.reminderDueByFieldSpecified = value; + } + } + + /// + public bool ReminderIsSet + { + get + { + return this.reminderIsSetField; + } + set + { + this.reminderIsSetField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ReminderIsSetSpecified + { + get + { + return this.reminderIsSetFieldSpecified; + } + set + { + this.reminderIsSetFieldSpecified = value; + } + } + + /// + public string ReminderMinutesBeforeStart + { + get + { + return this.reminderMinutesBeforeStartField; + } + set + { + this.reminderMinutesBeforeStartField = value; + } + } + + /// + public string DisplayCc + { + get + { + return this.displayCcField; + } + set + { + this.displayCcField = value; + } + } + + /// + public string DisplayTo + { + get + { + return this.displayToField; + } + set + { + this.displayToField = value; + } + } + + /// + public bool HasAttachments + { + get + { + return this.hasAttachmentsField; + } + set + { + this.hasAttachmentsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool HasAttachmentsSpecified + { + get + { + return this.hasAttachmentsFieldSpecified; + } + set + { + this.hasAttachmentsFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("ExtendedProperty")] + public ExtendedPropertyType[] ExtendedProperty + { + get + { + return this.extendedPropertyField; + } + set + { + this.extendedPropertyField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType = "language")] + public string Culture + { + get + { + return this.cultureField; + } + set + { + this.cultureField = value; + } + } + + /// + public EffectiveRightsType EffectiveRights + { + get + { + return this.effectiveRightsField; + } + set + { + this.effectiveRightsField = value; + } + } + + /// + public string LastModifiedName + { + get + { + return this.lastModifiedNameField; + } + set + { + this.lastModifiedNameField = value; + } + } + + /// + public System.DateTime LastModifiedTime + { + get + { + return this.lastModifiedTimeField; + } + set + { + this.lastModifiedTimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool LastModifiedTimeSpecified + { + get + { + return this.lastModifiedTimeFieldSpecified; + } + set + { + this.lastModifiedTimeFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class MimeContentType + { + + private string characterSetField; + + private string valueField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string CharacterSet + { + get + { + return this.characterSetField; + } + set + { + this.characterSetField = value; + } + } + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class FolderIdType : BaseFolderIdType + { + + private string idField; + + private string changeKeyField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string Id + { + get + { + return this.idField; + } + set + { + this.idField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string ChangeKey + { + get + { + return this.changeKeyField; + } + set + { + this.changeKeyField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FolderIdType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DistinguishedFolderIdType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class BaseFolderIdType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class DistinguishedFolderIdType : BaseFolderIdType + { + + private EmailAddressType mailboxField; + + private DistinguishedFolderIdNameType idField; + + private string changeKeyField; + + /// + public EmailAddressType Mailbox + { + get + { + return this.mailboxField; + } + set + { + this.mailboxField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public DistinguishedFolderIdNameType Id + { + get + { + return this.idField; + } + set + { + this.idField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string ChangeKey + { + get + { + return this.changeKeyField; + } + set + { + this.changeKeyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum DistinguishedFolderIdNameType + { + + /// + calendar, + + /// + contacts, + + /// + deleteditems, + + /// + drafts, + + /// + inbox, + + /// + journal, + + /// + notes, + + /// + outbox, + + /// + sentitems, + + /// + tasks, + + /// + msgfolderroot, + + /// + publicfoldersroot, + + /// + root, + + /// + junkemail, + + /// + searchfolders, + + /// + voicemail, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum SensitivityChoicesType + { + + /// + Normal, + + /// + Personal, + + /// + Private, + + /// + Confidential, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class BodyType + { + + private BodyTypeType bodyType1Field; + + private string valueField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute("BodyType")] + public BodyTypeType BodyType1 + { + get + { + return this.bodyType1Field; + } + set + { + this.bodyType1Field = value; + } + } + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum BodyTypeType + { + + /// + HTML, + + /// + Text, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class FileAttachmentType : AttachmentType + { + + private byte[] contentField; + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] Content + { + get + { + return this.contentField; + } + set + { + this.contentField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FileAttachmentType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ItemAttachmentType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class AttachmentType + { + + private AttachmentIdType attachmentIdField; + + private string nameField; + + private string contentTypeField; + + private string contentIdField; + + private string contentLocationField; + + /// + public AttachmentIdType AttachmentId + { + get + { + return this.attachmentIdField; + } + set + { + this.attachmentIdField = value; + } + } + + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameField = value; + } + } + + /// + public string ContentType + { + get + { + return this.contentTypeField; + } + set + { + this.contentTypeField = value; + } + } + + /// + public string ContentId + { + get + { + return this.contentIdField; + } + set + { + this.contentIdField = value; + } + } + + /// + public string ContentLocation + { + get + { + return this.contentLocationField; + } + set + { + this.contentLocationField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ItemAttachmentType : AttachmentType + { + + private ItemType itemField; + + /// + [System.Xml.Serialization.XmlElementAttribute("CalendarItem", typeof(CalendarItemType))] + [System.Xml.Serialization.XmlElementAttribute("Contact", typeof(ContactItemType))] + [System.Xml.Serialization.XmlElementAttribute("Item", typeof(ItemType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingCancellation", typeof(MeetingCancellationMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingMessage", typeof(MeetingMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingRequest", typeof(MeetingRequestMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingResponse", typeof(MeetingResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("Message", typeof(MessageType))] + [System.Xml.Serialization.XmlElementAttribute("PostItem", typeof(PostItemType))] + [System.Xml.Serialization.XmlElementAttribute("Task", typeof(TaskType))] + public ItemType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ContactItemType : ItemType + { + + private string fileAsField; + + private FileAsMappingType fileAsMappingField; + + private bool fileAsMappingFieldSpecified; + + private string displayNameField; + + private string givenNameField; + + private string initialsField; + + private string middleNameField; + + private string nicknameField; + + private CompleteNameType completeNameField; + + private string companyNameField; + + private EmailAddressDictionaryEntryType[] emailAddressesField; + + private PhysicalAddressDictionaryEntryType[] physicalAddressesField; + + private PhoneNumberDictionaryEntryType[] phoneNumbersField; + + private string assistantNameField; + + private System.DateTime birthdayField; + + private bool birthdayFieldSpecified; + + private string businessHomePageField; + + private string[] childrenField; + + private string[] companiesField; + + private ContactSourceType contactSourceField; + + private bool contactSourceFieldSpecified; + + private string departmentField; + + private string generationField; + + private ImAddressDictionaryEntryType[] imAddressesField; + + private string jobTitleField; + + private string managerField; + + private string mileageField; + + private string officeLocationField; + + private PhysicalAddressIndexType postalAddressIndexField; + + private bool postalAddressIndexFieldSpecified; + + private string professionField; + + private string spouseNameField; + + private string surnameField; + + private System.DateTime weddingAnniversaryField; + + private bool weddingAnniversaryFieldSpecified; + + /// + public string FileAs + { + get + { + return this.fileAsField; + } + set + { + this.fileAsField = value; + } + } + + /// + public FileAsMappingType FileAsMapping + { + get + { + return this.fileAsMappingField; + } + set + { + this.fileAsMappingField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool FileAsMappingSpecified + { + get + { + return this.fileAsMappingFieldSpecified; + } + set + { + this.fileAsMappingFieldSpecified = value; + } + } + + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameField = value; + } + } + + /// + public string GivenName + { + get + { + return this.givenNameField; + } + set + { + this.givenNameField = value; + } + } + + /// + public string Initials + { + get + { + return this.initialsField; + } + set + { + this.initialsField = value; + } + } + + /// + public string MiddleName + { + get + { + return this.middleNameField; + } + set + { + this.middleNameField = value; + } + } + + /// + public string Nickname + { + get + { + return this.nicknameField; + } + set + { + this.nicknameField = value; + } + } + + /// + public CompleteNameType CompleteName + { + get + { + return this.completeNameField; + } + set + { + this.completeNameField = value; + } + } + + /// + public string CompanyName + { + get + { + return this.companyNameField; + } + set + { + this.companyNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Entry", IsNullable = false)] + public EmailAddressDictionaryEntryType[] EmailAddresses + { + get + { + return this.emailAddressesField; + } + set + { + this.emailAddressesField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Entry", IsNullable = false)] + public PhysicalAddressDictionaryEntryType[] PhysicalAddresses + { + get + { + return this.physicalAddressesField; + } + set + { + this.physicalAddressesField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Entry", IsNullable = false)] + public PhoneNumberDictionaryEntryType[] PhoneNumbers + { + get + { + return this.phoneNumbersField; + } + set + { + this.phoneNumbersField = value; + } + } + + /// + public string AssistantName + { + get + { + return this.assistantNameField; + } + set + { + this.assistantNameField = value; + } + } + + /// + public System.DateTime Birthday + { + get + { + return this.birthdayField; + } + set + { + this.birthdayField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool BirthdaySpecified + { + get + { + return this.birthdayFieldSpecified; + } + set + { + this.birthdayFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType = "anyURI")] + public string BusinessHomePage + { + get + { + return this.businessHomePageField; + } + set + { + this.businessHomePageField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("String", IsNullable = false)] + public string[] Children + { + get + { + return this.childrenField; + } + set + { + this.childrenField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("String", IsNullable = false)] + public string[] Companies + { + get + { + return this.companiesField; + } + set + { + this.companiesField = value; + } + } + + /// + public ContactSourceType ContactSource + { + get + { + return this.contactSourceField; + } + set + { + this.contactSourceField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ContactSourceSpecified + { + get + { + return this.contactSourceFieldSpecified; + } + set + { + this.contactSourceFieldSpecified = value; + } + } + + /// + public string Department + { + get + { + return this.departmentField; + } + set + { + this.departmentField = value; + } + } + + /// + public string Generation + { + get + { + return this.generationField; + } + set + { + this.generationField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Entry", IsNullable = false)] + public ImAddressDictionaryEntryType[] ImAddresses + { + get + { + return this.imAddressesField; + } + set + { + this.imAddressesField = value; + } + } + + /// + public string JobTitle + { + get + { + return this.jobTitleField; + } + set + { + this.jobTitleField = value; + } + } + + /// + public string Manager + { + get + { + return this.managerField; + } + set + { + this.managerField = value; + } + } + + /// + public string Mileage + { + get + { + return this.mileageField; + } + set + { + this.mileageField = value; + } + } + + /// + public string OfficeLocation + { + get + { + return this.officeLocationField; + } + set + { + this.officeLocationField = value; + } + } + + /// + public PhysicalAddressIndexType PostalAddressIndex + { + get + { + return this.postalAddressIndexField; + } + set + { + this.postalAddressIndexField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool PostalAddressIndexSpecified + { + get + { + return this.postalAddressIndexFieldSpecified; + } + set + { + this.postalAddressIndexFieldSpecified = value; + } + } + + /// + public string Profession + { + get + { + return this.professionField; + } + set + { + this.professionField = value; + } + } + + /// + public string SpouseName + { + get + { + return this.spouseNameField; + } + set + { + this.spouseNameField = value; + } + } + + /// + public string Surname + { + get + { + return this.surnameField; + } + set + { + this.surnameField = value; + } + } + + /// + public System.DateTime WeddingAnniversary + { + get + { + return this.weddingAnniversaryField; + } + set + { + this.weddingAnniversaryField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool WeddingAnniversarySpecified + { + get + { + return this.weddingAnniversaryFieldSpecified; + } + set + { + this.weddingAnniversaryFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum FileAsMappingType + { + + /// + None, + + /// + LastCommaFirst, + + /// + FirstSpaceLast, + + /// + Company, + + /// + LastCommaFirstCompany, + + /// + CompanyLastFirst, + + /// + LastFirst, + + /// + LastFirstCompany, + + /// + CompanyLastCommaFirst, + + /// + LastFirstSuffix, + + /// + LastSpaceFirstCompany, + + /// + CompanyLastSpaceFirst, + + /// + LastSpaceFirst, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class CompleteNameType + { + + private string titleField; + + private string firstNameField; + + private string middleNameField; + + private string lastNameField; + + private string suffixField; + + private string initialsField; + + private string fullNameField; + + private string nicknameField; + + private string yomiFirstNameField; + + private string yomiLastNameField; + + /// + public string Title + { + get + { + return this.titleField; + } + set + { + this.titleField = value; + } + } + + /// + public string FirstName + { + get + { + return this.firstNameField; + } + set + { + this.firstNameField = value; + } + } + + /// + public string MiddleName + { + get + { + return this.middleNameField; + } + set + { + this.middleNameField = value; + } + } + + /// + public string LastName + { + get + { + return this.lastNameField; + } + set + { + this.lastNameField = value; + } + } + + /// + public string Suffix + { + get + { + return this.suffixField; + } + set + { + this.suffixField = value; + } + } + + /// + public string Initials + { + get + { + return this.initialsField; + } + set + { + this.initialsField = value; + } + } + + /// + public string FullName + { + get + { + return this.fullNameField; + } + set + { + this.fullNameField = value; + } + } + + /// + public string Nickname + { + get + { + return this.nicknameField; + } + set + { + this.nicknameField = value; + } + } + + /// + public string YomiFirstName + { + get + { + return this.yomiFirstNameField; + } + set + { + this.yomiFirstNameField = value; + } + } + + /// + public string YomiLastName + { + get + { + return this.yomiLastNameField; + } + set + { + this.yomiLastNameField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class EmailAddressDictionaryEntryType + { + + private EmailAddressKeyType keyField; + + private string valueField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public EmailAddressKeyType Key + { + get + { + return this.keyField; + } + set + { + this.keyField = value; + } + } + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum EmailAddressKeyType + { + + /// + EmailAddress1, + + /// + EmailAddress2, + + /// + EmailAddress3, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class PhysicalAddressDictionaryEntryType + { + + private string streetField; + + private string cityField; + + private string stateField; + + private string countryOrRegionField; + + private string postalCodeField; + + private PhysicalAddressKeyType keyField; + + /// + public string Street + { + get + { + return this.streetField; + } + set + { + this.streetField = value; + } + } + + /// + public string City + { + get + { + return this.cityField; + } + set + { + this.cityField = value; + } + } + + /// + public string State + { + get + { + return this.stateField; + } + set + { + this.stateField = value; + } + } + + /// + public string CountryOrRegion + { + get + { + return this.countryOrRegionField; + } + set + { + this.countryOrRegionField = value; + } + } + + /// + public string PostalCode + { + get + { + return this.postalCodeField; + } + set + { + this.postalCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public PhysicalAddressKeyType Key + { + get + { + return this.keyField; + } + set + { + this.keyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum PhysicalAddressKeyType + { + + /// + Business, + + /// + Home, + + /// + Other, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class PhoneNumberDictionaryEntryType + { + + private PhoneNumberKeyType keyField; + + private string valueField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public PhoneNumberKeyType Key + { + get + { + return this.keyField; + } + set + { + this.keyField = value; + } + } + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum PhoneNumberKeyType + { + + /// + AssistantPhone, + + /// + BusinessFax, + + /// + BusinessPhone, + + /// + BusinessPhone2, + + /// + Callback, + + /// + CarPhone, + + /// + CompanyMainPhone, + + /// + HomeFax, + + /// + HomePhone, + + /// + HomePhone2, + + /// + Isdn, + + /// + MobilePhone, + + /// + OtherFax, + + /// + OtherTelephone, + + /// + Pager, + + /// + PrimaryPhone, + + /// + RadioPhone, + + /// + Telex, + + /// + TtyTddPhone, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum ContactSourceType + { + + /// + ActiveDirectory, + + /// + Store, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ImAddressDictionaryEntryType + { + + private ImAddressKeyType keyField; + + private string valueField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public ImAddressKeyType Key + { + get + { + return this.keyField; + } + set + { + this.keyField = value; + } + } + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum ImAddressKeyType + { + + /// + ImAddress1, + + /// + ImAddress2, + + /// + ImAddress3, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum PhysicalAddressIndexType + { + + /// + None, + + /// + Business, + + /// + Home, + + /// + Other, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class MeetingCancellationMessageType : MeetingMessageType + { + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeetingCancellationMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeetingResponseMessageType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeetingRequestMessageType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class MeetingMessageType : MessageType + { + + private ItemIdType associatedCalendarItemIdField; + + private bool isDelegatedField; + + private bool isDelegatedFieldSpecified; + + private bool isOutOfDateField; + + private bool isOutOfDateFieldSpecified; + + private bool hasBeenProcessedField; + + private bool hasBeenProcessedFieldSpecified; + + private ResponseTypeType responseTypeField; + + private bool responseTypeFieldSpecified; + + private string uIDField; + + private System.DateTime recurrenceIdField; + + private bool recurrenceIdFieldSpecified; + + private System.DateTime dateTimeStampField; + + private bool dateTimeStampFieldSpecified; + + /// + public ItemIdType AssociatedCalendarItemId + { + get + { + return this.associatedCalendarItemIdField; + } + set + { + this.associatedCalendarItemIdField = value; + } + } + + /// + public bool IsDelegated + { + get + { + return this.isDelegatedField; + } + set + { + this.isDelegatedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsDelegatedSpecified + { + get + { + return this.isDelegatedFieldSpecified; + } + set + { + this.isDelegatedFieldSpecified = value; + } + } + + /// + public bool IsOutOfDate + { + get + { + return this.isOutOfDateField; + } + set + { + this.isOutOfDateField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsOutOfDateSpecified + { + get + { + return this.isOutOfDateFieldSpecified; + } + set + { + this.isOutOfDateFieldSpecified = value; + } + } + + /// + public bool HasBeenProcessed + { + get + { + return this.hasBeenProcessedField; + } + set + { + this.hasBeenProcessedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool HasBeenProcessedSpecified + { + get + { + return this.hasBeenProcessedFieldSpecified; + } + set + { + this.hasBeenProcessedFieldSpecified = value; + } + } + + /// + public ResponseTypeType ResponseType + { + get + { + return this.responseTypeField; + } + set + { + this.responseTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ResponseTypeSpecified + { + get + { + return this.responseTypeFieldSpecified; + } + set + { + this.responseTypeFieldSpecified = value; + } + } + + /// + public string UID + { + get + { + return this.uIDField; + } + set + { + this.uIDField = value; + } + } + + /// + public System.DateTime RecurrenceId + { + get + { + return this.recurrenceIdField; + } + set + { + this.recurrenceIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool RecurrenceIdSpecified + { + get + { + return this.recurrenceIdFieldSpecified; + } + set + { + this.recurrenceIdFieldSpecified = value; + } + } + + /// + public System.DateTime DateTimeStamp + { + get + { + return this.dateTimeStampField; + } + set + { + this.dateTimeStampField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DateTimeStampSpecified + { + get + { + return this.dateTimeStampFieldSpecified; + } + set + { + this.dateTimeStampFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class MeetingResponseMessageType : MeetingMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class MeetingRequestMessageType : MeetingMessageType + { + + private MeetingRequestTypeType meetingRequestTypeField; + + private bool meetingRequestTypeFieldSpecified; + + private LegacyFreeBusyType intendedFreeBusyStatusField; + + private bool intendedFreeBusyStatusFieldSpecified; + + private System.DateTime startField; + + private bool startFieldSpecified; + + private System.DateTime endField; + + private bool endFieldSpecified; + + private System.DateTime originalStartField; + + private bool originalStartFieldSpecified; + + private bool isAllDayEventField; + + private bool isAllDayEventFieldSpecified; + + private LegacyFreeBusyType legacyFreeBusyStatusField; + + private bool legacyFreeBusyStatusFieldSpecified; + + private string locationField; + + private string whenField; + + private bool isMeetingField; + + private bool isMeetingFieldSpecified; + + private bool isCancelledField; + + private bool isCancelledFieldSpecified; + + private bool isRecurringField; + + private bool isRecurringFieldSpecified; + + private bool meetingRequestWasSentField; + + private bool meetingRequestWasSentFieldSpecified; + + private CalendarItemTypeType calendarItemTypeField; + + private bool calendarItemTypeFieldSpecified; + + private ResponseTypeType myResponseTypeField; + + private bool myResponseTypeFieldSpecified; + + private SingleRecipientType organizerField; + + private AttendeeType[] requiredAttendeesField; + + private AttendeeType[] optionalAttendeesField; + + private AttendeeType[] resourcesField; + + private int conflictingMeetingCountField; + + private bool conflictingMeetingCountFieldSpecified; + + private int adjacentMeetingCountField; + + private bool adjacentMeetingCountFieldSpecified; + + private NonEmptyArrayOfAllItemsType conflictingMeetingsField; + + private NonEmptyArrayOfAllItemsType adjacentMeetingsField; + + private string durationField; + + private string timeZoneField; + + private System.DateTime appointmentReplyTimeField; + + private bool appointmentReplyTimeFieldSpecified; + + private int appointmentSequenceNumberField; + + private bool appointmentSequenceNumberFieldSpecified; + + private int appointmentStateField; + + private bool appointmentStateFieldSpecified; + + private RecurrenceType recurrenceField; + + private OccurrenceInfoType firstOccurrenceField; + + private OccurrenceInfoType lastOccurrenceField; + + private OccurrenceInfoType[] modifiedOccurrencesField; + + private DeletedOccurrenceInfoType[] deletedOccurrencesField; + + private TimeZoneType meetingTimeZoneField; + + private int conferenceTypeField; + + private bool conferenceTypeFieldSpecified; + + private bool allowNewTimeProposalField; + + private bool allowNewTimeProposalFieldSpecified; + + private bool isOnlineMeetingField; + + private bool isOnlineMeetingFieldSpecified; + + private string meetingWorkspaceUrlField; + + private string netShowUrlField; + + /// + public MeetingRequestTypeType MeetingRequestType + { + get + { + return this.meetingRequestTypeField; + } + set + { + this.meetingRequestTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MeetingRequestTypeSpecified + { + get + { + return this.meetingRequestTypeFieldSpecified; + } + set + { + this.meetingRequestTypeFieldSpecified = value; + } + } + + /// + public LegacyFreeBusyType IntendedFreeBusyStatus + { + get + { + return this.intendedFreeBusyStatusField; + } + set + { + this.intendedFreeBusyStatusField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IntendedFreeBusyStatusSpecified + { + get + { + return this.intendedFreeBusyStatusFieldSpecified; + } + set + { + this.intendedFreeBusyStatusFieldSpecified = value; + } + } + + /// + public System.DateTime Start + { + get + { + return this.startField; + } + set + { + this.startField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool StartSpecified + { + get + { + return this.startFieldSpecified; + } + set + { + this.startFieldSpecified = value; + } + } + + /// + public System.DateTime End + { + get + { + return this.endField; + } + set + { + this.endField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool EndSpecified + { + get + { + return this.endFieldSpecified; + } + set + { + this.endFieldSpecified = value; + } + } + + /// + public System.DateTime OriginalStart + { + get + { + return this.originalStartField; + } + set + { + this.originalStartField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool OriginalStartSpecified + { + get + { + return this.originalStartFieldSpecified; + } + set + { + this.originalStartFieldSpecified = value; + } + } + + /// + public bool IsAllDayEvent + { + get + { + return this.isAllDayEventField; + } + set + { + this.isAllDayEventField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsAllDayEventSpecified + { + get + { + return this.isAllDayEventFieldSpecified; + } + set + { + this.isAllDayEventFieldSpecified = value; + } + } + + /// + public LegacyFreeBusyType LegacyFreeBusyStatus + { + get + { + return this.legacyFreeBusyStatusField; + } + set + { + this.legacyFreeBusyStatusField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool LegacyFreeBusyStatusSpecified + { + get + { + return this.legacyFreeBusyStatusFieldSpecified; + } + set + { + this.legacyFreeBusyStatusFieldSpecified = value; + } + } + + /// + public string Location + { + get + { + return this.locationField; + } + set + { + this.locationField = value; + } + } + + /// + public string When + { + get + { + return this.whenField; + } + set + { + this.whenField = value; + } + } + + /// + public bool IsMeeting + { + get + { + return this.isMeetingField; + } + set + { + this.isMeetingField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsMeetingSpecified + { + get + { + return this.isMeetingFieldSpecified; + } + set + { + this.isMeetingFieldSpecified = value; + } + } + + /// + public bool IsCancelled + { + get + { + return this.isCancelledField; + } + set + { + this.isCancelledField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsCancelledSpecified + { + get + { + return this.isCancelledFieldSpecified; + } + set + { + this.isCancelledFieldSpecified = value; + } + } + + /// + public bool IsRecurring + { + get + { + return this.isRecurringField; + } + set + { + this.isRecurringField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsRecurringSpecified + { + get + { + return this.isRecurringFieldSpecified; + } + set + { + this.isRecurringFieldSpecified = value; + } + } + + /// + public bool MeetingRequestWasSent + { + get + { + return this.meetingRequestWasSentField; + } + set + { + this.meetingRequestWasSentField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MeetingRequestWasSentSpecified + { + get + { + return this.meetingRequestWasSentFieldSpecified; + } + set + { + this.meetingRequestWasSentFieldSpecified = value; + } + } + + /// + public CalendarItemTypeType CalendarItemType + { + get + { + return this.calendarItemTypeField; + } + set + { + this.calendarItemTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool CalendarItemTypeSpecified + { + get + { + return this.calendarItemTypeFieldSpecified; + } + set + { + this.calendarItemTypeFieldSpecified = value; + } + } + + /// + public ResponseTypeType MyResponseType + { + get + { + return this.myResponseTypeField; + } + set + { + this.myResponseTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MyResponseTypeSpecified + { + get + { + return this.myResponseTypeFieldSpecified; + } + set + { + this.myResponseTypeFieldSpecified = value; + } + } + + /// + public SingleRecipientType Organizer + { + get + { + return this.organizerField; + } + set + { + this.organizerField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Attendee", IsNullable = false)] + public AttendeeType[] RequiredAttendees + { + get + { + return this.requiredAttendeesField; + } + set + { + this.requiredAttendeesField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Attendee", IsNullable = false)] + public AttendeeType[] OptionalAttendees + { + get + { + return this.optionalAttendeesField; + } + set + { + this.optionalAttendeesField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Attendee", IsNullable = false)] + public AttendeeType[] Resources + { + get + { + return this.resourcesField; + } + set + { + this.resourcesField = value; + } + } + + /// + public int ConflictingMeetingCount + { + get + { + return this.conflictingMeetingCountField; + } + set + { + this.conflictingMeetingCountField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ConflictingMeetingCountSpecified + { + get + { + return this.conflictingMeetingCountFieldSpecified; + } + set + { + this.conflictingMeetingCountFieldSpecified = value; + } + } + + /// + public int AdjacentMeetingCount + { + get + { + return this.adjacentMeetingCountField; + } + set + { + this.adjacentMeetingCountField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AdjacentMeetingCountSpecified + { + get + { + return this.adjacentMeetingCountFieldSpecified; + } + set + { + this.adjacentMeetingCountFieldSpecified = value; + } + } + + /// + public NonEmptyArrayOfAllItemsType ConflictingMeetings + { + get + { + return this.conflictingMeetingsField; + } + set + { + this.conflictingMeetingsField = value; + } + } + + /// + public NonEmptyArrayOfAllItemsType AdjacentMeetings + { + get + { + return this.adjacentMeetingsField; + } + set + { + this.adjacentMeetingsField = value; + } + } + + /// + public string Duration + { + get + { + return this.durationField; + } + set + { + this.durationField = value; + } + } + + /// + public string TimeZone + { + get + { + return this.timeZoneField; + } + set + { + this.timeZoneField = value; + } + } + + /// + public System.DateTime AppointmentReplyTime + { + get + { + return this.appointmentReplyTimeField; + } + set + { + this.appointmentReplyTimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AppointmentReplyTimeSpecified + { + get + { + return this.appointmentReplyTimeFieldSpecified; + } + set + { + this.appointmentReplyTimeFieldSpecified = value; + } + } + + /// + public int AppointmentSequenceNumber + { + get + { + return this.appointmentSequenceNumberField; + } + set + { + this.appointmentSequenceNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AppointmentSequenceNumberSpecified + { + get + { + return this.appointmentSequenceNumberFieldSpecified; + } + set + { + this.appointmentSequenceNumberFieldSpecified = value; + } + } + + /// + public int AppointmentState + { + get + { + return this.appointmentStateField; + } + set + { + this.appointmentStateField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AppointmentStateSpecified + { + get + { + return this.appointmentStateFieldSpecified; + } + set + { + this.appointmentStateFieldSpecified = value; + } + } + + /// + public RecurrenceType Recurrence + { + get + { + return this.recurrenceField; + } + set + { + this.recurrenceField = value; + } + } + + /// + public OccurrenceInfoType FirstOccurrence + { + get + { + return this.firstOccurrenceField; + } + set + { + this.firstOccurrenceField = value; + } + } + + /// + public OccurrenceInfoType LastOccurrence + { + get + { + return this.lastOccurrenceField; + } + set + { + this.lastOccurrenceField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Occurrence", IsNullable = false)] + public OccurrenceInfoType[] ModifiedOccurrences + { + get + { + return this.modifiedOccurrencesField; + } + set + { + this.modifiedOccurrencesField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("DeletedOccurrence", IsNullable = false)] + public DeletedOccurrenceInfoType[] DeletedOccurrences + { + get + { + return this.deletedOccurrencesField; + } + set + { + this.deletedOccurrencesField = value; + } + } + + /// + public TimeZoneType MeetingTimeZone + { + get + { + return this.meetingTimeZoneField; + } + set + { + this.meetingTimeZoneField = value; + } + } + + /// + public int ConferenceType + { + get + { + return this.conferenceTypeField; + } + set + { + this.conferenceTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ConferenceTypeSpecified + { + get + { + return this.conferenceTypeFieldSpecified; + } + set + { + this.conferenceTypeFieldSpecified = value; + } + } + + /// + public bool AllowNewTimeProposal + { + get + { + return this.allowNewTimeProposalField; + } + set + { + this.allowNewTimeProposalField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AllowNewTimeProposalSpecified + { + get + { + return this.allowNewTimeProposalFieldSpecified; + } + set + { + this.allowNewTimeProposalFieldSpecified = value; + } + } + + /// + public bool IsOnlineMeeting + { + get + { + return this.isOnlineMeetingField; + } + set + { + this.isOnlineMeetingField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsOnlineMeetingSpecified + { + get + { + return this.isOnlineMeetingFieldSpecified; + } + set + { + this.isOnlineMeetingFieldSpecified = value; + } + } + + /// + public string MeetingWorkspaceUrl + { + get + { + return this.meetingWorkspaceUrlField; + } + set + { + this.meetingWorkspaceUrlField = value; + } + } + + /// + public string NetShowUrl + { + get + { + return this.netShowUrlField; + } + set + { + this.netShowUrlField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum MeetingRequestTypeType + { + + /// + None, + + /// + FullUpdate, + + /// + InformationalUpdate, + + /// + NewMeetingRequest, + + /// + Outdated, + + /// + SilentUpdate, + + /// + PrincipalWantsCopy, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class RecurrenceType + { + + private RecurrencePatternBaseType itemField; + + private RecurrenceRangeBaseType item1Field; + + /// + [System.Xml.Serialization.XmlElementAttribute("AbsoluteMonthlyRecurrence", typeof(AbsoluteMonthlyRecurrencePatternType))] + [System.Xml.Serialization.XmlElementAttribute("AbsoluteYearlyRecurrence", typeof(AbsoluteYearlyRecurrencePatternType))] + [System.Xml.Serialization.XmlElementAttribute("DailyRecurrence", typeof(DailyRecurrencePatternType))] + [System.Xml.Serialization.XmlElementAttribute("RelativeMonthlyRecurrence", typeof(RelativeMonthlyRecurrencePatternType))] + [System.Xml.Serialization.XmlElementAttribute("RelativeYearlyRecurrence", typeof(RelativeYearlyRecurrencePatternType))] + [System.Xml.Serialization.XmlElementAttribute("WeeklyRecurrence", typeof(WeeklyRecurrencePatternType))] + public RecurrencePatternBaseType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("EndDateRecurrence", typeof(EndDateRecurrenceRangeType))] + [System.Xml.Serialization.XmlElementAttribute("NoEndRecurrence", typeof(NoEndRecurrenceRangeType))] + [System.Xml.Serialization.XmlElementAttribute("NumberedRecurrence", typeof(NumberedRecurrenceRangeType))] + public RecurrenceRangeBaseType Item1 + { + get + { + return this.item1Field; + } + set + { + this.item1Field = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class AbsoluteMonthlyRecurrencePatternType : IntervalRecurrencePatternBaseType + { + + private int dayOfMonthField; + + /// + public int DayOfMonth + { + get + { + return this.dayOfMonthField; + } + set + { + this.dayOfMonthField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DailyRecurrencePatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WeeklyRecurrencePatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AbsoluteMonthlyRecurrencePatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RelativeMonthlyRecurrencePatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegeneratingPatternBaseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(YearlyRegeneratingPatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MonthlyRegeneratingPatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WeeklyRegeneratingPatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DailyRegeneratingPatternType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class IntervalRecurrencePatternBaseType : RecurrencePatternBaseType + { + + private int intervalField; + + /// + public int Interval + { + get + { + return this.intervalField; + } + set + { + this.intervalField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AbsoluteYearlyRecurrencePatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RelativeYearlyRecurrencePatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IntervalRecurrencePatternBaseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DailyRecurrencePatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WeeklyRecurrencePatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AbsoluteMonthlyRecurrencePatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RelativeMonthlyRecurrencePatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RegeneratingPatternBaseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(YearlyRegeneratingPatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MonthlyRegeneratingPatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WeeklyRegeneratingPatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DailyRegeneratingPatternType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class RecurrencePatternBaseType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class AbsoluteYearlyRecurrencePatternType : RecurrencePatternBaseType + { + + private int dayOfMonthField; + + private MonthNamesType monthField; + + /// + public int DayOfMonth + { + get + { + return this.dayOfMonthField; + } + set + { + this.dayOfMonthField = value; + } + } + + /// + public MonthNamesType Month + { + get + { + return this.monthField; + } + set + { + this.monthField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum MonthNamesType + { + + /// + January, + + /// + February, + + /// + March, + + /// + April, + + /// + May, + + /// + June, + + /// + July, + + /// + August, + + /// + September, + + /// + October, + + /// + November, + + /// + December, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class RelativeYearlyRecurrencePatternType : RecurrencePatternBaseType + { + + private string daysOfWeekField; + + private DayOfWeekIndexType dayOfWeekIndexField; + + private MonthNamesType monthField; + + /// + public string DaysOfWeek + { + get + { + return this.daysOfWeekField; + } + set + { + this.daysOfWeekField = value; + } + } + + /// + public DayOfWeekIndexType DayOfWeekIndex + { + get + { + return this.dayOfWeekIndexField; + } + set + { + this.dayOfWeekIndexField = value; + } + } + + /// + public MonthNamesType Month + { + get + { + return this.monthField; + } + set + { + this.monthField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum DayOfWeekIndexType + { + + /// + First, + + /// + Second, + + /// + Third, + + /// + Fourth, + + /// + Last, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class DailyRecurrencePatternType : IntervalRecurrencePatternBaseType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class WeeklyRecurrencePatternType : IntervalRecurrencePatternBaseType + { + + private string daysOfWeekField; + + /// + public string DaysOfWeek + { + get + { + return this.daysOfWeekField; + } + set + { + this.daysOfWeekField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class RelativeMonthlyRecurrencePatternType : IntervalRecurrencePatternBaseType + { + + private DayOfWeekType daysOfWeekField; + + private DayOfWeekIndexType dayOfWeekIndexField; + + /// + public DayOfWeekType DaysOfWeek + { + get + { + return this.daysOfWeekField; + } + set + { + this.daysOfWeekField = value; + } + } + + /// + public DayOfWeekIndexType DayOfWeekIndex + { + get + { + return this.dayOfWeekIndexField; + } + set + { + this.dayOfWeekIndexField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum DayOfWeekType + { + + /// + Sunday, + + /// + Monday, + + /// + Tuesday, + + /// + Wednesday, + + /// + Thursday, + + /// + Friday, + + /// + Saturday, + + /// + Day, + + /// + Weekday, + + /// + WeekendDay, + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(YearlyRegeneratingPatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MonthlyRegeneratingPatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(WeeklyRegeneratingPatternType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DailyRegeneratingPatternType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class RegeneratingPatternBaseType : IntervalRecurrencePatternBaseType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class YearlyRegeneratingPatternType : RegeneratingPatternBaseType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class MonthlyRegeneratingPatternType : RegeneratingPatternBaseType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class WeeklyRegeneratingPatternType : RegeneratingPatternBaseType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class DailyRegeneratingPatternType : RegeneratingPatternBaseType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class EndDateRecurrenceRangeType : RecurrenceRangeBaseType + { + + private System.DateTime endDateField; + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType = "date")] + public System.DateTime EndDate + { + get + { + return this.endDateField; + } + set + { + this.endDateField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NumberedRecurrenceRangeType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(EndDateRecurrenceRangeType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NoEndRecurrenceRangeType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class RecurrenceRangeBaseType + { + + private System.DateTime startDateField; + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType = "date")] + public System.DateTime StartDate + { + get + { + return this.startDateField; + } + set + { + this.startDateField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class NumberedRecurrenceRangeType : RecurrenceRangeBaseType + { + + private int numberOfOccurrencesField; + + /// + public int NumberOfOccurrences + { + get + { + return this.numberOfOccurrencesField; + } + set + { + this.numberOfOccurrencesField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class NoEndRecurrenceRangeType : RecurrenceRangeBaseType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class OccurrenceInfoType + { + + private ItemIdType itemIdField; + + private System.DateTime startField; + + private System.DateTime endField; + + private System.DateTime originalStartField; + + /// + public ItemIdType ItemId + { + get + { + return this.itemIdField; + } + set + { + this.itemIdField = value; + } + } + + /// + public System.DateTime Start + { + get + { + return this.startField; + } + set + { + this.startField = value; + } + } + + /// + public System.DateTime End + { + get + { + return this.endField; + } + set + { + this.endField = value; + } + } + + /// + public System.DateTime OriginalStart + { + get + { + return this.originalStartField; + } + set + { + this.originalStartField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class DeletedOccurrenceInfoType + { + + private System.DateTime startField; + + /// + public System.DateTime Start + { + get + { + return this.startField; + } + set + { + this.startField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class TimeZoneType + { + + private string baseOffsetField; + + private TimeChangeType standardField; + + private TimeChangeType daylightField; + + private string timeZoneNameField; + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType = "duration")] + public string BaseOffset + { + get + { + return this.baseOffsetField; + } + set + { + this.baseOffsetField = value; + } + } + + /// + public TimeChangeType Standard + { + get + { + return this.standardField; + } + set + { + this.standardField = value; + } + } + + /// + public TimeChangeType Daylight + { + get + { + return this.daylightField; + } + set + { + this.daylightField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string TimeZoneName + { + get + { + return this.timeZoneNameField; + } + set + { + this.timeZoneNameField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class TimeChangeType + { + + private string offsetField; + + private object itemField; + + private System.DateTime timeField; + + private string timeZoneNameField; + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType = "duration")] + public string Offset + { + get + { + return this.offsetField; + } + set + { + this.offsetField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("AbsoluteDate", typeof(System.DateTime), DataType = "date")] + [System.Xml.Serialization.XmlElementAttribute("RelativeYearlyRecurrence", typeof(RelativeYearlyRecurrencePatternType))] + public object Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType = "time")] + public System.DateTime Time + { + get + { + return this.timeField; + } + set + { + this.timeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string TimeZoneName + { + get + { + return this.timeZoneNameField; + } + set + { + this.timeZoneNameField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class PostItemType : ItemType + { + + private byte[] conversationIndexField; + + private string conversationTopicField; + + private SingleRecipientType fromField; + + private string internetMessageIdField; + + private bool isReadField; + + private bool isReadFieldSpecified; + + private System.DateTime postedTimeField; + + private bool postedTimeFieldSpecified; + + private string referencesField; + + private SingleRecipientType senderField; + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary")] + public byte[] ConversationIndex + { + get + { + return this.conversationIndexField; + } + set + { + this.conversationIndexField = value; + } + } + + /// + public string ConversationTopic + { + get + { + return this.conversationTopicField; + } + set + { + this.conversationTopicField = value; + } + } + + /// + public SingleRecipientType From + { + get + { + return this.fromField; + } + set + { + this.fromField = value; + } + } + + /// + public string InternetMessageId + { + get + { + return this.internetMessageIdField; + } + set + { + this.internetMessageIdField = value; + } + } + + /// + public bool IsRead + { + get + { + return this.isReadField; + } + set + { + this.isReadField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsReadSpecified + { + get + { + return this.isReadFieldSpecified; + } + set + { + this.isReadFieldSpecified = value; + } + } + + /// + public System.DateTime PostedTime + { + get + { + return this.postedTimeField; + } + set + { + this.postedTimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool PostedTimeSpecified + { + get + { + return this.postedTimeFieldSpecified; + } + set + { + this.postedTimeFieldSpecified = value; + } + } + + /// + public string References + { + get + { + return this.referencesField; + } + set + { + this.referencesField = value; + } + } + + /// + public SingleRecipientType Sender + { + get + { + return this.senderField; + } + set + { + this.senderField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class TaskType : ItemType + { + + private int actualWorkField; + + private bool actualWorkFieldSpecified; + + private System.DateTime assignedTimeField; + + private bool assignedTimeFieldSpecified; + + private string billingInformationField; + + private int changeCountField; + + private bool changeCountFieldSpecified; + + private string[] companiesField; + + private System.DateTime completeDateField; + + private bool completeDateFieldSpecified; + + private string[] contactsField; + + private TaskDelegateStateType delegationStateField; + + private bool delegationStateFieldSpecified; + + private string delegatorField; + + private System.DateTime dueDateField; + + private bool dueDateFieldSpecified; + + private int isAssignmentEditableField; + + private bool isAssignmentEditableFieldSpecified; + + private bool isCompleteField; + + private bool isCompleteFieldSpecified; + + private bool isRecurringField; + + private bool isRecurringFieldSpecified; + + private bool isTeamTaskField; + + private bool isTeamTaskFieldSpecified; + + private string mileageField; + + private string ownerField; + + private double percentCompleteField; + + private bool percentCompleteFieldSpecified; + + private TaskRecurrenceType recurrenceField; + + private System.DateTime startDateField; + + private bool startDateFieldSpecified; + + private TaskStatusType statusField; + + private bool statusFieldSpecified; + + private string statusDescriptionField; + + private int totalWorkField; + + private bool totalWorkFieldSpecified; + + /// + public int ActualWork + { + get + { + return this.actualWorkField; + } + set + { + this.actualWorkField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ActualWorkSpecified + { + get + { + return this.actualWorkFieldSpecified; + } + set + { + this.actualWorkFieldSpecified = value; + } + } + + /// + public System.DateTime AssignedTime + { + get + { + return this.assignedTimeField; + } + set + { + this.assignedTimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AssignedTimeSpecified + { + get + { + return this.assignedTimeFieldSpecified; + } + set + { + this.assignedTimeFieldSpecified = value; + } + } + + /// + public string BillingInformation + { + get + { + return this.billingInformationField; + } + set + { + this.billingInformationField = value; + } + } + + /// + public int ChangeCount + { + get + { + return this.changeCountField; + } + set + { + this.changeCountField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ChangeCountSpecified + { + get + { + return this.changeCountFieldSpecified; + } + set + { + this.changeCountFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("String", IsNullable = false)] + public string[] Companies + { + get + { + return this.companiesField; + } + set + { + this.companiesField = value; + } + } + + /// + public System.DateTime CompleteDate + { + get + { + return this.completeDateField; + } + set + { + this.completeDateField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool CompleteDateSpecified + { + get + { + return this.completeDateFieldSpecified; + } + set + { + this.completeDateFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("String", IsNullable = false)] + public string[] Contacts + { + get + { + return this.contactsField; + } + set + { + this.contactsField = value; + } + } + + /// + public TaskDelegateStateType DelegationState + { + get + { + return this.delegationStateField; + } + set + { + this.delegationStateField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DelegationStateSpecified + { + get + { + return this.delegationStateFieldSpecified; + } + set + { + this.delegationStateFieldSpecified = value; + } + } + + /// + public string Delegator + { + get + { + return this.delegatorField; + } + set + { + this.delegatorField = value; + } + } + + /// + public System.DateTime DueDate + { + get + { + return this.dueDateField; + } + set + { + this.dueDateField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DueDateSpecified + { + get + { + return this.dueDateFieldSpecified; + } + set + { + this.dueDateFieldSpecified = value; + } + } + + /// + public int IsAssignmentEditable + { + get + { + return this.isAssignmentEditableField; + } + set + { + this.isAssignmentEditableField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsAssignmentEditableSpecified + { + get + { + return this.isAssignmentEditableFieldSpecified; + } + set + { + this.isAssignmentEditableFieldSpecified = value; + } + } + + /// + public bool IsComplete + { + get + { + return this.isCompleteField; + } + set + { + this.isCompleteField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsCompleteSpecified + { + get + { + return this.isCompleteFieldSpecified; + } + set + { + this.isCompleteFieldSpecified = value; + } + } + + /// + public bool IsRecurring + { + get + { + return this.isRecurringField; + } + set + { + this.isRecurringField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsRecurringSpecified + { + get + { + return this.isRecurringFieldSpecified; + } + set + { + this.isRecurringFieldSpecified = value; + } + } + + /// + public bool IsTeamTask + { + get + { + return this.isTeamTaskField; + } + set + { + this.isTeamTaskField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsTeamTaskSpecified + { + get + { + return this.isTeamTaskFieldSpecified; + } + set + { + this.isTeamTaskFieldSpecified = value; + } + } + + /// + public string Mileage + { + get + { + return this.mileageField; + } + set + { + this.mileageField = value; + } + } + + /// + public string Owner + { + get + { + return this.ownerField; + } + set + { + this.ownerField = value; + } + } + + /// + public double PercentComplete + { + get + { + return this.percentCompleteField; + } + set + { + this.percentCompleteField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool PercentCompleteSpecified + { + get + { + return this.percentCompleteFieldSpecified; + } + set + { + this.percentCompleteFieldSpecified = value; + } + } + + /// + public TaskRecurrenceType Recurrence + { + get + { + return this.recurrenceField; + } + set + { + this.recurrenceField = value; + } + } + + /// + public System.DateTime StartDate + { + get + { + return this.startDateField; + } + set + { + this.startDateField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool StartDateSpecified + { + get + { + return this.startDateFieldSpecified; + } + set + { + this.startDateFieldSpecified = value; + } + } + + /// + public TaskStatusType Status + { + get + { + return this.statusField; + } + set + { + this.statusField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool StatusSpecified + { + get + { + return this.statusFieldSpecified; + } + set + { + this.statusFieldSpecified = value; + } + } + + /// + public string StatusDescription + { + get + { + return this.statusDescriptionField; + } + set + { + this.statusDescriptionField = value; + } + } + + /// + public int TotalWork + { + get + { + return this.totalWorkField; + } + set + { + this.totalWorkField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool TotalWorkSpecified + { + get + { + return this.totalWorkFieldSpecified; + } + set + { + this.totalWorkFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum TaskDelegateStateType + { + + /// + NoMatch, + + /// + OwnNew, + + /// + Owned, + + /// + Accepted, + + /// + Declined, + + /// + Max, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class TaskRecurrenceType + { + + private RecurrencePatternBaseType itemField; + + private RecurrenceRangeBaseType item1Field; + + /// + [System.Xml.Serialization.XmlElementAttribute("AbsoluteMonthlyRecurrence", typeof(AbsoluteMonthlyRecurrencePatternType))] + [System.Xml.Serialization.XmlElementAttribute("AbsoluteYearlyRecurrence", typeof(AbsoluteYearlyRecurrencePatternType))] + [System.Xml.Serialization.XmlElementAttribute("DailyRecurrence", typeof(DailyRecurrencePatternType))] + [System.Xml.Serialization.XmlElementAttribute("DailyRegeneration", typeof(DailyRegeneratingPatternType))] + [System.Xml.Serialization.XmlElementAttribute("MonthlyRegeneration", typeof(MonthlyRegeneratingPatternType))] + [System.Xml.Serialization.XmlElementAttribute("RelativeMonthlyRecurrence", typeof(RelativeMonthlyRecurrencePatternType))] + [System.Xml.Serialization.XmlElementAttribute("RelativeYearlyRecurrence", typeof(RelativeYearlyRecurrencePatternType))] + [System.Xml.Serialization.XmlElementAttribute("WeeklyRecurrence", typeof(WeeklyRecurrencePatternType))] + [System.Xml.Serialization.XmlElementAttribute("WeeklyRegeneration", typeof(WeeklyRegeneratingPatternType))] + [System.Xml.Serialization.XmlElementAttribute("YearlyRegeneration", typeof(YearlyRegeneratingPatternType))] + public RecurrencePatternBaseType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("EndDateRecurrence", typeof(EndDateRecurrenceRangeType))] + [System.Xml.Serialization.XmlElementAttribute("NoEndRecurrence", typeof(NoEndRecurrenceRangeType))] + [System.Xml.Serialization.XmlElementAttribute("NumberedRecurrence", typeof(NumberedRecurrenceRangeType))] + public RecurrenceRangeBaseType Item1 + { + get + { + return this.item1Field; + } + set + { + this.item1Field = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum TaskStatusType + { + + /// + NotStarted, + + /// + InProgress, + + /// + Completed, + + /// + WaitingOnOthers, + + /// + Deferred, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum ImportanceChoicesType + { + + /// + Low, + + /// + Normal, + + /// + High, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class InternetHeaderType + { + + private string headerNameField; + + private string valueField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string HeaderName + { + get + { + return this.headerNameField; + } + set + { + this.headerNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class CancelCalendarItemType : SmartResponseType + { + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CancelCalendarItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForwardItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReplyAllToItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReplyToItemType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SmartResponseType : SmartResponseBaseType + { + + private BodyType newBodyContentField; + + /// + public BodyType NewBodyContent + { + get + { + return this.newBodyContentField; + } + set + { + this.newBodyContentField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SmartResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CancelCalendarItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ForwardItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReplyAllToItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ReplyToItemType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SmartResponseBaseType : ResponseObjectType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ForwardItemType : SmartResponseType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ReplyAllToItemType : SmartResponseType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ReplyToItemType : SmartResponseType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class DeclineItemType : WellKnownResponseObjectType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class PostReplyItemType : PostReplyItemBaseType + { + + private BodyType newBodyContentField; + + /// + public BodyType NewBodyContent + { + get + { + return this.newBodyContentField; + } + set + { + this.newBodyContentField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PostReplyItemType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class PostReplyItemBaseType : ResponseObjectType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class RemoveItemType : ResponseObjectType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SuppressReadReceiptType : ReferenceItemResponseType + { + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SuppressReadReceiptType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ReferenceItemResponseType : ResponseObjectType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class TentativelyAcceptItemType : WellKnownResponseObjectType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ExtendedPropertyType + { + + private PathToExtendedFieldType extendedFieldURIField; + + private object itemField; + + /// + public PathToExtendedFieldType ExtendedFieldURI + { + get + { + return this.extendedFieldURIField; + } + set + { + this.extendedFieldURIField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("Value", typeof(string))] + [System.Xml.Serialization.XmlElementAttribute("Values", typeof(NonEmptyArrayOfPropertyValuesType))] + public object Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class PathToExtendedFieldType : BasePathToElementType + { + + private DistinguishedPropertySetType distinguishedPropertySetIdField; + + private bool distinguishedPropertySetIdFieldSpecified; + + private string propertySetIdField; + + private string propertyTagField; + + private string propertyNameField; + + private int propertyIdField; + + private bool propertyIdFieldSpecified; + + private MapiPropertyTypeType propertyTypeField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public DistinguishedPropertySetType DistinguishedPropertySetId + { + get + { + return this.distinguishedPropertySetIdField; + } + set + { + this.distinguishedPropertySetIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DistinguishedPropertySetIdSpecified + { + get + { + return this.distinguishedPropertySetIdFieldSpecified; + } + set + { + this.distinguishedPropertySetIdFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string PropertySetId + { + get + { + return this.propertySetIdField; + } + set + { + this.propertySetIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string PropertyTag + { + get + { + return this.propertyTagField; + } + set + { + this.propertyTagField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string PropertyName + { + get + { + return this.propertyNameField; + } + set + { + this.propertyNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int PropertyId + { + get + { + return this.propertyIdField; + } + set + { + this.propertyIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool PropertyIdSpecified + { + get + { + return this.propertyIdFieldSpecified; + } + set + { + this.propertyIdFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public MapiPropertyTypeType PropertyType + { + get + { + return this.propertyTypeField; + } + set + { + this.propertyTypeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum DistinguishedPropertySetType + { + + /// + Meeting, + + /// + Appointment, + + /// + Common, + + /// + PublicStrings, + + /// + Address, + + /// + InternetHeaders, + + /// + CalendarAssistant, + + /// + UnifiedMessaging, + + /// + Task, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum MapiPropertyTypeType + { + + /// + ApplicationTime, + + /// + ApplicationTimeArray, + + /// + Binary, + + /// + BinaryArray, + + /// + Boolean, + + /// + CLSID, + + /// + CLSIDArray, + + /// + Currency, + + /// + CurrencyArray, + + /// + Double, + + /// + DoubleArray, + + /// + Error, + + /// + Float, + + /// + FloatArray, + + /// + Integer, + + /// + IntegerArray, + + /// + Long, + + /// + LongArray, + + /// + Null, + + /// + Object, + + /// + ObjectArray, + + /// + Short, + + /// + ShortArray, + + /// + SystemTime, + + /// + SystemTimeArray, + + /// + String, + + /// + StringArray, + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PathToExtendedFieldType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PathToExceptionFieldType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PathToIndexedFieldType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PathToUnindexedFieldType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class BasePathToElementType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class PathToExceptionFieldType : BasePathToElementType + { + + private ExceptionPropertyURIType fieldURIField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public ExceptionPropertyURIType FieldURI + { + get + { + return this.fieldURIField; + } + set + { + this.fieldURIField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum ExceptionPropertyURIType + { + + /// + [System.Xml.Serialization.XmlEnumAttribute("attachment:Name")] + attachmentName, + + /// + [System.Xml.Serialization.XmlEnumAttribute("attachment:ContentType")] + attachmentContentType, + + /// + [System.Xml.Serialization.XmlEnumAttribute("attachment:Content")] + attachmentContent, + + /// + [System.Xml.Serialization.XmlEnumAttribute("recurrence:Month")] + recurrenceMonth, + + /// + [System.Xml.Serialization.XmlEnumAttribute("recurrence:DayOfWeekIndex")] + recurrenceDayOfWeekIndex, + + /// + [System.Xml.Serialization.XmlEnumAttribute("recurrence:DaysOfWeek")] + recurrenceDaysOfWeek, + + /// + [System.Xml.Serialization.XmlEnumAttribute("recurrence:DayOfMonth")] + recurrenceDayOfMonth, + + /// + [System.Xml.Serialization.XmlEnumAttribute("recurrence:Interval")] + recurrenceInterval, + + /// + [System.Xml.Serialization.XmlEnumAttribute("recurrence:NumberOfOccurrences")] + recurrenceNumberOfOccurrences, + + /// + [System.Xml.Serialization.XmlEnumAttribute("timezone:Offset")] + timezoneOffset, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class PathToIndexedFieldType : BasePathToElementType + { + + private DictionaryURIType fieldURIField; + + private string fieldIndexField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public DictionaryURIType FieldURI + { + get + { + return this.fieldURIField; + } + set + { + this.fieldURIField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string FieldIndex + { + get + { + return this.fieldIndexField; + } + set + { + this.fieldIndexField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum DictionaryURIType + { + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:InternetMessageHeader")] + itemInternetMessageHeader, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:ImAddress")] + contactsImAddress, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:PhysicalAddress:Street")] + contactsPhysicalAddressStreet, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:PhysicalAddress:City")] + contactsPhysicalAddressCity, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:PhysicalAddress:State")] + contactsPhysicalAddressState, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:PhysicalAddress:CountryOrRegion")] + contactsPhysicalAddressCountryOrRegion, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:PhysicalAddress:PostalCode")] + contactsPhysicalAddressPostalCode, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:PhoneNumber")] + contactsPhoneNumber, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:EmailAddress")] + contactsEmailAddress, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class PathToUnindexedFieldType : BasePathToElementType + { + + private UnindexedFieldURIType fieldURIField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public UnindexedFieldURIType FieldURI + { + get + { + return this.fieldURIField; + } + set + { + this.fieldURIField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum UnindexedFieldURIType + { + + /// + [System.Xml.Serialization.XmlEnumAttribute("folder:FolderId")] + folderFolderId, + + /// + [System.Xml.Serialization.XmlEnumAttribute("folder:ParentFolderId")] + folderParentFolderId, + + /// + [System.Xml.Serialization.XmlEnumAttribute("folder:DisplayName")] + folderDisplayName, + + /// + [System.Xml.Serialization.XmlEnumAttribute("folder:UnreadCount")] + folderUnreadCount, + + /// + [System.Xml.Serialization.XmlEnumAttribute("folder:TotalCount")] + folderTotalCount, + + /// + [System.Xml.Serialization.XmlEnumAttribute("folder:ChildFolderCount")] + folderChildFolderCount, + + /// + [System.Xml.Serialization.XmlEnumAttribute("folder:FolderClass")] + folderFolderClass, + + /// + [System.Xml.Serialization.XmlEnumAttribute("folder:SearchParameters")] + folderSearchParameters, + + /// + [System.Xml.Serialization.XmlEnumAttribute("folder:ManagedFolderInformation")] + folderManagedFolderInformation, + + /// + [System.Xml.Serialization.XmlEnumAttribute("folder:PermissionSet")] + folderPermissionSet, + + /// + [System.Xml.Serialization.XmlEnumAttribute("folder:EffectiveRights")] + folderEffectiveRights, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:ItemId")] + itemItemId, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:ParentFolderId")] + itemParentFolderId, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:ItemClass")] + itemItemClass, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:MimeContent")] + itemMimeContent, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:Attachments")] + itemAttachments, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:Subject")] + itemSubject, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:DateTimeReceived")] + itemDateTimeReceived, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:Size")] + itemSize, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:Categories")] + itemCategories, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:HasAttachments")] + itemHasAttachments, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:Importance")] + itemImportance, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:InReplyTo")] + itemInReplyTo, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:InternetMessageHeaders")] + itemInternetMessageHeaders, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:IsDraft")] + itemIsDraft, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:IsFromMe")] + itemIsFromMe, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:IsResend")] + itemIsResend, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:IsSubmitted")] + itemIsSubmitted, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:IsUnmodified")] + itemIsUnmodified, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:DateTimeSent")] + itemDateTimeSent, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:DateTimeCreated")] + itemDateTimeCreated, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:Body")] + itemBody, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:ResponseObjects")] + itemResponseObjects, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:Sensitivity")] + itemSensitivity, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:ReminderDueBy")] + itemReminderDueBy, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:ReminderIsSet")] + itemReminderIsSet, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:ReminderMinutesBeforeStart")] + itemReminderMinutesBeforeStart, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:DisplayTo")] + itemDisplayTo, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:DisplayCc")] + itemDisplayCc, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:Culture")] + itemCulture, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:EffectiveRights")] + itemEffectiveRights, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:LastModifiedName")] + itemLastModifiedName, + + /// + [System.Xml.Serialization.XmlEnumAttribute("item:LastModifiedTime")] + itemLastModifiedTime, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:ConversationIndex")] + messageConversationIndex, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:ConversationTopic")] + messageConversationTopic, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:InternetMessageId")] + messageInternetMessageId, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:IsRead")] + messageIsRead, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:IsResponseRequested")] + messageIsResponseRequested, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:IsReadReceiptRequested")] + messageIsReadReceiptRequested, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:IsDeliveryReceiptRequested")] + messageIsDeliveryReceiptRequested, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:ReceivedBy")] + messageReceivedBy, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:ReceivedRepresenting")] + messageReceivedRepresenting, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:References")] + messageReferences, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:ReplyTo")] + messageReplyTo, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:From")] + messageFrom, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:Sender")] + messageSender, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:ToRecipients")] + messageToRecipients, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:CcRecipients")] + messageCcRecipients, + + /// + [System.Xml.Serialization.XmlEnumAttribute("message:BccRecipients")] + messageBccRecipients, + + /// + [System.Xml.Serialization.XmlEnumAttribute("meeting:AssociatedCalendarItemId")] + meetingAssociatedCalendarItemId, + + /// + [System.Xml.Serialization.XmlEnumAttribute("meeting:IsDelegated")] + meetingIsDelegated, + + /// + [System.Xml.Serialization.XmlEnumAttribute("meeting:IsOutOfDate")] + meetingIsOutOfDate, + + /// + [System.Xml.Serialization.XmlEnumAttribute("meeting:HasBeenProcessed")] + meetingHasBeenProcessed, + + /// + [System.Xml.Serialization.XmlEnumAttribute("meeting:ResponseType")] + meetingResponseType, + + /// + [System.Xml.Serialization.XmlEnumAttribute("meetingRequest:MeetingRequestType")] + meetingRequestMeetingRequestType, + + /// + [System.Xml.Serialization.XmlEnumAttribute("meetingRequest:IntendedFreeBusyStatus")] + meetingRequestIntendedFreeBusyStatus, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:Start")] + calendarStart, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:End")] + calendarEnd, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:OriginalStart")] + calendarOriginalStart, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:IsAllDayEvent")] + calendarIsAllDayEvent, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:LegacyFreeBusyStatus")] + calendarLegacyFreeBusyStatus, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:Location")] + calendarLocation, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:When")] + calendarWhen, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:IsMeeting")] + calendarIsMeeting, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:IsCancelled")] + calendarIsCancelled, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:IsRecurring")] + calendarIsRecurring, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:MeetingRequestWasSent")] + calendarMeetingRequestWasSent, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:IsResponseRequested")] + calendarIsResponseRequested, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:CalendarItemType")] + calendarCalendarItemType, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:MyResponseType")] + calendarMyResponseType, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:Organizer")] + calendarOrganizer, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:RequiredAttendees")] + calendarRequiredAttendees, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:OptionalAttendees")] + calendarOptionalAttendees, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:Resources")] + calendarResources, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:ConflictingMeetingCount")] + calendarConflictingMeetingCount, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:AdjacentMeetingCount")] + calendarAdjacentMeetingCount, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:ConflictingMeetings")] + calendarConflictingMeetings, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:AdjacentMeetings")] + calendarAdjacentMeetings, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:Duration")] + calendarDuration, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:TimeZone")] + calendarTimeZone, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:AppointmentReplyTime")] + calendarAppointmentReplyTime, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:AppointmentSequenceNumber")] + calendarAppointmentSequenceNumber, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:AppointmentState")] + calendarAppointmentState, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:Recurrence")] + calendarRecurrence, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:FirstOccurrence")] + calendarFirstOccurrence, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:LastOccurrence")] + calendarLastOccurrence, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:ModifiedOccurrences")] + calendarModifiedOccurrences, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:DeletedOccurrences")] + calendarDeletedOccurrences, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:MeetingTimeZone")] + calendarMeetingTimeZone, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:ConferenceType")] + calendarConferenceType, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:AllowNewTimeProposal")] + calendarAllowNewTimeProposal, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:IsOnlineMeeting")] + calendarIsOnlineMeeting, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:MeetingWorkspaceUrl")] + calendarMeetingWorkspaceUrl, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:NetShowUrl")] + calendarNetShowUrl, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:UID")] + calendarUID, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:RecurrenceId")] + calendarRecurrenceId, + + /// + [System.Xml.Serialization.XmlEnumAttribute("calendar:DateTimeStamp")] + calendarDateTimeStamp, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:ActualWork")] + taskActualWork, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:AssignedTime")] + taskAssignedTime, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:BillingInformation")] + taskBillingInformation, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:ChangeCount")] + taskChangeCount, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:Companies")] + taskCompanies, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:CompleteDate")] + taskCompleteDate, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:Contacts")] + taskContacts, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:DelegationState")] + taskDelegationState, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:Delegator")] + taskDelegator, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:DueDate")] + taskDueDate, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:IsAssignmentEditable")] + taskIsAssignmentEditable, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:IsComplete")] + taskIsComplete, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:IsRecurring")] + taskIsRecurring, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:IsTeamTask")] + taskIsTeamTask, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:Mileage")] + taskMileage, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:Owner")] + taskOwner, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:PercentComplete")] + taskPercentComplete, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:Recurrence")] + taskRecurrence, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:StartDate")] + taskStartDate, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:Status")] + taskStatus, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:StatusDescription")] + taskStatusDescription, + + /// + [System.Xml.Serialization.XmlEnumAttribute("task:TotalWork")] + taskTotalWork, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:AssistantName")] + contactsAssistantName, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:Birthday")] + contactsBirthday, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:BusinessHomePage")] + contactsBusinessHomePage, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:Children")] + contactsChildren, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:Companies")] + contactsCompanies, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:CompanyName")] + contactsCompanyName, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:CompleteName")] + contactsCompleteName, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:ContactSource")] + contactsContactSource, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:Culture")] + contactsCulture, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:Department")] + contactsDepartment, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:DisplayName")] + contactsDisplayName, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:EmailAddresses")] + contactsEmailAddresses, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:FileAs")] + contactsFileAs, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:FileAsMapping")] + contactsFileAsMapping, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:Generation")] + contactsGeneration, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:GivenName")] + contactsGivenName, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:ImAddresses")] + contactsImAddresses, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:Initials")] + contactsInitials, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:JobTitle")] + contactsJobTitle, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:Manager")] + contactsManager, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:MiddleName")] + contactsMiddleName, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:Mileage")] + contactsMileage, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:Nickname")] + contactsNickname, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:OfficeLocation")] + contactsOfficeLocation, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:PhoneNumbers")] + contactsPhoneNumbers, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:PhysicalAddresses")] + contactsPhysicalAddresses, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:PostalAddressIndex")] + contactsPostalAddressIndex, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:Profession")] + contactsProfession, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:SpouseName")] + contactsSpouseName, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:Surname")] + contactsSurname, + + /// + [System.Xml.Serialization.XmlEnumAttribute("contacts:WeddingAnniversary")] + contactsWeddingAnniversary, + + /// + [System.Xml.Serialization.XmlEnumAttribute("postitem:PostedTime")] + postitemPostedTime, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class NonEmptyArrayOfPropertyValuesType + { + + private string[] itemsField; + + /// + [System.Xml.Serialization.XmlElementAttribute("Value")] + public string[] Items + { + get + { + return this.itemsField; + } + set + { + this.itemsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class EffectiveRightsType + { + + private bool createAssociatedField; + + private bool createContentsField; + + private bool createHierarchyField; + + private bool deleteField; + + private bool modifyField; + + private bool readField; + + /// + public bool CreateAssociated + { + get + { + return this.createAssociatedField; + } + set + { + this.createAssociatedField = value; + } + } + + /// + public bool CreateContents + { + get + { + return this.createContentsField; + } + set + { + this.createContentsField = value; + } + } + + /// + public bool CreateHierarchy + { + get + { + return this.createHierarchyField; + } + set + { + this.createHierarchyField = value; + } + } + + /// + public bool Delete + { + get + { + return this.deleteField; + } + set + { + this.deleteField = value; + } + } + + /// + public bool Modify + { + get + { + return this.modifyField; + } + set + { + this.modifyField = value; + } + } + + /// + public bool Read + { + get + { + return this.readField; + } + set + { + this.readField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class DistributionListType : ItemType + { + + private string displayNameField; + + private string fileAsField; + + private ContactSourceType contactSourceField; + + private bool contactSourceFieldSpecified; + + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameField = value; + } + } + + /// + public string FileAs + { + get + { + return this.fileAsField; + } + set + { + this.fileAsField = value; + } + } + + /// + public ContactSourceType ContactSource + { + get + { + return this.contactSourceField; + } + set + { + this.contactSourceField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ContactSourceSpecified + { + get + { + return this.contactSourceFieldSpecified; + } + set + { + this.contactSourceFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SyncFolderItemsDeleteType + { + + private ItemIdType itemIdField; + + /// + public ItemIdType ItemId + { + get + { + return this.itemIdField; + } + set + { + this.itemIdField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SyncFolderItemsReadFlagType + { + + private ItemIdType itemIdField; + + private bool isReadField; + + /// + public ItemIdType ItemId + { + get + { + return this.itemIdField; + } + set + { + this.itemIdField = value; + } + } + + /// + public bool IsRead + { + get + { + return this.isReadField; + } + set + { + this.isReadField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IncludeInSchema = false)] + public enum ItemsChoiceType2 + { + + /// + Create, + + /// + Delete, + + /// + ReadFlagChange, + + /// + Update, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SyncFolderHierarchyResponseMessageType : ResponseMessageType + { + + private string syncStateField; + + private bool includesLastFolderInRangeField; + + private bool includesLastFolderInRangeFieldSpecified; + + private SyncFolderHierarchyChangesType changesField; + + /// + public string SyncState + { + get + { + return this.syncStateField; + } + set + { + this.syncStateField = value; + } + } + + /// + public bool IncludesLastFolderInRange + { + get + { + return this.includesLastFolderInRangeField; + } + set + { + this.includesLastFolderInRangeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IncludesLastFolderInRangeSpecified + { + get + { + return this.includesLastFolderInRangeFieldSpecified; + } + set + { + this.includesLastFolderInRangeFieldSpecified = value; + } + } + + /// + public SyncFolderHierarchyChangesType Changes + { + get + { + return this.changesField; + } + set + { + this.changesField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SyncFolderHierarchyChangesType + { + + private object[] itemsField; + + private ItemsChoiceType1[] itemsElementNameField; + + /// + [System.Xml.Serialization.XmlElementAttribute("Create", typeof(SyncFolderHierarchyCreateOrUpdateType))] + [System.Xml.Serialization.XmlElementAttribute("Delete", typeof(SyncFolderHierarchyDeleteType))] + [System.Xml.Serialization.XmlElementAttribute("Update", typeof(SyncFolderHierarchyCreateOrUpdateType))] + [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")] + public object[] Items + { + get + { + return this.itemsField; + } + set + { + this.itemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("ItemsElementName")] + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ItemsChoiceType1[] ItemsElementName + { + get + { + return this.itemsElementNameField; + } + set + { + this.itemsElementNameField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SyncFolderHierarchyCreateOrUpdateType + { + + private BaseFolderType itemField; + + /// + [System.Xml.Serialization.XmlElementAttribute("CalendarFolder", typeof(CalendarFolderType))] + [System.Xml.Serialization.XmlElementAttribute("ContactsFolder", typeof(ContactsFolderType))] + [System.Xml.Serialization.XmlElementAttribute("Folder", typeof(FolderType))] + [System.Xml.Serialization.XmlElementAttribute("SearchFolder", typeof(SearchFolderType))] + [System.Xml.Serialization.XmlElementAttribute("TasksFolder", typeof(TasksFolderType))] + public BaseFolderType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class CalendarFolderType : BaseFolderType + { + + private CalendarPermissionSetType permissionSetField; + + /// + public CalendarPermissionSetType PermissionSet + { + get + { + return this.permissionSetField; + } + set + { + this.permissionSetField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class CalendarPermissionSetType + { + + private CalendarPermissionType[] calendarPermissionsField; + + private string[] unknownEntriesField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("CalendarPermission", IsNullable = false)] + public CalendarPermissionType[] CalendarPermissions + { + get + { + return this.calendarPermissionsField; + } + set + { + this.calendarPermissionsField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("UnknownEntry", IsNullable = false)] + public string[] UnknownEntries + { + get + { + return this.unknownEntriesField; + } + set + { + this.unknownEntriesField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class CalendarPermissionType : BasePermissionType + { + + private CalendarPermissionReadAccessType readItemsField; + + private bool readItemsFieldSpecified; + + private CalendarPermissionLevelType calendarPermissionLevelField; + + /// + public CalendarPermissionReadAccessType ReadItems + { + get + { + return this.readItemsField; + } + set + { + this.readItemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ReadItemsSpecified + { + get + { + return this.readItemsFieldSpecified; + } + set + { + this.readItemsFieldSpecified = value; + } + } + + /// + public CalendarPermissionLevelType CalendarPermissionLevel + { + get + { + return this.calendarPermissionLevelField; + } + set + { + this.calendarPermissionLevelField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum CalendarPermissionReadAccessType + { + + /// + None, + + /// + TimeOnly, + + /// + TimeAndSubjectAndLocation, + + /// + FullDetails, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum CalendarPermissionLevelType + { + + /// + None, + + /// + Owner, + + /// + PublishingEditor, + + /// + Editor, + + /// + PublishingAuthor, + + /// + Author, + + /// + NoneditingAuthor, + + /// + Reviewer, + + /// + Contributor, + + /// + FreeBusyTimeOnly, + + /// + FreeBusyTimeAndSubjectAndLocation, + + /// + Custom, + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CalendarPermissionType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PermissionType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class BasePermissionType + { + + private UserIdType userIdField; + + private bool canCreateItemsField; + + private bool canCreateItemsFieldSpecified; + + private bool canCreateSubFoldersField; + + private bool canCreateSubFoldersFieldSpecified; + + private bool isFolderOwnerField; + + private bool isFolderOwnerFieldSpecified; + + private bool isFolderVisibleField; + + private bool isFolderVisibleFieldSpecified; + + private bool isFolderContactField; + + private bool isFolderContactFieldSpecified; + + private PermissionActionType editItemsField; + + private bool editItemsFieldSpecified; + + private PermissionActionType deleteItemsField; + + private bool deleteItemsFieldSpecified; + + /// + public UserIdType UserId + { + get + { + return this.userIdField; + } + set + { + this.userIdField = value; + } + } + + /// + public bool CanCreateItems + { + get + { + return this.canCreateItemsField; + } + set + { + this.canCreateItemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool CanCreateItemsSpecified + { + get + { + return this.canCreateItemsFieldSpecified; + } + set + { + this.canCreateItemsFieldSpecified = value; + } + } + + /// + public bool CanCreateSubFolders + { + get + { + return this.canCreateSubFoldersField; + } + set + { + this.canCreateSubFoldersField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool CanCreateSubFoldersSpecified + { + get + { + return this.canCreateSubFoldersFieldSpecified; + } + set + { + this.canCreateSubFoldersFieldSpecified = value; + } + } + + /// + public bool IsFolderOwner + { + get + { + return this.isFolderOwnerField; + } + set + { + this.isFolderOwnerField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsFolderOwnerSpecified + { + get + { + return this.isFolderOwnerFieldSpecified; + } + set + { + this.isFolderOwnerFieldSpecified = value; + } + } + + /// + public bool IsFolderVisible + { + get + { + return this.isFolderVisibleField; + } + set + { + this.isFolderVisibleField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsFolderVisibleSpecified + { + get + { + return this.isFolderVisibleFieldSpecified; + } + set + { + this.isFolderVisibleFieldSpecified = value; + } + } + + /// + public bool IsFolderContact + { + get + { + return this.isFolderContactField; + } + set + { + this.isFolderContactField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsFolderContactSpecified + { + get + { + return this.isFolderContactFieldSpecified; + } + set + { + this.isFolderContactFieldSpecified = value; + } + } + + /// + public PermissionActionType EditItems + { + get + { + return this.editItemsField; + } + set + { + this.editItemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool EditItemsSpecified + { + get + { + return this.editItemsFieldSpecified; + } + set + { + this.editItemsFieldSpecified = value; + } + } + + /// + public PermissionActionType DeleteItems + { + get + { + return this.deleteItemsField; + } + set + { + this.deleteItemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DeleteItemsSpecified + { + get + { + return this.deleteItemsFieldSpecified; + } + set + { + this.deleteItemsFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum PermissionActionType + { + + /// + None, + + /// + Owned, + + /// + All, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class PermissionType : BasePermissionType + { + + private PermissionReadAccessType readItemsField; + + private bool readItemsFieldSpecified; + + private PermissionLevelType permissionLevelField; + + /// + public PermissionReadAccessType ReadItems + { + get + { + return this.readItemsField; + } + set + { + this.readItemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ReadItemsSpecified + { + get + { + return this.readItemsFieldSpecified; + } + set + { + this.readItemsFieldSpecified = value; + } + } + + /// + public PermissionLevelType PermissionLevel + { + get + { + return this.permissionLevelField; + } + set + { + this.permissionLevelField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum PermissionReadAccessType + { + + /// + None, + + /// + FullDetails, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum PermissionLevelType + { + + /// + None, + + /// + Owner, + + /// + PublishingEditor, + + /// + Editor, + + /// + PublishingAuthor, + + /// + Author, + + /// + NoneditingAuthor, + + /// + Reviewer, + + /// + Contributor, + + /// + Custom, + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContactsFolderType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CalendarFolderType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FolderType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TasksFolderType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchFolderType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class BaseFolderType + { + + private FolderIdType folderIdField; + + private FolderIdType parentFolderIdField; + + private string folderClassField; + + private string displayNameField; + + private int totalCountField; + + private bool totalCountFieldSpecified; + + private int childFolderCountField; + + private bool childFolderCountFieldSpecified; + + private ExtendedPropertyType[] extendedPropertyField; + + private ManagedFolderInformationType managedFolderInformationField; + + private EffectiveRightsType effectiveRightsField; + + /// + public FolderIdType FolderId + { + get + { + return this.folderIdField; + } + set + { + this.folderIdField = value; + } + } + + /// + public FolderIdType ParentFolderId + { + get + { + return this.parentFolderIdField; + } + set + { + this.parentFolderIdField = value; + } + } + + /// + public string FolderClass + { + get + { + return this.folderClassField; + } + set + { + this.folderClassField = value; + } + } + + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameField = value; + } + } + + /// + public int TotalCount + { + get + { + return this.totalCountField; + } + set + { + this.totalCountField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool TotalCountSpecified + { + get + { + return this.totalCountFieldSpecified; + } + set + { + this.totalCountFieldSpecified = value; + } + } + + /// + public int ChildFolderCount + { + get + { + return this.childFolderCountField; + } + set + { + this.childFolderCountField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ChildFolderCountSpecified + { + get + { + return this.childFolderCountFieldSpecified; + } + set + { + this.childFolderCountFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("ExtendedProperty")] + public ExtendedPropertyType[] ExtendedProperty + { + get + { + return this.extendedPropertyField; + } + set + { + this.extendedPropertyField = value; + } + } + + /// + public ManagedFolderInformationType ManagedFolderInformation + { + get + { + return this.managedFolderInformationField; + } + set + { + this.managedFolderInformationField = value; + } + } + + /// + public EffectiveRightsType EffectiveRights + { + get + { + return this.effectiveRightsField; + } + set + { + this.effectiveRightsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ManagedFolderInformationType + { + + private bool canDeleteField; + + private bool canDeleteFieldSpecified; + + private bool canRenameOrMoveField; + + private bool canRenameOrMoveFieldSpecified; + + private bool mustDisplayCommentField; + + private bool mustDisplayCommentFieldSpecified; + + private bool hasQuotaField; + + private bool hasQuotaFieldSpecified; + + private bool isManagedFoldersRootField; + + private bool isManagedFoldersRootFieldSpecified; + + private string managedFolderIdField; + + private string commentField; + + private int storageQuotaField; + + private bool storageQuotaFieldSpecified; + + private int folderSizeField; + + private bool folderSizeFieldSpecified; + + private string homePageField; + + /// + public bool CanDelete + { + get + { + return this.canDeleteField; + } + set + { + this.canDeleteField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool CanDeleteSpecified + { + get + { + return this.canDeleteFieldSpecified; + } + set + { + this.canDeleteFieldSpecified = value; + } + } + + /// + public bool CanRenameOrMove + { + get + { + return this.canRenameOrMoveField; + } + set + { + this.canRenameOrMoveField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool CanRenameOrMoveSpecified + { + get + { + return this.canRenameOrMoveFieldSpecified; + } + set + { + this.canRenameOrMoveFieldSpecified = value; + } + } + + /// + public bool MustDisplayComment + { + get + { + return this.mustDisplayCommentField; + } + set + { + this.mustDisplayCommentField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MustDisplayCommentSpecified + { + get + { + return this.mustDisplayCommentFieldSpecified; + } + set + { + this.mustDisplayCommentFieldSpecified = value; + } + } + + /// + public bool HasQuota + { + get + { + return this.hasQuotaField; + } + set + { + this.hasQuotaField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool HasQuotaSpecified + { + get + { + return this.hasQuotaFieldSpecified; + } + set + { + this.hasQuotaFieldSpecified = value; + } + } + + /// + public bool IsManagedFoldersRoot + { + get + { + return this.isManagedFoldersRootField; + } + set + { + this.isManagedFoldersRootField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IsManagedFoldersRootSpecified + { + get + { + return this.isManagedFoldersRootFieldSpecified; + } + set + { + this.isManagedFoldersRootFieldSpecified = value; + } + } + + /// + public string ManagedFolderId + { + get + { + return this.managedFolderIdField; + } + set + { + this.managedFolderIdField = value; + } + } + + /// + public string Comment + { + get + { + return this.commentField; + } + set + { + this.commentField = value; + } + } + + /// + public int StorageQuota + { + get + { + return this.storageQuotaField; + } + set + { + this.storageQuotaField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool StorageQuotaSpecified + { + get + { + return this.storageQuotaFieldSpecified; + } + set + { + this.storageQuotaFieldSpecified = value; + } + } + + /// + public int FolderSize + { + get + { + return this.folderSizeField; + } + set + { + this.folderSizeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool FolderSizeSpecified + { + get + { + return this.folderSizeFieldSpecified; + } + set + { + this.folderSizeFieldSpecified = value; + } + } + + /// + public string HomePage + { + get + { + return this.homePageField; + } + set + { + this.homePageField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ContactsFolderType : BaseFolderType + { + + private PermissionSetType permissionSetField; + + /// + public PermissionSetType PermissionSet + { + get + { + return this.permissionSetField; + } + set + { + this.permissionSetField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class PermissionSetType + { + + private PermissionType[] permissionsField; + + private string[] unknownEntriesField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("Permission", IsNullable = false)] + public PermissionType[] Permissions + { + get + { + return this.permissionsField; + } + set + { + this.permissionsField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("UnknownEntry", IsNullable = false)] + public string[] UnknownEntries + { + get + { + return this.unknownEntriesField; + } + set + { + this.unknownEntriesField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TasksFolderType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchFolderType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class FolderType : BaseFolderType + { + + private PermissionSetType permissionSetField; + + private int unreadCountField; + + private bool unreadCountFieldSpecified; + + /// + public PermissionSetType PermissionSet + { + get + { + return this.permissionSetField; + } + set + { + this.permissionSetField = value; + } + } + + /// + public int UnreadCount + { + get + { + return this.unreadCountField; + } + set + { + this.unreadCountField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool UnreadCountSpecified + { + get + { + return this.unreadCountFieldSpecified; + } + set + { + this.unreadCountFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class TasksFolderType : FolderType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SearchFolderType : FolderType + { + + private SearchParametersType searchParametersField; + + /// + public SearchParametersType SearchParameters + { + get + { + return this.searchParametersField; + } + set + { + this.searchParametersField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SearchParametersType + { + + private RestrictionType restrictionField; + + private BaseFolderIdType[] baseFolderIdsField; + + private SearchFolderTraversalType traversalField; + + private bool traversalFieldSpecified; + + /// + public RestrictionType Restriction + { + get + { + return this.restrictionField; + } + set + { + this.restrictionField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("DistinguishedFolderId", typeof(DistinguishedFolderIdType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("FolderId", typeof(FolderIdType), IsNullable = false)] + public BaseFolderIdType[] BaseFolderIds + { + get + { + return this.baseFolderIdsField; + } + set + { + this.baseFolderIdsField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public SearchFolderTraversalType Traversal + { + get + { + return this.traversalField; + } + set + { + this.traversalField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool TraversalSpecified + { + get + { + return this.traversalFieldSpecified; + } + set + { + this.traversalFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class RestrictionType + { + + private SearchExpressionType itemField; + + /// + [System.Xml.Serialization.XmlElementAttribute("And", typeof(AndType))] + [System.Xml.Serialization.XmlElementAttribute("Contains", typeof(ContainsExpressionType))] + [System.Xml.Serialization.XmlElementAttribute("Excludes", typeof(ExcludesType))] + [System.Xml.Serialization.XmlElementAttribute("Exists", typeof(ExistsType))] + [System.Xml.Serialization.XmlElementAttribute("IsEqualTo", typeof(IsEqualToType))] + [System.Xml.Serialization.XmlElementAttribute("IsGreaterThan", typeof(IsGreaterThanType))] + [System.Xml.Serialization.XmlElementAttribute("IsGreaterThanOrEqualTo", typeof(IsGreaterThanOrEqualToType))] + [System.Xml.Serialization.XmlElementAttribute("IsLessThan", typeof(IsLessThanType))] + [System.Xml.Serialization.XmlElementAttribute("IsLessThanOrEqualTo", typeof(IsLessThanOrEqualToType))] + [System.Xml.Serialization.XmlElementAttribute("IsNotEqualTo", typeof(IsNotEqualToType))] + [System.Xml.Serialization.XmlElementAttribute("Not", typeof(NotType))] + [System.Xml.Serialization.XmlElementAttribute("Or", typeof(OrType))] + [System.Xml.Serialization.XmlElementAttribute("SearchExpression", typeof(SearchExpressionType))] + public SearchExpressionType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class AndType : MultipleOperandBooleanExpressionType + { + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AndType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class MultipleOperandBooleanExpressionType : SearchExpressionType + { + + private SearchExpressionType[] itemsField; + + /// + [System.Xml.Serialization.XmlElementAttribute("And", typeof(AndType))] + [System.Xml.Serialization.XmlElementAttribute("Contains", typeof(ContainsExpressionType))] + [System.Xml.Serialization.XmlElementAttribute("Excludes", typeof(ExcludesType))] + [System.Xml.Serialization.XmlElementAttribute("Exists", typeof(ExistsType))] + [System.Xml.Serialization.XmlElementAttribute("IsEqualTo", typeof(IsEqualToType))] + [System.Xml.Serialization.XmlElementAttribute("IsGreaterThan", typeof(IsGreaterThanType))] + [System.Xml.Serialization.XmlElementAttribute("IsGreaterThanOrEqualTo", typeof(IsGreaterThanOrEqualToType))] + [System.Xml.Serialization.XmlElementAttribute("IsLessThan", typeof(IsLessThanType))] + [System.Xml.Serialization.XmlElementAttribute("IsLessThanOrEqualTo", typeof(IsLessThanOrEqualToType))] + [System.Xml.Serialization.XmlElementAttribute("IsNotEqualTo", typeof(IsNotEqualToType))] + [System.Xml.Serialization.XmlElementAttribute("Not", typeof(NotType))] + [System.Xml.Serialization.XmlElementAttribute("Or", typeof(OrType))] + [System.Xml.Serialization.XmlElementAttribute("SearchExpression", typeof(SearchExpressionType))] + public SearchExpressionType[] Items + { + get + { + return this.itemsField; + } + set + { + this.itemsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ContainsExpressionType : SearchExpressionType + { + + private BasePathToElementType itemField; + + private ConstantValueType constantField; + + private ContainmentModeType containmentModeField; + + private bool containmentModeFieldSpecified; + + private ContainmentComparisonType containmentComparisonField; + + private bool containmentComparisonFieldSpecified; + + /// + [System.Xml.Serialization.XmlElementAttribute("ExtendedFieldURI", typeof(PathToExtendedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("FieldURI", typeof(PathToUnindexedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("IndexedFieldURI", typeof(PathToIndexedFieldType))] + public BasePathToElementType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + public ConstantValueType Constant + { + get + { + return this.constantField; + } + set + { + this.constantField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public ContainmentModeType ContainmentMode + { + get + { + return this.containmentModeField; + } + set + { + this.containmentModeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ContainmentModeSpecified + { + get + { + return this.containmentModeFieldSpecified; + } + set + { + this.containmentModeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public ContainmentComparisonType ContainmentComparison + { + get + { + return this.containmentComparisonField; + } + set + { + this.containmentComparisonField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ContainmentComparisonSpecified + { + get + { + return this.containmentComparisonFieldSpecified; + } + set + { + this.containmentComparisonFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ConstantValueType + { + + private string valueField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum ContainmentModeType + { + + /// + FullString, + + /// + Prefixed, + + /// + Substring, + + /// + PrefixOnWords, + + /// + ExactPhrase, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum ContainmentComparisonType + { + + /// + Exact, + + /// + IgnoreCase, + + /// + IgnoreNonSpacingCharacters, + + /// + Loose, + + /// + IgnoreCaseAndNonSpacingCharacters, + + /// + LooseAndIgnoreCase, + + /// + LooseAndIgnoreNonSpace, + + /// + LooseAndIgnoreCaseAndIgnoreNonSpace, + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MultipleOperandBooleanExpressionType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(OrType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AndType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(NotType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContainsExpressionType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExcludesType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TwoOperandExpressionType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IsLessThanOrEqualToType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IsLessThanType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IsGreaterThanOrEqualToType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IsGreaterThanType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IsNotEqualToType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IsEqualToType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExistsType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class SearchExpressionType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class NotType : SearchExpressionType + { + + private SearchExpressionType itemField; + + /// + [System.Xml.Serialization.XmlElementAttribute("And", typeof(AndType))] + [System.Xml.Serialization.XmlElementAttribute("Contains", typeof(ContainsExpressionType))] + [System.Xml.Serialization.XmlElementAttribute("Excludes", typeof(ExcludesType))] + [System.Xml.Serialization.XmlElementAttribute("Exists", typeof(ExistsType))] + [System.Xml.Serialization.XmlElementAttribute("IsEqualTo", typeof(IsEqualToType))] + [System.Xml.Serialization.XmlElementAttribute("IsGreaterThan", typeof(IsGreaterThanType))] + [System.Xml.Serialization.XmlElementAttribute("IsGreaterThanOrEqualTo", typeof(IsGreaterThanOrEqualToType))] + [System.Xml.Serialization.XmlElementAttribute("IsLessThan", typeof(IsLessThanType))] + [System.Xml.Serialization.XmlElementAttribute("IsLessThanOrEqualTo", typeof(IsLessThanOrEqualToType))] + [System.Xml.Serialization.XmlElementAttribute("IsNotEqualTo", typeof(IsNotEqualToType))] + [System.Xml.Serialization.XmlElementAttribute("Not", typeof(NotType))] + [System.Xml.Serialization.XmlElementAttribute("Or", typeof(OrType))] + [System.Xml.Serialization.XmlElementAttribute("SearchExpression", typeof(SearchExpressionType))] + public SearchExpressionType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ExcludesType : SearchExpressionType + { + + private BasePathToElementType itemField; + + private ExcludesValueType bitmaskField; + + /// + [System.Xml.Serialization.XmlElementAttribute("ExtendedFieldURI", typeof(PathToExtendedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("FieldURI", typeof(PathToUnindexedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("IndexedFieldURI", typeof(PathToIndexedFieldType))] + public BasePathToElementType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + public ExcludesValueType Bitmask + { + get + { + return this.bitmaskField; + } + set + { + this.bitmaskField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ExcludesValueType + { + + private string valueField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ExistsType : SearchExpressionType + { + + private BasePathToElementType itemField; + + /// + [System.Xml.Serialization.XmlElementAttribute("ExtendedFieldURI", typeof(PathToExtendedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("FieldURI", typeof(PathToUnindexedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("IndexedFieldURI", typeof(PathToIndexedFieldType))] + public BasePathToElementType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class IsEqualToType : TwoOperandExpressionType + { + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IsLessThanOrEqualToType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IsLessThanType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IsGreaterThanOrEqualToType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IsGreaterThanType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IsNotEqualToType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IsEqualToType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class TwoOperandExpressionType : SearchExpressionType + { + + private BasePathToElementType itemField; + + private FieldURIOrConstantType fieldURIOrConstantField; + + /// + [System.Xml.Serialization.XmlElementAttribute("ExtendedFieldURI", typeof(PathToExtendedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("FieldURI", typeof(PathToUnindexedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("IndexedFieldURI", typeof(PathToIndexedFieldType))] + public BasePathToElementType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + public FieldURIOrConstantType FieldURIOrConstant + { + get + { + return this.fieldURIOrConstantField; + } + set + { + this.fieldURIOrConstantField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class FieldURIOrConstantType + { + + private object itemField; + + /// + [System.Xml.Serialization.XmlElementAttribute("Constant", typeof(ConstantValueType))] + [System.Xml.Serialization.XmlElementAttribute("ExtendedFieldURI", typeof(PathToExtendedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("FieldURI", typeof(PathToUnindexedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("IndexedFieldURI", typeof(PathToIndexedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("Path", typeof(BasePathToElementType))] + public object Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class IsLessThanOrEqualToType : TwoOperandExpressionType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class IsLessThanType : TwoOperandExpressionType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class IsGreaterThanOrEqualToType : TwoOperandExpressionType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class IsGreaterThanType : TwoOperandExpressionType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class IsNotEqualToType : TwoOperandExpressionType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class OrType : MultipleOperandBooleanExpressionType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum SearchFolderTraversalType + { + + /// + Shallow, + + /// + Deep, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SyncFolderHierarchyDeleteType + { + + private FolderIdType folderIdField; + + /// + public FolderIdType FolderId + { + get + { + return this.folderIdField; + } + set + { + this.folderIdField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IncludeInSchema = false)] + public enum ItemsChoiceType1 + { + + /// + Create, + + /// + Delete, + + /// + Update, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SendNotificationResponseMessageType : ResponseMessageType + { + + private NotificationType notificationField; + + /// + public NotificationType Notification + { + get + { + return this.notificationField; + } + set + { + this.notificationField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class NotificationType + { + + private string subscriptionIdField; + + private string previousWatermarkField; + + private bool moreEventsField; + + private BaseNotificationEventType[] itemsField; + + private ItemsChoiceType[] itemsElementNameField; + + /// + public string SubscriptionId + { + get + { + return this.subscriptionIdField; + } + set + { + this.subscriptionIdField = value; + } + } + + /// + public string PreviousWatermark + { + get + { + return this.previousWatermarkField; + } + set + { + this.previousWatermarkField = value; + } + } + + /// + public bool MoreEvents + { + get + { + return this.moreEventsField; + } + set + { + this.moreEventsField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("CopiedEvent", typeof(MovedCopiedEventType))] + [System.Xml.Serialization.XmlElementAttribute("CreatedEvent", typeof(BaseObjectChangedEventType))] + [System.Xml.Serialization.XmlElementAttribute("DeletedEvent", typeof(BaseObjectChangedEventType))] + [System.Xml.Serialization.XmlElementAttribute("ModifiedEvent", typeof(ModifiedEventType))] + [System.Xml.Serialization.XmlElementAttribute("MovedEvent", typeof(MovedCopiedEventType))] + [System.Xml.Serialization.XmlElementAttribute("NewMailEvent", typeof(BaseObjectChangedEventType))] + [System.Xml.Serialization.XmlElementAttribute("StatusEvent", typeof(BaseNotificationEventType))] + [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")] + public BaseNotificationEventType[] Items + { + get + { + return this.itemsField; + } + set + { + this.itemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("ItemsElementName")] + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ItemsChoiceType[] ItemsElementName + { + get + { + return this.itemsElementNameField; + } + set + { + this.itemsElementNameField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class MovedCopiedEventType : BaseObjectChangedEventType + { + + private object item1Field; + + private FolderIdType oldParentFolderIdField; + + /// + [System.Xml.Serialization.XmlElementAttribute("OldFolderId", typeof(FolderIdType))] + [System.Xml.Serialization.XmlElementAttribute("OldItemId", typeof(ItemIdType))] + public object Item1 + { + get + { + return this.item1Field; + } + set + { + this.item1Field = value; + } + } + + /// + public FolderIdType OldParentFolderId + { + get + { + return this.oldParentFolderIdField; + } + set + { + this.oldParentFolderIdField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MovedCopiedEventType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ModifiedEventType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class BaseObjectChangedEventType : BaseNotificationEventType + { + + private System.DateTime timeStampField; + + private object itemField; + + private FolderIdType parentFolderIdField; + + /// + public System.DateTime TimeStamp + { + get + { + return this.timeStampField; + } + set + { + this.timeStampField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("FolderId", typeof(FolderIdType))] + [System.Xml.Serialization.XmlElementAttribute("ItemId", typeof(ItemIdType))] + public object Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + public FolderIdType ParentFolderId + { + get + { + return this.parentFolderIdField; + } + set + { + this.parentFolderIdField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseObjectChangedEventType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MovedCopiedEventType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ModifiedEventType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class BaseNotificationEventType + { + + private string watermarkField; + + /// + public string Watermark + { + get + { + return this.watermarkField; + } + set + { + this.watermarkField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ModifiedEventType : BaseObjectChangedEventType + { + + private int unreadCountField; + + private bool unreadCountFieldSpecified; + + /// + public int UnreadCount + { + get + { + return this.unreadCountField; + } + set + { + this.unreadCountField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool UnreadCountSpecified + { + get + { + return this.unreadCountFieldSpecified; + } + set + { + this.unreadCountFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IncludeInSchema = false)] + public enum ItemsChoiceType + { + + /// + CopiedEvent, + + /// + CreatedEvent, + + /// + DeletedEvent, + + /// + ModifiedEvent, + + /// + MovedEvent, + + /// + NewMailEvent, + + /// + StatusEvent, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetEventsResponseMessageType : ResponseMessageType + { + + private NotificationType notificationField; + + /// + public NotificationType Notification + { + get + { + return this.notificationField; + } + set + { + this.notificationField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SubscribeResponseMessageType : ResponseMessageType + { + + private string subscriptionIdField; + + private string watermarkField; + + /// + public string SubscriptionId + { + get + { + return this.subscriptionIdField; + } + set + { + this.subscriptionIdField = value; + } + } + + /// + public string Watermark + { + get + { + return this.watermarkField; + } + set + { + this.watermarkField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class ExpandDLResponseMessageType : ResponseMessageType + { + + private ArrayOfDLExpansionType dLExpansionField; + + private int indexedPagingOffsetField; + + private bool indexedPagingOffsetFieldSpecified; + + private int numeratorOffsetField; + + private bool numeratorOffsetFieldSpecified; + + private int absoluteDenominatorField; + + private bool absoluteDenominatorFieldSpecified; + + private bool includesLastItemInRangeField; + + private bool includesLastItemInRangeFieldSpecified; + + private int totalItemsInViewField; + + private bool totalItemsInViewFieldSpecified; + + /// + public ArrayOfDLExpansionType DLExpansion + { + get + { + return this.dLExpansionField; + } + set + { + this.dLExpansionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int IndexedPagingOffset + { + get + { + return this.indexedPagingOffsetField; + } + set + { + this.indexedPagingOffsetField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IndexedPagingOffsetSpecified + { + get + { + return this.indexedPagingOffsetFieldSpecified; + } + set + { + this.indexedPagingOffsetFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int NumeratorOffset + { + get + { + return this.numeratorOffsetField; + } + set + { + this.numeratorOffsetField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool NumeratorOffsetSpecified + { + get + { + return this.numeratorOffsetFieldSpecified; + } + set + { + this.numeratorOffsetFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int AbsoluteDenominator + { + get + { + return this.absoluteDenominatorField; + } + set + { + this.absoluteDenominatorField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AbsoluteDenominatorSpecified + { + get + { + return this.absoluteDenominatorFieldSpecified; + } + set + { + this.absoluteDenominatorFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool IncludesLastItemInRange + { + get + { + return this.includesLastItemInRangeField; + } + set + { + this.includesLastItemInRangeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IncludesLastItemInRangeSpecified + { + get + { + return this.includesLastItemInRangeFieldSpecified; + } + set + { + this.includesLastItemInRangeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int TotalItemsInView + { + get + { + return this.totalItemsInViewField; + } + set + { + this.totalItemsInViewField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool TotalItemsInViewSpecified + { + get + { + return this.totalItemsInViewFieldSpecified; + } + set + { + this.totalItemsInViewFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ArrayOfDLExpansionType + { + + private EmailAddressType[] mailboxField; + + private int indexedPagingOffsetField; + + private bool indexedPagingOffsetFieldSpecified; + + private int numeratorOffsetField; + + private bool numeratorOffsetFieldSpecified; + + private int absoluteDenominatorField; + + private bool absoluteDenominatorFieldSpecified; + + private bool includesLastItemInRangeField; + + private bool includesLastItemInRangeFieldSpecified; + + private int totalItemsInViewField; + + private bool totalItemsInViewFieldSpecified; + + /// + [System.Xml.Serialization.XmlElementAttribute("Mailbox")] + public EmailAddressType[] Mailbox + { + get + { + return this.mailboxField; + } + set + { + this.mailboxField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int IndexedPagingOffset + { + get + { + return this.indexedPagingOffsetField; + } + set + { + this.indexedPagingOffsetField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IndexedPagingOffsetSpecified + { + get + { + return this.indexedPagingOffsetFieldSpecified; + } + set + { + this.indexedPagingOffsetFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int NumeratorOffset + { + get + { + return this.numeratorOffsetField; + } + set + { + this.numeratorOffsetField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool NumeratorOffsetSpecified + { + get + { + return this.numeratorOffsetFieldSpecified; + } + set + { + this.numeratorOffsetFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int AbsoluteDenominator + { + get + { + return this.absoluteDenominatorField; + } + set + { + this.absoluteDenominatorField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AbsoluteDenominatorSpecified + { + get + { + return this.absoluteDenominatorFieldSpecified; + } + set + { + this.absoluteDenominatorFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool IncludesLastItemInRange + { + get + { + return this.includesLastItemInRangeField; + } + set + { + this.includesLastItemInRangeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IncludesLastItemInRangeSpecified + { + get + { + return this.includesLastItemInRangeFieldSpecified; + } + set + { + this.includesLastItemInRangeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int TotalItemsInView + { + get + { + return this.totalItemsInViewField; + } + set + { + this.totalItemsInViewField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool TotalItemsInViewSpecified + { + get + { + return this.totalItemsInViewFieldSpecified; + } + set + { + this.totalItemsInViewFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class ResolveNamesResponseMessageType : ResponseMessageType + { + + private ArrayOfResolutionType resolutionSetField; + + /// + public ArrayOfResolutionType ResolutionSet + { + get + { + return this.resolutionSetField; + } + set + { + this.resolutionSetField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ArrayOfResolutionType + { + + private ResolutionType[] resolutionField; + + private int indexedPagingOffsetField; + + private bool indexedPagingOffsetFieldSpecified; + + private int numeratorOffsetField; + + private bool numeratorOffsetFieldSpecified; + + private int absoluteDenominatorField; + + private bool absoluteDenominatorFieldSpecified; + + private bool includesLastItemInRangeField; + + private bool includesLastItemInRangeFieldSpecified; + + private int totalItemsInViewField; + + private bool totalItemsInViewFieldSpecified; + + /// + [System.Xml.Serialization.XmlElementAttribute("Resolution")] + public ResolutionType[] Resolution + { + get + { + return this.resolutionField; + } + set + { + this.resolutionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int IndexedPagingOffset + { + get + { + return this.indexedPagingOffsetField; + } + set + { + this.indexedPagingOffsetField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IndexedPagingOffsetSpecified + { + get + { + return this.indexedPagingOffsetFieldSpecified; + } + set + { + this.indexedPagingOffsetFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int NumeratorOffset + { + get + { + return this.numeratorOffsetField; + } + set + { + this.numeratorOffsetField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool NumeratorOffsetSpecified + { + get + { + return this.numeratorOffsetFieldSpecified; + } + set + { + this.numeratorOffsetFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int AbsoluteDenominator + { + get + { + return this.absoluteDenominatorField; + } + set + { + this.absoluteDenominatorField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AbsoluteDenominatorSpecified + { + get + { + return this.absoluteDenominatorFieldSpecified; + } + set + { + this.absoluteDenominatorFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool IncludesLastItemInRange + { + get + { + return this.includesLastItemInRangeField; + } + set + { + this.includesLastItemInRangeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IncludesLastItemInRangeSpecified + { + get + { + return this.includesLastItemInRangeFieldSpecified; + } + set + { + this.includesLastItemInRangeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int TotalItemsInView + { + get + { + return this.totalItemsInViewField; + } + set + { + this.totalItemsInViewField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool TotalItemsInViewSpecified + { + get + { + return this.totalItemsInViewFieldSpecified; + } + set + { + this.totalItemsInViewFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ResolutionType + { + + private EmailAddressType mailboxField; + + private ContactItemType contactField; + + /// + public EmailAddressType Mailbox + { + get + { + return this.mailboxField; + } + set + { + this.mailboxField = value; + } + } + + /// + public ContactItemType Contact + { + get + { + return this.contactField; + } + set + { + this.contactField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class FindItemResponseMessageType : ResponseMessageType + { + + private FindItemParentType rootFolderField; + + /// + public FindItemParentType RootFolder + { + get + { + return this.rootFolderField; + } + set + { + this.rootFolderField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class FindItemParentType + { + + private object itemField; + + private int indexedPagingOffsetField; + + private bool indexedPagingOffsetFieldSpecified; + + private int numeratorOffsetField; + + private bool numeratorOffsetFieldSpecified; + + private int absoluteDenominatorField; + + private bool absoluteDenominatorFieldSpecified; + + private bool includesLastItemInRangeField; + + private bool includesLastItemInRangeFieldSpecified; + + private int totalItemsInViewField; + + private bool totalItemsInViewFieldSpecified; + + /// + [System.Xml.Serialization.XmlElementAttribute("Groups", typeof(ArrayOfGroupedItemsType))] + [System.Xml.Serialization.XmlElementAttribute("Items", typeof(ArrayOfRealItemsType))] + public object Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int IndexedPagingOffset + { + get + { + return this.indexedPagingOffsetField; + } + set + { + this.indexedPagingOffsetField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IndexedPagingOffsetSpecified + { + get + { + return this.indexedPagingOffsetFieldSpecified; + } + set + { + this.indexedPagingOffsetFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int NumeratorOffset + { + get + { + return this.numeratorOffsetField; + } + set + { + this.numeratorOffsetField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool NumeratorOffsetSpecified + { + get + { + return this.numeratorOffsetFieldSpecified; + } + set + { + this.numeratorOffsetFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int AbsoluteDenominator + { + get + { + return this.absoluteDenominatorField; + } + set + { + this.absoluteDenominatorField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AbsoluteDenominatorSpecified + { + get + { + return this.absoluteDenominatorFieldSpecified; + } + set + { + this.absoluteDenominatorFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool IncludesLastItemInRange + { + get + { + return this.includesLastItemInRangeField; + } + set + { + this.includesLastItemInRangeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IncludesLastItemInRangeSpecified + { + get + { + return this.includesLastItemInRangeFieldSpecified; + } + set + { + this.includesLastItemInRangeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int TotalItemsInView + { + get + { + return this.totalItemsInViewField; + } + set + { + this.totalItemsInViewField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool TotalItemsInViewSpecified + { + get + { + return this.totalItemsInViewFieldSpecified; + } + set + { + this.totalItemsInViewFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ArrayOfGroupedItemsType + { + + private GroupedItemsType[] itemsField; + + /// + [System.Xml.Serialization.XmlElementAttribute("GroupedItems")] + public GroupedItemsType[] Items + { + get + { + return this.itemsField; + } + set + { + this.itemsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class GroupedItemsType + { + + private string groupIndexField; + + private ArrayOfRealItemsType itemsField; + + /// + public string GroupIndex + { + get + { + return this.groupIndexField; + } + set + { + this.groupIndexField = value; + } + } + + /// + public ArrayOfRealItemsType Items + { + get + { + return this.itemsField; + } + set + { + this.itemsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ArrayOfRealItemsType + { + + private ItemType[] itemsField; + + /// + [System.Xml.Serialization.XmlElementAttribute("CalendarItem", typeof(CalendarItemType))] + [System.Xml.Serialization.XmlElementAttribute("Contact", typeof(ContactItemType))] + [System.Xml.Serialization.XmlElementAttribute("DistributionList", typeof(DistributionListType))] + [System.Xml.Serialization.XmlElementAttribute("Item", typeof(ItemType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingCancellation", typeof(MeetingCancellationMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingMessage", typeof(MeetingMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingRequest", typeof(MeetingRequestMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingResponse", typeof(MeetingResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("Message", typeof(MessageType))] + [System.Xml.Serialization.XmlElementAttribute("PostItem", typeof(PostItemType))] + [System.Xml.Serialization.XmlElementAttribute("Task", typeof(TaskType))] + public ItemType[] Items + { + get + { + return this.itemsField; + } + set + { + this.itemsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class DeleteAttachmentResponseMessageType : ResponseMessageType + { + + private RootItemIdType rootItemIdField; + + /// + public RootItemIdType RootItemId + { + get + { + return this.rootItemIdField; + } + set + { + this.rootItemIdField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class AttachmentInfoResponseMessageType : ResponseMessageType + { + + private AttachmentType[] attachmentsField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("FileAttachment", typeof(FileAttachmentType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("ItemAttachment", typeof(ItemAttachmentType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public AttachmentType[] Attachments + { + get + { + return this.attachmentsField; + } + set + { + this.attachmentsField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UpdateItemResponseMessageType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class ItemInfoResponseMessageType : ResponseMessageType + { + + private ArrayOfRealItemsType itemsField; + + /// + public ArrayOfRealItemsType Items + { + get + { + return this.itemsField; + } + set + { + this.itemsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class UpdateItemResponseMessageType : ItemInfoResponseMessageType + { + + private ConflictResultsType conflictResultsField; + + /// + public ConflictResultsType ConflictResults + { + get + { + return this.conflictResultsField; + } + set + { + this.conflictResultsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ConflictResultsType + { + + private int countField; + + /// + public int Count + { + get + { + return this.countField; + } + set + { + this.countField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class FindFolderResponseMessageType : ResponseMessageType + { + + private FindFolderParentType rootFolderField; + + /// + public FindFolderParentType RootFolder + { + get + { + return this.rootFolderField; + } + set + { + this.rootFolderField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class FindFolderParentType + { + + private BaseFolderType[] foldersField; + + private int indexedPagingOffsetField; + + private bool indexedPagingOffsetFieldSpecified; + + private int numeratorOffsetField; + + private bool numeratorOffsetFieldSpecified; + + private int absoluteDenominatorField; + + private bool absoluteDenominatorFieldSpecified; + + private bool includesLastItemInRangeField; + + private bool includesLastItemInRangeFieldSpecified; + + private int totalItemsInViewField; + + private bool totalItemsInViewFieldSpecified; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("CalendarFolder", typeof(CalendarFolderType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("ContactsFolder", typeof(ContactsFolderType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("Folder", typeof(FolderType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("SearchFolder", typeof(SearchFolderType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("TasksFolder", typeof(TasksFolderType), IsNullable = false)] + public BaseFolderType[] Folders + { + get + { + return this.foldersField; + } + set + { + this.foldersField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int IndexedPagingOffset + { + get + { + return this.indexedPagingOffsetField; + } + set + { + this.indexedPagingOffsetField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IndexedPagingOffsetSpecified + { + get + { + return this.indexedPagingOffsetFieldSpecified; + } + set + { + this.indexedPagingOffsetFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int NumeratorOffset + { + get + { + return this.numeratorOffsetField; + } + set + { + this.numeratorOffsetField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool NumeratorOffsetSpecified + { + get + { + return this.numeratorOffsetFieldSpecified; + } + set + { + this.numeratorOffsetFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int AbsoluteDenominator + { + get + { + return this.absoluteDenominatorField; + } + set + { + this.absoluteDenominatorField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AbsoluteDenominatorSpecified + { + get + { + return this.absoluteDenominatorFieldSpecified; + } + set + { + this.absoluteDenominatorFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool IncludesLastItemInRange + { + get + { + return this.includesLastItemInRangeField; + } + set + { + this.includesLastItemInRangeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IncludesLastItemInRangeSpecified + { + get + { + return this.includesLastItemInRangeFieldSpecified; + } + set + { + this.includesLastItemInRangeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int TotalItemsInView + { + get + { + return this.totalItemsInViewField; + } + set + { + this.totalItemsInViewField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool TotalItemsInViewSpecified + { + get + { + return this.totalItemsInViewFieldSpecified; + } + set + { + this.totalItemsInViewFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class FolderInfoResponseMessageType : ResponseMessageType + { + + private BaseFolderType[] foldersField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("CalendarFolder", typeof(CalendarFolderType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("ContactsFolder", typeof(ContactsFolderType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("Folder", typeof(FolderType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("SearchFolder", typeof(SearchFolderType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("TasksFolder", typeof(TasksFolderType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public BaseFolderType[] Folders + { + get + { + return this.foldersField; + } + set + { + this.foldersField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetUserOofSettingsResponse + { + + private ResponseMessageType responseMessageField; + + private UserOofSettings oofSettingsField; + + private ExternalAudience allowExternalOofField; + + private bool allowExternalOofFieldSpecified; + + /// + public ResponseMessageType ResponseMessage + { + get + { + return this.responseMessageField; + } + set + { + this.responseMessageField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public UserOofSettings OofSettings + { + get + { + return this.oofSettingsField; + } + set + { + this.oofSettingsField = value; + } + } + + /// + public ExternalAudience AllowExternalOof + { + get + { + return this.allowExternalOofField; + } + set + { + this.allowExternalOofField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AllowExternalOofSpecified + { + get + { + return this.allowExternalOofFieldSpecified; + } + set + { + this.allowExternalOofFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class UserOofSettings + { + + private OofState oofStateField; + + private ExternalAudience externalAudienceField; + + private Duration durationField; + + private ReplyBody internalReplyField; + + private ReplyBody externalReplyField; + + /// + public OofState OofState + { + get + { + return this.oofStateField; + } + set + { + this.oofStateField = value; + } + } + + /// + public ExternalAudience ExternalAudience + { + get + { + return this.externalAudienceField; + } + set + { + this.externalAudienceField = value; + } + } + + /// + public Duration Duration + { + get + { + return this.durationField; + } + set + { + this.durationField = value; + } + } + + /// + public ReplyBody InternalReply + { + get + { + return this.internalReplyField; + } + set + { + this.internalReplyField = value; + } + } + + /// + public ReplyBody ExternalReply + { + get + { + return this.externalReplyField; + } + set + { + this.externalReplyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum OofState + { + + /// + Disabled, + + /// + Enabled, + + /// + Scheduled, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum ExternalAudience + { + + /// + None, + + /// + Known, + + /// + All, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class Duration + { + + private System.DateTime startTimeField; + + private System.DateTime endTimeField; + + /// + public System.DateTime StartTime + { + get + { + return this.startTimeField; + } + set + { + this.startTimeField = value; + } + } + + /// + public System.DateTime EndTime + { + get + { + return this.endTimeField; + } + set + { + this.endTimeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ReplyBody + { + + private string messageField; + + private string langField; + + /// + public string Message + { + get + { + return this.messageField; + } + set + { + this.messageField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://www.w3.org/XML/1998/namespace")] + public string lang + { + get + { + return this.langField; + } + set + { + this.langField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GroupAttendeeConflictData))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IndividualAttendeeConflictData))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(TooBigGroupAttendeeConflictData))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnknownAttendeeConflictData))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class AttendeeConflictData + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class GroupAttendeeConflictData : AttendeeConflictData + { + + private int numberOfMembersField; + + private int numberOfMembersAvailableField; + + private int numberOfMembersWithConflictField; + + private int numberOfMembersWithNoDataField; + + /// + public int NumberOfMembers + { + get + { + return this.numberOfMembersField; + } + set + { + this.numberOfMembersField = value; + } + } + + /// + public int NumberOfMembersAvailable + { + get + { + return this.numberOfMembersAvailableField; + } + set + { + this.numberOfMembersAvailableField = value; + } + } + + /// + public int NumberOfMembersWithConflict + { + get + { + return this.numberOfMembersWithConflictField; + } + set + { + this.numberOfMembersWithConflictField = value; + } + } + + /// + public int NumberOfMembersWithNoData + { + get + { + return this.numberOfMembersWithNoDataField; + } + set + { + this.numberOfMembersWithNoDataField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class IndividualAttendeeConflictData : AttendeeConflictData + { + + private LegacyFreeBusyType busyTypeField; + + /// + public LegacyFreeBusyType BusyType + { + get + { + return this.busyTypeField; + } + set + { + this.busyTypeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class TooBigGroupAttendeeConflictData : AttendeeConflictData + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class UnknownAttendeeConflictData : AttendeeConflictData + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class Suggestion + { + + private System.DateTime meetingTimeField; + + private bool isWorkTimeField; + + private SuggestionQuality suggestionQualityField; + + private AttendeeConflictData[] attendeeConflictDataArrayField; + + /// + public System.DateTime MeetingTime + { + get + { + return this.meetingTimeField; + } + set + { + this.meetingTimeField = value; + } + } + + /// + public bool IsWorkTime + { + get + { + return this.isWorkTimeField; + } + set + { + this.isWorkTimeField = value; + } + } + + /// + public SuggestionQuality SuggestionQuality + { + get + { + return this.suggestionQualityField; + } + set + { + this.suggestionQualityField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute(typeof(GroupAttendeeConflictData))] + [System.Xml.Serialization.XmlArrayItemAttribute(typeof(IndividualAttendeeConflictData))] + [System.Xml.Serialization.XmlArrayItemAttribute(typeof(TooBigGroupAttendeeConflictData))] + [System.Xml.Serialization.XmlArrayItemAttribute(typeof(UnknownAttendeeConflictData))] + public AttendeeConflictData[] AttendeeConflictDataArray + { + get + { + return this.attendeeConflictDataArrayField; + } + set + { + this.attendeeConflictDataArrayField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum SuggestionQuality + { + + /// + Excellent, + + /// + Good, + + /// + Fair, + + /// + Poor, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SuggestionDayResult + { + + private System.DateTime dateField; + + private SuggestionQuality dayQualityField; + + private Suggestion[] suggestionArrayField; + + /// + public System.DateTime Date + { + get + { + return this.dateField; + } + set + { + this.dateField = value; + } + } + + /// + public SuggestionQuality DayQuality + { + get + { + return this.dayQualityField; + } + set + { + this.dayQualityField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable = false)] + public Suggestion[] SuggestionArray + { + get + { + return this.suggestionArrayField; + } + set + { + this.suggestionArrayField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SuggestionsResponseType + { + + private ResponseMessageType responseMessageField; + + private SuggestionDayResult[] suggestionDayResultArrayField; + + /// + public ResponseMessageType ResponseMessage + { + get + { + return this.responseMessageField; + } + set + { + this.responseMessageField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public SuggestionDayResult[] SuggestionDayResultArray + { + get + { + return this.suggestionDayResultArrayField; + } + set + { + this.suggestionDayResultArrayField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class WorkingPeriod + { + + private string dayOfWeekField; + + private int startTimeInMinutesField; + + private int endTimeInMinutesField; + + /// + public string DayOfWeek + { + get + { + return this.dayOfWeekField; + } + set + { + this.dayOfWeekField = value; + } + } + + /// + public int StartTimeInMinutes + { + get + { + return this.startTimeInMinutesField; + } + set + { + this.startTimeInMinutesField = value; + } + } + + /// + public int EndTimeInMinutes + { + get + { + return this.endTimeInMinutesField; + } + set + { + this.endTimeInMinutesField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class WorkingHours + { + + private SerializableTimeZone timeZoneField; + + private WorkingPeriod[] workingPeriodArrayField; + + /// + public SerializableTimeZone TimeZone + { + get + { + return this.timeZoneField; + } + set + { + this.timeZoneField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable = false)] + public WorkingPeriod[] WorkingPeriodArray + { + get + { + return this.workingPeriodArrayField; + } + set + { + this.workingPeriodArrayField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SerializableTimeZone + { + + private int biasField; + + private SerializableTimeZoneTime standardTimeField; + + private SerializableTimeZoneTime daylightTimeField; + + /// + public int Bias + { + get + { + return this.biasField; + } + set + { + this.biasField = value; + } + } + + /// + public SerializableTimeZoneTime StandardTime + { + get + { + return this.standardTimeField; + } + set + { + this.standardTimeField = value; + } + } + + /// + public SerializableTimeZoneTime DaylightTime + { + get + { + return this.daylightTimeField; + } + set + { + this.daylightTimeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SerializableTimeZoneTime + { + + private int biasField; + + private string timeField; + + private short dayOrderField; + + private short monthField; + + private string dayOfWeekField; + + private string yearField; + + /// + public int Bias + { + get + { + return this.biasField; + } + set + { + this.biasField = value; + } + } + + /// + public string Time + { + get + { + return this.timeField; + } + set + { + this.timeField = value; + } + } + + /// + public short DayOrder + { + get + { + return this.dayOrderField; + } + set + { + this.dayOrderField = value; + } + } + + /// + public short Month + { + get + { + return this.monthField; + } + set + { + this.monthField = value; + } + } + + /// + public string DayOfWeek + { + get + { + return this.dayOfWeekField; + } + set + { + this.dayOfWeekField = value; + } + } + + /// + public string Year + { + get + { + return this.yearField; + } + set + { + this.yearField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class CalendarEventDetails + { + + private string idField; + + private string subjectField; + + private string locationField; + + private bool isMeetingField; + + private bool isRecurringField; + + private bool isExceptionField; + + private bool isReminderSetField; + + private bool isPrivateField; + + /// + public string ID + { + get + { + return this.idField; + } + set + { + this.idField = value; + } + } + + /// + public string Subject + { + get + { + return this.subjectField; + } + set + { + this.subjectField = value; + } + } + + /// + public string Location + { + get + { + return this.locationField; + } + set + { + this.locationField = value; + } + } + + /// + public bool IsMeeting + { + get + { + return this.isMeetingField; + } + set + { + this.isMeetingField = value; + } + } + + /// + public bool IsRecurring + { + get + { + return this.isRecurringField; + } + set + { + this.isRecurringField = value; + } + } + + /// + public bool IsException + { + get + { + return this.isExceptionField; + } + set + { + this.isExceptionField = value; + } + } + + /// + public bool IsReminderSet + { + get + { + return this.isReminderSetField; + } + set + { + this.isReminderSetField = value; + } + } + + /// + public bool IsPrivate + { + get + { + return this.isPrivateField; + } + set + { + this.isPrivateField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class CalendarEvent + { + + private System.DateTime startTimeField; + + private System.DateTime endTimeField; + + private LegacyFreeBusyType busyTypeField; + + private CalendarEventDetails calendarEventDetailsField; + + /// + public System.DateTime StartTime + { + get + { + return this.startTimeField; + } + set + { + this.startTimeField = value; + } + } + + /// + public System.DateTime EndTime + { + get + { + return this.endTimeField; + } + set + { + this.endTimeField = value; + } + } + + /// + public LegacyFreeBusyType BusyType + { + get + { + return this.busyTypeField; + } + set + { + this.busyTypeField = value; + } + } + + /// + public CalendarEventDetails CalendarEventDetails + { + get + { + return this.calendarEventDetailsField; + } + set + { + this.calendarEventDetailsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class FreeBusyView + { + + private FreeBusyViewType freeBusyViewTypeField; + + private string mergedFreeBusyField; + + private CalendarEvent[] calendarEventArrayField; + + private WorkingHours workingHoursField; + + /// + public FreeBusyViewType FreeBusyViewType + { + get + { + return this.freeBusyViewTypeField; + } + set + { + this.freeBusyViewTypeField = value; + } + } + + /// + public string MergedFreeBusy + { + get + { + return this.mergedFreeBusyField; + } + set + { + this.mergedFreeBusyField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable = false)] + public CalendarEvent[] CalendarEventArray + { + get + { + return this.calendarEventArrayField; + } + set + { + this.calendarEventArrayField = value; + } + } + + /// + public WorkingHours WorkingHours + { + get + { + return this.workingHoursField; + } + set + { + this.workingHoursField = value; + } + } + } + + /// + [System.FlagsAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum FreeBusyViewType + { + + /// + None = 1, + + /// + MergedOnly = 2, + + /// + FreeBusy = 4, + + /// + FreeBusyMerged = 8, + + /// + Detailed = 16, + + /// + DetailedMerged = 32, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class FreeBusyResponseType + { + + private ResponseMessageType responseMessageField; + + private FreeBusyView freeBusyViewField; + + /// + public ResponseMessageType ResponseMessage + { + get + { + return this.responseMessageField; + } + set + { + this.responseMessageField = value; + } + } + + /// + public FreeBusyView FreeBusyView + { + get + { + return this.freeBusyViewField; + } + set + { + this.freeBusyViewField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetUserAvailabilityResponseType + { + + private FreeBusyResponseType[] freeBusyResponseArrayField; + + private SuggestionsResponseType suggestionsResponseField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("FreeBusyResponse", IsNullable = false)] + public FreeBusyResponseType[] FreeBusyResponseArray + { + get + { + return this.freeBusyResponseArrayField; + } + set + { + this.freeBusyResponseArrayField = value; + } + } + + /// + public SuggestionsResponseType SuggestionsResponse + { + get + { + return this.suggestionsResponseField; + } + set + { + this.suggestionsResponseField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class ArrayOfResponseMessagesType + { + + private ResponseMessageType[] itemsField; + + private ItemsChoiceType3[] itemsElementNameField; + + /// + [System.Xml.Serialization.XmlElementAttribute("ConvertIdResponseMessage", typeof(ConvertIdResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("CopyFolderResponseMessage", typeof(FolderInfoResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("CopyItemResponseMessage", typeof(ItemInfoResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("CreateAttachmentResponseMessage", typeof(AttachmentInfoResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("CreateFolderResponseMessage", typeof(FolderInfoResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("CreateItemResponseMessage", typeof(ItemInfoResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("CreateManagedFolderResponseMessage", typeof(FolderInfoResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("DeleteAttachmentResponseMessage", typeof(DeleteAttachmentResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("DeleteFolderResponseMessage", typeof(ResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("DeleteItemResponseMessage", typeof(ResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("ExpandDLResponseMessage", typeof(ExpandDLResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("FindFolderResponseMessage", typeof(FindFolderResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("FindItemResponseMessage", typeof(FindItemResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("GetAttachmentResponseMessage", typeof(AttachmentInfoResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("GetEventsResponseMessage", typeof(GetEventsResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("GetFolderResponseMessage", typeof(FolderInfoResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("GetItemResponseMessage", typeof(ItemInfoResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MoveFolderResponseMessage", typeof(FolderInfoResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MoveItemResponseMessage", typeof(ItemInfoResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("ResolveNamesResponseMessage", typeof(ResolveNamesResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("SendItemResponseMessage", typeof(ResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("SendNotificationResponseMessage", typeof(SendNotificationResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("SubscribeResponseMessage", typeof(SubscribeResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("SyncFolderHierarchyResponseMessage", typeof(SyncFolderHierarchyResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("SyncFolderItemsResponseMessage", typeof(SyncFolderItemsResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("UnsubscribeResponseMessage", typeof(ResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("UpdateFolderResponseMessage", typeof(FolderInfoResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("UpdateItemResponseMessage", typeof(UpdateItemResponseMessageType))] + [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")] + public ResponseMessageType[] Items + { + get + { + return this.itemsField; + } + set + { + this.itemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("ItemsElementName")] + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ItemsChoiceType3[] ItemsElementName + { + get + { + return this.itemsElementNameField; + } + set + { + this.itemsElementNameField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages", IncludeInSchema = false)] + public enum ItemsChoiceType3 + { + + /// + ConvertIdResponseMessage, + + /// + CopyFolderResponseMessage, + + /// + CopyItemResponseMessage, + + /// + CreateAttachmentResponseMessage, + + /// + CreateFolderResponseMessage, + + /// + CreateItemResponseMessage, + + /// + CreateManagedFolderResponseMessage, + + /// + DeleteAttachmentResponseMessage, + + /// + DeleteFolderResponseMessage, + + /// + DeleteItemResponseMessage, + + /// + ExpandDLResponseMessage, + + /// + FindFolderResponseMessage, + + /// + FindItemResponseMessage, + + /// + GetAttachmentResponseMessage, + + /// + GetEventsResponseMessage, + + /// + GetFolderResponseMessage, + + /// + GetItemResponseMessage, + + /// + MoveFolderResponseMessage, + + /// + MoveItemResponseMessage, + + /// + ResolveNamesResponseMessage, + + /// + SendItemResponseMessage, + + /// + SendNotificationResponseMessage, + + /// + SubscribeResponseMessage, + + /// + SyncFolderHierarchyResponseMessage, + + /// + SyncFolderItemsResponseMessage, + + /// + UnsubscribeResponseMessage, + + /// + UpdateFolderResponseMessage, + + /// + UpdateItemResponseMessage, + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConvertIdResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SyncFolderItemsResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SyncFolderHierarchyResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SendNotificationResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetEventsResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnsubscribeResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubscribeResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreateManagedFolderResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpandDLResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResolveNamesResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FindItemResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteItemResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CopyItemResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MoveItemResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetItemResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UpdateItemResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreateItemResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetAttachmentResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteAttachmentResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreateAttachmentResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SendItemResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CopyFolderResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MoveFolderResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UpdateFolderResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetFolderResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreateFolderResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteFolderResponseType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FindFolderResponseType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class BaseResponseMessageType + { + + private ArrayOfResponseMessagesType responseMessagesField; + + /// + public ArrayOfResponseMessagesType ResponseMessages + { + get + { + return this.responseMessagesField; + } + set + { + this.responseMessagesField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class ConvertIdResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SyncFolderItemsResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SyncFolderHierarchyResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SendNotificationResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetEventsResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class UnsubscribeResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SubscribeResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class CreateManagedFolderResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class ExpandDLResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class ResolveNamesResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class FindItemResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class DeleteItemResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class CopyItemResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class MoveItemResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetItemResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class UpdateItemResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class CreateItemResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetAttachmentResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class DeleteAttachmentResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class CreateAttachmentResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SendItemResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class CopyFolderResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class MoveFolderResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class UpdateFolderResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetFolderResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class CreateFolderResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class DeleteFolderResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class FindFolderResponseType : BaseResponseMessageType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SuggestionsViewOptionsType + { + + private int goodThresholdField; + + private bool goodThresholdFieldSpecified; + + private int maximumResultsByDayField; + + private bool maximumResultsByDayFieldSpecified; + + private int maximumNonWorkHourResultsByDayField; + + private bool maximumNonWorkHourResultsByDayFieldSpecified; + + private int meetingDurationInMinutesField; + + private bool meetingDurationInMinutesFieldSpecified; + + private SuggestionQuality minimumSuggestionQualityField; + + private bool minimumSuggestionQualityFieldSpecified; + + private Duration detailedSuggestionsWindowField; + + private System.DateTime currentMeetingTimeField; + + private bool currentMeetingTimeFieldSpecified; + + private string globalObjectIdField; + + /// + public int GoodThreshold + { + get + { + return this.goodThresholdField; + } + set + { + this.goodThresholdField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool GoodThresholdSpecified + { + get + { + return this.goodThresholdFieldSpecified; + } + set + { + this.goodThresholdFieldSpecified = value; + } + } + + /// + public int MaximumResultsByDay + { + get + { + return this.maximumResultsByDayField; + } + set + { + this.maximumResultsByDayField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MaximumResultsByDaySpecified + { + get + { + return this.maximumResultsByDayFieldSpecified; + } + set + { + this.maximumResultsByDayFieldSpecified = value; + } + } + + /// + public int MaximumNonWorkHourResultsByDay + { + get + { + return this.maximumNonWorkHourResultsByDayField; + } + set + { + this.maximumNonWorkHourResultsByDayField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MaximumNonWorkHourResultsByDaySpecified + { + get + { + return this.maximumNonWorkHourResultsByDayFieldSpecified; + } + set + { + this.maximumNonWorkHourResultsByDayFieldSpecified = value; + } + } + + /// + public int MeetingDurationInMinutes + { + get + { + return this.meetingDurationInMinutesField; + } + set + { + this.meetingDurationInMinutesField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MeetingDurationInMinutesSpecified + { + get + { + return this.meetingDurationInMinutesFieldSpecified; + } + set + { + this.meetingDurationInMinutesFieldSpecified = value; + } + } + + /// + public SuggestionQuality MinimumSuggestionQuality + { + get + { + return this.minimumSuggestionQualityField; + } + set + { + this.minimumSuggestionQualityField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MinimumSuggestionQualitySpecified + { + get + { + return this.minimumSuggestionQualityFieldSpecified; + } + set + { + this.minimumSuggestionQualityFieldSpecified = value; + } + } + + /// + public Duration DetailedSuggestionsWindow + { + get + { + return this.detailedSuggestionsWindowField; + } + set + { + this.detailedSuggestionsWindowField = value; + } + } + + /// + public System.DateTime CurrentMeetingTime + { + get + { + return this.currentMeetingTimeField; + } + set + { + this.currentMeetingTimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool CurrentMeetingTimeSpecified + { + get + { + return this.currentMeetingTimeFieldSpecified; + } + set + { + this.currentMeetingTimeFieldSpecified = value; + } + } + + /// + public string GlobalObjectId + { + get + { + return this.globalObjectIdField; + } + set + { + this.globalObjectIdField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class FreeBusyViewOptionsType + { + + private Duration timeWindowField; + + private int mergedFreeBusyIntervalInMinutesField; + + private bool mergedFreeBusyIntervalInMinutesFieldSpecified; + + private FreeBusyViewType requestedViewField; + + private bool requestedViewFieldSpecified; + + /// + public Duration TimeWindow + { + get + { + return this.timeWindowField; + } + set + { + this.timeWindowField = value; + } + } + + /// + public int MergedFreeBusyIntervalInMinutes + { + get + { + return this.mergedFreeBusyIntervalInMinutesField; + } + set + { + this.mergedFreeBusyIntervalInMinutesField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MergedFreeBusyIntervalInMinutesSpecified + { + get + { + return this.mergedFreeBusyIntervalInMinutesFieldSpecified; + } + set + { + this.mergedFreeBusyIntervalInMinutesFieldSpecified = value; + } + } + + /// + public FreeBusyViewType RequestedView + { + get + { + return this.requestedViewField; + } + set + { + this.requestedViewField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool RequestedViewSpecified + { + get + { + return this.requestedViewFieldSpecified; + } + set + { + this.requestedViewFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class EmailAddress + { + + private string nameField; + + private string addressField; + + private string routingTypeField; + + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameField = value; + } + } + + /// + public string Address + { + get + { + return this.addressField; + } + set + { + this.addressField = value; + } + } + + /// + public string RoutingType + { + get + { + return this.routingTypeField; + } + set + { + this.routingTypeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class MailboxData + { + + private EmailAddress emailField; + + private MeetingAttendeeType attendeeTypeField; + + private bool excludeConflictsField; + + private bool excludeConflictsFieldSpecified; + + /// + public EmailAddress Email + { + get + { + return this.emailField; + } + set + { + this.emailField = value; + } + } + + /// + public MeetingAttendeeType AttendeeType + { + get + { + return this.attendeeTypeField; + } + set + { + this.attendeeTypeField = value; + } + } + + /// + public bool ExcludeConflicts + { + get + { + return this.excludeConflictsField; + } + set + { + this.excludeConflictsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool ExcludeConflictsSpecified + { + get + { + return this.excludeConflictsFieldSpecified; + } + set + { + this.excludeConflictsFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum MeetingAttendeeType + { + + /// + Organizer, + + /// + Required, + + /// + Optional, + + /// + Room, + + /// + Resource, + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PullSubscriptionRequestType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(PushSubscriptionRequestType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class BaseSubscriptionRequestType + { + + private BaseFolderIdType[] folderIdsField; + + private NotificationEventTypeType[] eventTypesField; + + private string watermarkField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("DistinguishedFolderId", typeof(DistinguishedFolderIdType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("FolderId", typeof(FolderIdType), IsNullable = false)] + public BaseFolderIdType[] FolderIds + { + get + { + return this.folderIdsField; + } + set + { + this.folderIdsField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("EventType", IsNullable = false)] + public NotificationEventTypeType[] EventTypes + { + get + { + return this.eventTypesField; + } + set + { + this.eventTypesField = value; + } + } + + /// + public string Watermark + { + get + { + return this.watermarkField; + } + set + { + this.watermarkField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum NotificationEventTypeType + { + + /// + CopiedEvent, + + /// + CreatedEvent, + + /// + DeletedEvent, + + /// + ModifiedEvent, + + /// + MovedEvent, + + /// + NewMailEvent, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class PullSubscriptionRequestType : BaseSubscriptionRequestType + { + + private int timeoutField; + + /// + public int Timeout + { + get + { + return this.timeoutField; + } + set + { + this.timeoutField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class PushSubscriptionRequestType : BaseSubscriptionRequestType + { + + private int statusFrequencyField; + + private string uRLField; + + /// + public int StatusFrequency + { + get + { + return this.statusFrequencyField; + } + set + { + this.statusFrequencyField = value; + } + } + + /// + public string URL + { + get + { + return this.uRLField; + } + set + { + this.uRLField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class AttachmentResponseShapeType + { + + private bool includeMimeContentField; + + private bool includeMimeContentFieldSpecified; + + private BodyTypeResponseType bodyTypeField; + + private bool bodyTypeFieldSpecified; + + private BasePathToElementType[] additionalPropertiesField; + + /// + public bool IncludeMimeContent + { + get + { + return this.includeMimeContentField; + } + set + { + this.includeMimeContentField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IncludeMimeContentSpecified + { + get + { + return this.includeMimeContentFieldSpecified; + } + set + { + this.includeMimeContentFieldSpecified = value; + } + } + + /// + public BodyTypeResponseType BodyType + { + get + { + return this.bodyTypeField; + } + set + { + this.bodyTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool BodyTypeSpecified + { + get + { + return this.bodyTypeFieldSpecified; + } + set + { + this.bodyTypeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("ExtendedFieldURI", typeof(PathToExtendedFieldType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("FieldURI", typeof(PathToUnindexedFieldType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("IndexedFieldURI", typeof(PathToIndexedFieldType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("Path", IsNullable = false)] + public BasePathToElementType[] AdditionalProperties + { + get + { + return this.additionalPropertiesField; + } + set + { + this.additionalPropertiesField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum BodyTypeResponseType + { + + /// + Best, + + /// + HTML, + + /// + Text, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class FieldOrderType + { + + private BasePathToElementType itemField; + + private SortDirectionType orderField; + + /// + [System.Xml.Serialization.XmlElementAttribute("ExtendedFieldURI", typeof(PathToExtendedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("FieldURI", typeof(PathToUnindexedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("IndexedFieldURI", typeof(PathToIndexedFieldType))] + public BasePathToElementType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public SortDirectionType Order + { + get + { + return this.orderField; + } + set + { + this.orderField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum SortDirectionType + { + + /// + Ascending, + + /// + Descending, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class AggregateOnType + { + + private BasePathToElementType itemField; + + private AggregateType aggregateField; + + /// + [System.Xml.Serialization.XmlElementAttribute("ExtendedFieldURI", typeof(PathToExtendedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("FieldURI", typeof(PathToUnindexedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("IndexedFieldURI", typeof(PathToIndexedFieldType))] + public BasePathToElementType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public AggregateType Aggregate + { + get + { + return this.aggregateField; + } + set + { + this.aggregateField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum AggregateType + { + + /// + Minimum, + + /// + Maximum, + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DistinguishedGroupByType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GroupByType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class BaseGroupByType + { + + private SortDirectionType orderField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public SortDirectionType Order + { + get + { + return this.orderField; + } + set + { + this.orderField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class DistinguishedGroupByType : BaseGroupByType + { + + private StandardGroupByType standardGroupByField; + + /// + public StandardGroupByType StandardGroupBy + { + get + { + return this.standardGroupByField; + } + set + { + this.standardGroupByField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum StandardGroupByType + { + + /// + ConversationTopic, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class GroupByType : BaseGroupByType + { + + private BasePathToElementType itemField; + + private AggregateOnType aggregateOnField; + + /// + [System.Xml.Serialization.XmlElementAttribute("ExtendedFieldURI", typeof(PathToExtendedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("FieldURI", typeof(PathToUnindexedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("IndexedFieldURI", typeof(PathToIndexedFieldType))] + public BasePathToElementType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + public AggregateOnType AggregateOn + { + get + { + return this.aggregateOnField; + } + set + { + this.aggregateOnField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ItemChangeType + { + + private BaseItemIdType itemField; + + private ItemChangeDescriptionType[] updatesField; + + /// + [System.Xml.Serialization.XmlElementAttribute("ItemId", typeof(ItemIdType))] + [System.Xml.Serialization.XmlElementAttribute("OccurrenceItemId", typeof(OccurrenceItemIdType))] + [System.Xml.Serialization.XmlElementAttribute("RecurringMasterItemId", typeof(RecurringMasterItemIdType))] + public BaseItemIdType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("AppendToItemField", typeof(AppendToItemFieldType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("DeleteItemField", typeof(DeleteItemFieldType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("SetItemField", typeof(SetItemFieldType), IsNullable = false)] + public ItemChangeDescriptionType[] Updates + { + get + { + return this.updatesField; + } + set + { + this.updatesField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class AppendToItemFieldType : ItemChangeDescriptionType + { + + private ItemType item1Field; + + /// + [System.Xml.Serialization.XmlElementAttribute("CalendarItem", typeof(CalendarItemType))] + [System.Xml.Serialization.XmlElementAttribute("Contact", typeof(ContactItemType))] + [System.Xml.Serialization.XmlElementAttribute("DistributionList", typeof(DistributionListType))] + [System.Xml.Serialization.XmlElementAttribute("Item", typeof(ItemType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingCancellation", typeof(MeetingCancellationMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingMessage", typeof(MeetingMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingRequest", typeof(MeetingRequestMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingResponse", typeof(MeetingResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("Message", typeof(MessageType))] + [System.Xml.Serialization.XmlElementAttribute("PostItem", typeof(PostItemType))] + [System.Xml.Serialization.XmlElementAttribute("Task", typeof(TaskType))] + public ItemType Item1 + { + get + { + return this.item1Field; + } + set + { + this.item1Field = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AppendToItemFieldType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteItemFieldType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SetItemFieldType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ItemChangeDescriptionType : ChangeDescriptionType + { + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FolderChangeDescriptionType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AppendToFolderFieldType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteFolderFieldType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SetFolderFieldType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ItemChangeDescriptionType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AppendToItemFieldType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteItemFieldType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SetItemFieldType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class ChangeDescriptionType + { + + private BasePathToElementType itemField; + + /// + [System.Xml.Serialization.XmlElementAttribute("ExtendedFieldURI", typeof(PathToExtendedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("FieldURI", typeof(PathToUnindexedFieldType))] + [System.Xml.Serialization.XmlElementAttribute("IndexedFieldURI", typeof(PathToIndexedFieldType))] + public BasePathToElementType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AppendToFolderFieldType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteFolderFieldType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SetFolderFieldType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class FolderChangeDescriptionType : ChangeDescriptionType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class AppendToFolderFieldType : FolderChangeDescriptionType + { + + private BaseFolderType item1Field; + + /// + [System.Xml.Serialization.XmlElementAttribute("CalendarFolder", typeof(CalendarFolderType))] + [System.Xml.Serialization.XmlElementAttribute("ContactsFolder", typeof(ContactsFolderType))] + [System.Xml.Serialization.XmlElementAttribute("Folder", typeof(FolderType))] + [System.Xml.Serialization.XmlElementAttribute("SearchFolder", typeof(SearchFolderType))] + [System.Xml.Serialization.XmlElementAttribute("TasksFolder", typeof(TasksFolderType))] + public BaseFolderType Item1 + { + get + { + return this.item1Field; + } + set + { + this.item1Field = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class DeleteFolderFieldType : FolderChangeDescriptionType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SetFolderFieldType : FolderChangeDescriptionType + { + + private BaseFolderType item1Field; + + /// + [System.Xml.Serialization.XmlElementAttribute("CalendarFolder", typeof(CalendarFolderType))] + [System.Xml.Serialization.XmlElementAttribute("ContactsFolder", typeof(ContactsFolderType))] + [System.Xml.Serialization.XmlElementAttribute("Folder", typeof(FolderType))] + [System.Xml.Serialization.XmlElementAttribute("SearchFolder", typeof(SearchFolderType))] + [System.Xml.Serialization.XmlElementAttribute("TasksFolder", typeof(TasksFolderType))] + public BaseFolderType Item1 + { + get + { + return this.item1Field; + } + set + { + this.item1Field = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class DeleteItemFieldType : ItemChangeDescriptionType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SetItemFieldType : ItemChangeDescriptionType + { + + private ItemType item1Field; + + /// + [System.Xml.Serialization.XmlElementAttribute("CalendarItem", typeof(CalendarItemType))] + [System.Xml.Serialization.XmlElementAttribute("Contact", typeof(ContactItemType))] + [System.Xml.Serialization.XmlElementAttribute("DistributionList", typeof(DistributionListType))] + [System.Xml.Serialization.XmlElementAttribute("Item", typeof(ItemType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingCancellation", typeof(MeetingCancellationMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingMessage", typeof(MeetingMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingRequest", typeof(MeetingRequestMessageType))] + [System.Xml.Serialization.XmlElementAttribute("MeetingResponse", typeof(MeetingResponseMessageType))] + [System.Xml.Serialization.XmlElementAttribute("Message", typeof(MessageType))] + [System.Xml.Serialization.XmlElementAttribute("PostItem", typeof(PostItemType))] + [System.Xml.Serialization.XmlElementAttribute("Task", typeof(TaskType))] + public ItemType Item1 + { + get + { + return this.item1Field; + } + set + { + this.item1Field = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ItemResponseShapeType + { + + private DefaultShapeNamesType baseShapeField; + + private bool includeMimeContentField; + + private bool includeMimeContentFieldSpecified; + + private BodyTypeResponseType bodyTypeField; + + private bool bodyTypeFieldSpecified; + + private BasePathToElementType[] additionalPropertiesField; + + /// + public DefaultShapeNamesType BaseShape + { + get + { + return this.baseShapeField; + } + set + { + this.baseShapeField = value; + } + } + + /// + public bool IncludeMimeContent + { + get + { + return this.includeMimeContentField; + } + set + { + this.includeMimeContentField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IncludeMimeContentSpecified + { + get + { + return this.includeMimeContentFieldSpecified; + } + set + { + this.includeMimeContentFieldSpecified = value; + } + } + + /// + public BodyTypeResponseType BodyType + { + get + { + return this.bodyTypeField; + } + set + { + this.bodyTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool BodyTypeSpecified + { + get + { + return this.bodyTypeFieldSpecified; + } + set + { + this.bodyTypeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("ExtendedFieldURI", typeof(PathToExtendedFieldType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("FieldURI", typeof(PathToUnindexedFieldType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("IndexedFieldURI", typeof(PathToIndexedFieldType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("Path", IsNullable = false)] + public BasePathToElementType[] AdditionalProperties + { + get + { + return this.additionalPropertiesField; + } + set + { + this.additionalPropertiesField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum DefaultShapeNamesType + { + + /// + IdOnly, + + /// + Default, + + /// + AllProperties, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class FolderChangeType + { + + private BaseFolderIdType itemField; + + private FolderChangeDescriptionType[] updatesField; + + /// + [System.Xml.Serialization.XmlElementAttribute("DistinguishedFolderId", typeof(DistinguishedFolderIdType))] + [System.Xml.Serialization.XmlElementAttribute("FolderId", typeof(FolderIdType))] + public BaseFolderIdType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("AppendToFolderField", typeof(AppendToFolderFieldType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("DeleteFolderField", typeof(DeleteFolderFieldType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("SetFolderField", typeof(SetFolderFieldType), IsNullable = false)] + public FolderChangeDescriptionType[] Updates + { + get + { + return this.updatesField; + } + set + { + this.updatesField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContactsViewType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CalendarViewType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FractionalPageViewType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(IndexedPageViewType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public abstract partial class BasePagingType + { + + private int maxEntriesReturnedField; + + private bool maxEntriesReturnedFieldSpecified; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int MaxEntriesReturned + { + get + { + return this.maxEntriesReturnedField; + } + set + { + this.maxEntriesReturnedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MaxEntriesReturnedSpecified + { + get + { + return this.maxEntriesReturnedFieldSpecified; + } + set + { + this.maxEntriesReturnedFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ContactsViewType : BasePagingType + { + + private string initialNameField; + + private string finalNameField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string InitialName + { + get + { + return this.initialNameField; + } + set + { + this.initialNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string FinalName + { + get + { + return this.finalNameField; + } + set + { + this.finalNameField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class CalendarViewType : BasePagingType + { + + private System.DateTime startDateField; + + private System.DateTime endDateField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime StartDate + { + get + { + return this.startDateField; + } + set + { + this.startDateField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime EndDate + { + get + { + return this.endDateField; + } + set + { + this.endDateField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class FractionalPageViewType : BasePagingType + { + + private int numeratorField; + + private int denominatorField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int Numerator + { + get + { + return this.numeratorField; + } + set + { + this.numeratorField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int Denominator + { + get + { + return this.denominatorField; + } + set + { + this.denominatorField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class IndexedPageViewType : BasePagingType + { + + private int offsetField; + + private IndexBasePointType basePointField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public int Offset + { + get + { + return this.offsetField; + } + set + { + this.offsetField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public IndexBasePointType BasePoint + { + get + { + return this.basePointField; + } + set + { + this.basePointField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum IndexBasePointType + { + + /// + Beginning, + + /// + End, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class TargetFolderIdType + { + + private BaseFolderIdType itemField; + + /// + [System.Xml.Serialization.XmlElementAttribute("DistinguishedFolderId", typeof(DistinguishedFolderIdType))] + [System.Xml.Serialization.XmlElementAttribute("FolderId", typeof(FolderIdType))] + public BaseFolderIdType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class FolderResponseShapeType + { + + private DefaultShapeNamesType baseShapeField; + + private BasePathToElementType[] additionalPropertiesField; + + /// + public DefaultShapeNamesType BaseShape + { + get + { + return this.baseShapeField; + } + set + { + this.baseShapeField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("ExtendedFieldURI", typeof(PathToExtendedFieldType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("FieldURI", typeof(PathToUnindexedFieldType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("IndexedFieldURI", typeof(PathToIndexedFieldType), IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("Path", IsNullable = false)] + public BasePathToElementType[] AdditionalProperties + { + get + { + return this.additionalPropertiesField; + } + set + { + this.additionalPropertiesField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseDelegateType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UpdateDelegateType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RemoveDelegateType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AddDelegateType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetDelegateType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ConvertIdType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SetUserOofSettingsRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetUserOofSettingsRequest))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetUserAvailabilityRequestType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SyncFolderItemsType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SyncFolderHierarchyType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetEventsType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UnsubscribeType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SubscribeType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreateManagedFolderRequestType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ExpandDLType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResolveNamesType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetAttachmentType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteAttachmentType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreateAttachmentType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FindItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(SendItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseMoveCopyItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CopyItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MoveItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UpdateItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreateItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UpdateFolderType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseMoveCopyFolderType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CopyFolderType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MoveFolderType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(DeleteFolderType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(FindFolderType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CreateFolderType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetFolderType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public abstract partial class BaseRequestType + { + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(UpdateDelegateType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(RemoveDelegateType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(AddDelegateType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetDelegateType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public abstract partial class BaseDelegateType : BaseRequestType + { + + private EmailAddressType mailboxField; + + /// + public EmailAddressType Mailbox + { + get + { + return this.mailboxField; + } + set + { + this.mailboxField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class UpdateDelegateType : BaseDelegateType + { + + private DelegateUserType[] delegateUsersField; + + private DeliverMeetingRequestsType deliverMeetingRequestsField; + + private bool deliverMeetingRequestsFieldSpecified; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("DelegateUser", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public DelegateUserType[] DelegateUsers + { + get + { + return this.delegateUsersField; + } + set + { + this.delegateUsersField = value; + } + } + + /// + public DeliverMeetingRequestsType DeliverMeetingRequests + { + get + { + return this.deliverMeetingRequestsField; + } + set + { + this.deliverMeetingRequestsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DeliverMeetingRequestsSpecified + { + get + { + return this.deliverMeetingRequestsFieldSpecified; + } + set + { + this.deliverMeetingRequestsFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class RemoveDelegateType : BaseDelegateType + { + + private UserIdType[] userIdsField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("UserId", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public UserIdType[] UserIds + { + get + { + return this.userIdsField; + } + set + { + this.userIdsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class AddDelegateType : BaseDelegateType + { + + private DelegateUserType[] delegateUsersField; + + private DeliverMeetingRequestsType deliverMeetingRequestsField; + + private bool deliverMeetingRequestsFieldSpecified; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("DelegateUser", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public DelegateUserType[] DelegateUsers + { + get + { + return this.delegateUsersField; + } + set + { + this.delegateUsersField = value; + } + } + + /// + public DeliverMeetingRequestsType DeliverMeetingRequests + { + get + { + return this.deliverMeetingRequestsField; + } + set + { + this.deliverMeetingRequestsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DeliverMeetingRequestsSpecified + { + get + { + return this.deliverMeetingRequestsFieldSpecified; + } + set + { + this.deliverMeetingRequestsFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetDelegateType : BaseDelegateType + { + + private UserIdType[] userIdsField; + + private bool includePermissionsField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("UserId", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public UserIdType[] UserIds + { + get + { + return this.userIdsField; + } + set + { + this.userIdsField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool IncludePermissions + { + get + { + return this.includePermissionsField; + } + set + { + this.includePermissionsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class ConvertIdType : BaseRequestType + { + + private AlternateIdBaseType[] sourceIdsField; + + private IdFormatType destinationFormatField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("AlternateId", typeof(AlternateIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("AlternatePublicFolderId", typeof(AlternatePublicFolderIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("AlternatePublicFolderItemId", typeof(AlternatePublicFolderItemIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public AlternateIdBaseType[] SourceIds + { + get + { + return this.sourceIdsField; + } + set + { + this.sourceIdsField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public IdFormatType DestinationFormat + { + get + { + return this.destinationFormatField; + } + set + { + this.destinationFormatField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SetUserOofSettingsRequest : BaseRequestType + { + + private EmailAddress mailboxField; + + private UserOofSettings userOofSettingsField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public EmailAddress Mailbox + { + get + { + return this.mailboxField; + } + set + { + this.mailboxField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public UserOofSettings UserOofSettings + { + get + { + return this.userOofSettingsField; + } + set + { + this.userOofSettingsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetUserOofSettingsRequest : BaseRequestType + { + + private EmailAddress mailboxField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public EmailAddress Mailbox + { + get + { + return this.mailboxField; + } + set + { + this.mailboxField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetUserAvailabilityRequestType : BaseRequestType + { + + private SerializableTimeZone timeZoneField; + + private MailboxData[] mailboxDataArrayField; + + private FreeBusyViewOptionsType freeBusyViewOptionsField; + + private SuggestionsViewOptionsType suggestionsViewOptionsField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public SerializableTimeZone TimeZone + { + get + { + return this.timeZoneField; + } + set + { + this.timeZoneField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public MailboxData[] MailboxDataArray + { + get + { + return this.mailboxDataArrayField; + } + set + { + this.mailboxDataArrayField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public FreeBusyViewOptionsType FreeBusyViewOptions + { + get + { + return this.freeBusyViewOptionsField; + } + set + { + this.freeBusyViewOptionsField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public SuggestionsViewOptionsType SuggestionsViewOptions + { + get + { + return this.suggestionsViewOptionsField; + } + set + { + this.suggestionsViewOptionsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SyncFolderItemsType : BaseRequestType + { + + private ItemResponseShapeType itemShapeField; + + private TargetFolderIdType syncFolderIdField; + + private string syncStateField; + + private ItemIdType[] ignoreField; + + private int maxChangesReturnedField; + + /// + public ItemResponseShapeType ItemShape + { + get + { + return this.itemShapeField; + } + set + { + this.itemShapeField = value; + } + } + + /// + public TargetFolderIdType SyncFolderId + { + get + { + return this.syncFolderIdField; + } + set + { + this.syncFolderIdField = value; + } + } + + /// + public string SyncState + { + get + { + return this.syncStateField; + } + set + { + this.syncStateField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("ItemId", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public ItemIdType[] Ignore + { + get + { + return this.ignoreField; + } + set + { + this.ignoreField = value; + } + } + + /// + public int MaxChangesReturned + { + get + { + return this.maxChangesReturnedField; + } + set + { + this.maxChangesReturnedField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SyncFolderHierarchyType : BaseRequestType + { + + private FolderResponseShapeType folderShapeField; + + private TargetFolderIdType syncFolderIdField; + + private string syncStateField; + + /// + public FolderResponseShapeType FolderShape + { + get + { + return this.folderShapeField; + } + set + { + this.folderShapeField = value; + } + } + + /// + public TargetFolderIdType SyncFolderId + { + get + { + return this.syncFolderIdField; + } + set + { + this.syncFolderIdField = value; + } + } + + /// + public string SyncState + { + get + { + return this.syncStateField; + } + set + { + this.syncStateField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetEventsType : BaseRequestType + { + + private string subscriptionIdField; + + private string watermarkField; + + /// + public string SubscriptionId + { + get + { + return this.subscriptionIdField; + } + set + { + this.subscriptionIdField = value; + } + } + + /// + public string Watermark + { + get + { + return this.watermarkField; + } + set + { + this.watermarkField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class UnsubscribeType : BaseRequestType + { + + private string subscriptionIdField; + + /// + public string SubscriptionId + { + get + { + return this.subscriptionIdField; + } + set + { + this.subscriptionIdField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SubscribeType : BaseRequestType + { + + private BaseSubscriptionRequestType itemField; + + /// + [System.Xml.Serialization.XmlElementAttribute("PullSubscriptionRequest", typeof(PullSubscriptionRequestType))] + [System.Xml.Serialization.XmlElementAttribute("PushSubscriptionRequest", typeof(PushSubscriptionRequestType))] + public BaseSubscriptionRequestType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class CreateManagedFolderRequestType : BaseRequestType + { + + private string[] folderNamesField; + + private EmailAddressType mailboxField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("FolderName", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public string[] FolderNames + { + get + { + return this.folderNamesField; + } + set + { + this.folderNamesField = value; + } + } + + /// + public EmailAddressType Mailbox + { + get + { + return this.mailboxField; + } + set + { + this.mailboxField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class ExpandDLType : BaseRequestType + { + + private EmailAddressType mailboxField; + + /// + public EmailAddressType Mailbox + { + get + { + return this.mailboxField; + } + set + { + this.mailboxField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class ResolveNamesType : BaseRequestType + { + + private BaseFolderIdType[] parentFolderIdsField; + + private string unresolvedEntryField; + + private bool returnFullContactDataField; + + private ResolveNamesSearchScopeType searchScopeField; + + public ResolveNamesType() + { + this.searchScopeField = ResolveNamesSearchScopeType.ActiveDirectoryContacts; + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("DistinguishedFolderId", typeof(DistinguishedFolderIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("FolderId", typeof(FolderIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public BaseFolderIdType[] ParentFolderIds + { + get + { + return this.parentFolderIdsField; + } + set + { + this.parentFolderIdsField = value; + } + } + + /// + public string UnresolvedEntry + { + get + { + return this.unresolvedEntryField; + } + set + { + this.unresolvedEntryField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool ReturnFullContactData + { + get + { + return this.returnFullContactDataField; + } + set + { + this.returnFullContactDataField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + [System.ComponentModel.DefaultValueAttribute(ResolveNamesSearchScopeType.ActiveDirectoryContacts)] + public ResolveNamesSearchScopeType SearchScope + { + get + { + return this.searchScopeField; + } + set + { + this.searchScopeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum ResolveNamesSearchScopeType + { + + /// + ActiveDirectory, + + /// + ActiveDirectoryContacts, + + /// + Contacts, + + /// + ContactsActiveDirectory, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetAttachmentType : BaseRequestType + { + + private AttachmentResponseShapeType attachmentShapeField; + + private RequestAttachmentIdType[] attachmentIdsField; + + /// + public AttachmentResponseShapeType AttachmentShape + { + get + { + return this.attachmentShapeField; + } + set + { + this.attachmentShapeField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("AttachmentId", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public RequestAttachmentIdType[] AttachmentIds + { + get + { + return this.attachmentIdsField; + } + set + { + this.attachmentIdsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class DeleteAttachmentType : BaseRequestType + { + + private RequestAttachmentIdType[] attachmentIdsField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("AttachmentId", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public RequestAttachmentIdType[] AttachmentIds + { + get + { + return this.attachmentIdsField; + } + set + { + this.attachmentIdsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class CreateAttachmentType : BaseRequestType + { + + private ItemIdType parentItemIdField; + + private AttachmentType[] attachmentsField; + + /// + public ItemIdType ParentItemId + { + get + { + return this.parentItemIdField; + } + set + { + this.parentItemIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("FileAttachment", typeof(FileAttachmentType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("ItemAttachment", typeof(ItemAttachmentType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public AttachmentType[] Attachments + { + get + { + return this.attachmentsField; + } + set + { + this.attachmentsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class FindItemType : BaseRequestType + { + + private ItemResponseShapeType itemShapeField; + + private BasePagingType itemField; + + private BaseGroupByType item1Field; + + private RestrictionType restrictionField; + + private FieldOrderType[] sortOrderField; + + private BaseFolderIdType[] parentFolderIdsField; + + private ItemQueryTraversalType traversalField; + + /// + public ItemResponseShapeType ItemShape + { + get + { + return this.itemShapeField; + } + set + { + this.itemShapeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("CalendarView", typeof(CalendarViewType))] + [System.Xml.Serialization.XmlElementAttribute("ContactsView", typeof(ContactsViewType))] + [System.Xml.Serialization.XmlElementAttribute("FractionalPageItemView", typeof(FractionalPageViewType))] + [System.Xml.Serialization.XmlElementAttribute("IndexedPageItemView", typeof(IndexedPageViewType))] + public BasePagingType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("DistinguishedGroupBy", typeof(DistinguishedGroupByType))] + [System.Xml.Serialization.XmlElementAttribute("GroupBy", typeof(GroupByType))] + public BaseGroupByType Item1 + { + get + { + return this.item1Field; + } + set + { + this.item1Field = value; + } + } + + /// + public RestrictionType Restriction + { + get + { + return this.restrictionField; + } + set + { + this.restrictionField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("FieldOrder", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public FieldOrderType[] SortOrder + { + get + { + return this.sortOrderField; + } + set + { + this.sortOrderField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("DistinguishedFolderId", typeof(DistinguishedFolderIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("FolderId", typeof(FolderIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public BaseFolderIdType[] ParentFolderIds + { + get + { + return this.parentFolderIdsField; + } + set + { + this.parentFolderIdsField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public ItemQueryTraversalType Traversal + { + get + { + return this.traversalField; + } + set + { + this.traversalField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum ItemQueryTraversalType + { + + /// + Shallow, + + /// + SoftDeleted, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class SendItemType : BaseRequestType + { + + private BaseItemIdType[] itemIdsField; + + private TargetFolderIdType savedItemFolderIdField; + + private bool saveItemToFolderField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("ItemId", typeof(ItemIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("OccurrenceItemId", typeof(OccurrenceItemIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("RecurringMasterItemId", typeof(RecurringMasterItemIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public BaseItemIdType[] ItemIds + { + get + { + return this.itemIdsField; + } + set + { + this.itemIdsField = value; + } + } + + /// + public TargetFolderIdType SavedItemFolderId + { + get + { + return this.savedItemFolderIdField; + } + set + { + this.savedItemFolderIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool SaveItemToFolder + { + get + { + return this.saveItemToFolderField; + } + set + { + this.saveItemToFolderField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CopyItemType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MoveItemType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class BaseMoveCopyItemType : BaseRequestType + { + + private TargetFolderIdType toFolderIdField; + + private BaseItemIdType[] itemIdsField; + + /// + public TargetFolderIdType ToFolderId + { + get + { + return this.toFolderIdField; + } + set + { + this.toFolderIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("ItemId", typeof(ItemIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("OccurrenceItemId", typeof(OccurrenceItemIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("RecurringMasterItemId", typeof(RecurringMasterItemIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public BaseItemIdType[] ItemIds + { + get + { + return this.itemIdsField; + } + set + { + this.itemIdsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class CopyItemType : BaseMoveCopyItemType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class MoveItemType : BaseMoveCopyItemType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class DeleteItemType : BaseRequestType + { + + private BaseItemIdType[] itemIdsField; + + private DisposalType deleteTypeField; + + private CalendarItemCreateOrDeleteOperationType sendMeetingCancellationsField; + + private bool sendMeetingCancellationsFieldSpecified; + + private AffectedTaskOccurrencesType affectedTaskOccurrencesField; + + private bool affectedTaskOccurrencesFieldSpecified; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("ItemId", typeof(ItemIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("OccurrenceItemId", typeof(OccurrenceItemIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("RecurringMasterItemId", typeof(RecurringMasterItemIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public BaseItemIdType[] ItemIds + { + get + { + return this.itemIdsField; + } + set + { + this.itemIdsField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public DisposalType DeleteType + { + get + { + return this.deleteTypeField; + } + set + { + this.deleteTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public CalendarItemCreateOrDeleteOperationType SendMeetingCancellations + { + get + { + return this.sendMeetingCancellationsField; + } + set + { + this.sendMeetingCancellationsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool SendMeetingCancellationsSpecified + { + get + { + return this.sendMeetingCancellationsFieldSpecified; + } + set + { + this.sendMeetingCancellationsFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public AffectedTaskOccurrencesType AffectedTaskOccurrences + { + get + { + return this.affectedTaskOccurrencesField; + } + set + { + this.affectedTaskOccurrencesField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AffectedTaskOccurrencesSpecified + { + get + { + return this.affectedTaskOccurrencesFieldSpecified; + } + set + { + this.affectedTaskOccurrencesFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum DisposalType + { + + /// + HardDelete, + + /// + SoftDelete, + + /// + MoveToDeletedItems, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum CalendarItemCreateOrDeleteOperationType + { + + /// + SendToNone, + + /// + SendOnlyToAll, + + /// + SendToAllAndSaveCopy, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum AffectedTaskOccurrencesType + { + + /// + AllOccurrences, + + /// + SpecifiedOccurrenceOnly, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class UpdateItemType : BaseRequestType + { + + private TargetFolderIdType savedItemFolderIdField; + + private ItemChangeType[] itemChangesField; + + private ConflictResolutionType conflictResolutionField; + + private MessageDispositionType messageDispositionField; + + private bool messageDispositionFieldSpecified; + + private CalendarItemUpdateOperationType sendMeetingInvitationsOrCancellationsField; + + private bool sendMeetingInvitationsOrCancellationsFieldSpecified; + + /// + public TargetFolderIdType SavedItemFolderId + { + get + { + return this.savedItemFolderIdField; + } + set + { + this.savedItemFolderIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("ItemChange", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public ItemChangeType[] ItemChanges + { + get + { + return this.itemChangesField; + } + set + { + this.itemChangesField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public ConflictResolutionType ConflictResolution + { + get + { + return this.conflictResolutionField; + } + set + { + this.conflictResolutionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public MessageDispositionType MessageDisposition + { + get + { + return this.messageDispositionField; + } + set + { + this.messageDispositionField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MessageDispositionSpecified + { + get + { + return this.messageDispositionFieldSpecified; + } + set + { + this.messageDispositionFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public CalendarItemUpdateOperationType SendMeetingInvitationsOrCancellations + { + get + { + return this.sendMeetingInvitationsOrCancellationsField; + } + set + { + this.sendMeetingInvitationsOrCancellationsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool SendMeetingInvitationsOrCancellationsSpecified + { + get + { + return this.sendMeetingInvitationsOrCancellationsFieldSpecified; + } + set + { + this.sendMeetingInvitationsOrCancellationsFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum ConflictResolutionType + { + + /// + NeverOverwrite, + + /// + AutoResolve, + + /// + AlwaysOverwrite, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum MessageDispositionType + { + + /// + SaveOnly, + + /// + SendOnly, + + /// + SendAndSaveCopy, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum CalendarItemUpdateOperationType + { + + /// + SendToNone, + + /// + SendOnlyToAll, + + /// + SendOnlyToChanged, + + /// + SendToAllAndSaveCopy, + + /// + SendToChangedAndSaveCopy, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class CreateItemType : BaseRequestType + { + + private TargetFolderIdType savedItemFolderIdField; + + private NonEmptyArrayOfAllItemsType itemsField; + + private MessageDispositionType messageDispositionField; + + private bool messageDispositionFieldSpecified; + + private CalendarItemCreateOrDeleteOperationType sendMeetingInvitationsField; + + private bool sendMeetingInvitationsFieldSpecified; + + /// + public TargetFolderIdType SavedItemFolderId + { + get + { + return this.savedItemFolderIdField; + } + set + { + this.savedItemFolderIdField = value; + } + } + + /// + public NonEmptyArrayOfAllItemsType Items + { + get + { + return this.itemsField; + } + set + { + this.itemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public MessageDispositionType MessageDisposition + { + get + { + return this.messageDispositionField; + } + set + { + this.messageDispositionField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool MessageDispositionSpecified + { + get + { + return this.messageDispositionFieldSpecified; + } + set + { + this.messageDispositionFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public CalendarItemCreateOrDeleteOperationType SendMeetingInvitations + { + get + { + return this.sendMeetingInvitationsField; + } + set + { + this.sendMeetingInvitationsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool SendMeetingInvitationsSpecified + { + get + { + return this.sendMeetingInvitationsFieldSpecified; + } + set + { + this.sendMeetingInvitationsFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetItemType : BaseRequestType + { + + private ItemResponseShapeType itemShapeField; + + private BaseItemIdType[] itemIdsField; + + /// + public ItemResponseShapeType ItemShape + { + get + { + return this.itemShapeField; + } + set + { + this.itemShapeField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("ItemId", typeof(ItemIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("OccurrenceItemId", typeof(OccurrenceItemIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("RecurringMasterItemId", typeof(RecurringMasterItemIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public BaseItemIdType[] ItemIds + { + get + { + return this.itemIdsField; + } + set + { + this.itemIdsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class UpdateFolderType : BaseRequestType + { + + private FolderChangeType[] folderChangesField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("FolderChange", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public FolderChangeType[] FolderChanges + { + get + { + return this.folderChangesField; + } + set + { + this.folderChangesField = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(CopyFolderType))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(MoveFolderType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class BaseMoveCopyFolderType : BaseRequestType + { + + private TargetFolderIdType toFolderIdField; + + private BaseFolderIdType[] folderIdsField; + + /// + public TargetFolderIdType ToFolderId + { + get + { + return this.toFolderIdField; + } + set + { + this.toFolderIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("DistinguishedFolderId", typeof(DistinguishedFolderIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("FolderId", typeof(FolderIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public BaseFolderIdType[] FolderIds + { + get + { + return this.folderIdsField; + } + set + { + this.folderIdsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class CopyFolderType : BaseMoveCopyFolderType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class MoveFolderType : BaseMoveCopyFolderType + { + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class DeleteFolderType : BaseRequestType + { + + private BaseFolderIdType[] folderIdsField; + + private DisposalType deleteTypeField; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("DistinguishedFolderId", typeof(DistinguishedFolderIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("FolderId", typeof(FolderIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public BaseFolderIdType[] FolderIds + { + get + { + return this.folderIdsField; + } + set + { + this.folderIdsField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public DisposalType DeleteType + { + get + { + return this.deleteTypeField; + } + set + { + this.deleteTypeField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class FindFolderType : BaseRequestType + { + + private FolderResponseShapeType folderShapeField; + + private BasePagingType itemField; + + private RestrictionType restrictionField; + + private BaseFolderIdType[] parentFolderIdsField; + + private FolderQueryTraversalType traversalField; + + /// + public FolderResponseShapeType FolderShape + { + get + { + return this.folderShapeField; + } + set + { + this.folderShapeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("FractionalPageFolderView", typeof(FractionalPageViewType))] + [System.Xml.Serialization.XmlElementAttribute("IndexedPageFolderView", typeof(IndexedPageViewType))] + public BasePagingType Item + { + get + { + return this.itemField; + } + set + { + this.itemField = value; + } + } + + /// + public RestrictionType Restriction + { + get + { + return this.restrictionField; + } + set + { + this.restrictionField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("DistinguishedFolderId", typeof(DistinguishedFolderIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("FolderId", typeof(FolderIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public BaseFolderIdType[] ParentFolderIds + { + get + { + return this.parentFolderIdsField; + } + set + { + this.parentFolderIdsField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public FolderQueryTraversalType Traversal + { + get + { + return this.traversalField; + } + set + { + this.traversalField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum FolderQueryTraversalType + { + + /// + Shallow, + + /// + Deep, + + /// + SoftDeleted, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class CreateFolderType : BaseRequestType + { + + private TargetFolderIdType parentFolderIdField; + + private BaseFolderType[] foldersField; + + /// + public TargetFolderIdType ParentFolderId + { + get + { + return this.parentFolderIdField; + } + set + { + this.parentFolderIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("CalendarFolder", typeof(CalendarFolderType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("ContactsFolder", typeof(ContactsFolderType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("Folder", typeof(FolderType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("SearchFolder", typeof(SearchFolderType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("TasksFolder", typeof(TasksFolderType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public BaseFolderType[] Folders + { + get + { + return this.foldersField; + } + set + { + this.foldersField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/messages")] + public partial class GetFolderType : BaseRequestType + { + + private FolderResponseShapeType folderShapeField; + + private BaseFolderIdType[] folderIdsField; + + /// + public FolderResponseShapeType FolderShape + { + get + { + return this.folderShapeField; + } + set + { + this.folderShapeField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("DistinguishedFolderId", typeof(DistinguishedFolderIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + [System.Xml.Serialization.XmlArrayItemAttribute("FolderId", typeof(FolderIdType), Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public BaseFolderIdType[] FolderIds + { + get + { + return this.folderIdsField; + } + set + { + this.folderIdsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class SidAndAttributesType + { + + private string securityIdentifierField; + + private uint attributesField; + + /// + public string SecurityIdentifier + { + get + { + return this.securityIdentifierField; + } + set + { + this.securityIdentifierField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public uint Attributes + { + get + { + return this.attributesField; + } + set + { + this.attributesField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public partial class ConnectingSIDType + { + + private string principalNameField; + + private string sIDField; + + private string primarySmtpAddressField; + + /// + public string PrincipalName + { + get + { + return this.principalNameField; + } + set + { + this.principalNameField = value; + } + } + + /// + public string SID + { + get + { + return this.sIDField; + } + set + { + this.sIDField = value; + } + } + + /// + public string PrimarySmtpAddress + { + get + { + return this.primarySmtpAddressField; + } + set + { + this.primarySmtpAddressField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.w3.org/2001/XMLSchema")] + [System.Xml.Serialization.XmlRootAttribute("MailboxCulture", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public partial class language : System.Web.Services.Protocols.SoapHeader + { + + private string[] textField; + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string[] Text + { + get + { + return this.textField; + } + set + { + this.textField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + [System.Xml.Serialization.XmlRootAttribute("SerializedSecurityContext", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public partial class SerializedSecurityContextType : System.Web.Services.Protocols.SoapHeader + { + + private string userSidField; + + private SidAndAttributesType[] groupSidsField; + + private SidAndAttributesType[] restrictedGroupSidsField; + + private string primarySmtpAddressField; + + /// + public string UserSid + { + get + { + return this.userSidField; + } + set + { + this.userSidField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("GroupIdentifier", IsNullable = false)] + public SidAndAttributesType[] GroupSids + { + get + { + return this.groupSidsField; + } + set + { + this.groupSidsField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayItemAttribute("RestrictedGroupIdentifier", IsNullable = false)] + public SidAndAttributesType[] RestrictedGroupSids + { + get + { + return this.restrictedGroupSidsField; + } + set + { + this.restrictedGroupSidsField = value; + } + } + + /// + public string PrimarySmtpAddress + { + get + { + return this.primarySmtpAddressField; + } + set + { + this.primarySmtpAddressField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + [System.Xml.Serialization.XmlRootAttribute("ProxyRequestTypeHeader", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public partial class AvailabilityProxyRequestType : System.Web.Services.Protocols.SoapHeader + { + + private string[] textField; + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string[] Text + { + get + { + return this.textField; + } + set + { + this.textField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + [System.Xml.Serialization.XmlRootAttribute("ExchangeImpersonation", Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public partial class ExchangeImpersonationType : System.Web.Services.Protocols.SoapHeader + { + + private ConnectingSIDType connectingSIDField; + + /// + public ConnectingSIDType ConnectingSID + { + get + { + return this.connectingSIDField; + } + set + { + this.connectingSIDField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types", IsNullable = false)] + public partial class RequestServerVersion : System.Web.Services.Protocols.SoapHeader + { + + private ExchangeVersionType versionField; + + private System.Xml.XmlAttribute[] anyAttrField; + + public RequestServerVersion() + { + this.versionField = ExchangeVersionType.Exchange2007_SP1; + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public ExchangeVersionType Version + { + get + { + return this.versionField; + } + set + { + this.versionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAnyAttributeAttribute()] + public System.Xml.XmlAttribute[] AnyAttr + { + get + { + return this.anyAttrField; + } + set + { + this.anyAttrField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.SerializableAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/exchange/services/2006/types")] + public enum ExchangeVersionType + { + + /// + Exchange2007, + + /// + Exchange2007_SP1, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void ResolveNamesCompletedEventHandler(object sender, ResolveNamesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ResolveNamesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal ResolveNamesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResolveNamesResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResolveNamesResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void ExpandDLCompletedEventHandler(object sender, ExpandDLCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ExpandDLCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal ExpandDLCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ExpandDLResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ExpandDLResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void FindFolderCompletedEventHandler(object sender, FindFolderCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class FindFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal FindFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public FindFolderResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((FindFolderResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void FindItemCompletedEventHandler(object sender, FindItemCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class FindItemCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal FindItemCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public FindItemResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((FindItemResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void GetFolderCompletedEventHandler(object sender, GetFolderCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public GetFolderResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((GetFolderResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void ConvertIdCompletedEventHandler(object sender, ConvertIdCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ConvertIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal ConvertIdCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ConvertIdResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ConvertIdResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void CreateFolderCompletedEventHandler(object sender, CreateFolderCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal CreateFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public CreateFolderResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((CreateFolderResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void DeleteFolderCompletedEventHandler(object sender, DeleteFolderCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal DeleteFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public DeleteFolderResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((DeleteFolderResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void UpdateFolderCompletedEventHandler(object sender, UpdateFolderCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal UpdateFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public UpdateFolderResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((UpdateFolderResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void MoveFolderCompletedEventHandler(object sender, MoveFolderCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class MoveFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal MoveFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public MoveFolderResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((MoveFolderResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void CopyFolderCompletedEventHandler(object sender, CopyFolderCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CopyFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal CopyFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public CopyFolderResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((CopyFolderResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void SubscribeCompletedEventHandler(object sender, SubscribeCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SubscribeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal SubscribeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public SubscribeResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((SubscribeResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void UnsubscribeCompletedEventHandler(object sender, UnsubscribeCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UnsubscribeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal UnsubscribeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public UnsubscribeResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((UnsubscribeResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void GetEventsCompletedEventHandler(object sender, GetEventsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetEventsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetEventsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public GetEventsResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((GetEventsResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void SyncFolderHierarchyCompletedEventHandler(object sender, SyncFolderHierarchyCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SyncFolderHierarchyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal SyncFolderHierarchyCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public SyncFolderHierarchyResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((SyncFolderHierarchyResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void SyncFolderItemsCompletedEventHandler(object sender, SyncFolderItemsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SyncFolderItemsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal SyncFolderItemsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public SyncFolderItemsResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((SyncFolderItemsResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void CreateManagedFolderCompletedEventHandler(object sender, CreateManagedFolderCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateManagedFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal CreateManagedFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public CreateManagedFolderResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((CreateManagedFolderResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void GetItemCompletedEventHandler(object sender, GetItemCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetItemCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetItemCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public GetItemResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((GetItemResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void CreateItemCompletedEventHandler(object sender, CreateItemCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateItemCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal CreateItemCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public CreateItemResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((CreateItemResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void DeleteItemCompletedEventHandler(object sender, DeleteItemCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteItemCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal DeleteItemCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public DeleteItemResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((DeleteItemResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void UpdateItemCompletedEventHandler(object sender, UpdateItemCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateItemCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal UpdateItemCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public UpdateItemResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((UpdateItemResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void SendItemCompletedEventHandler(object sender, SendItemCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SendItemCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal SendItemCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public SendItemResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((SendItemResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void MoveItemCompletedEventHandler(object sender, MoveItemCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class MoveItemCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal MoveItemCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public MoveItemResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((MoveItemResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void CopyItemCompletedEventHandler(object sender, CopyItemCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CopyItemCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal CopyItemCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public CopyItemResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((CopyItemResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void CreateAttachmentCompletedEventHandler(object sender, CreateAttachmentCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateAttachmentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal CreateAttachmentCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public CreateAttachmentResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((CreateAttachmentResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void DeleteAttachmentCompletedEventHandler(object sender, DeleteAttachmentCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteAttachmentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal DeleteAttachmentCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public DeleteAttachmentResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((DeleteAttachmentResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void GetAttachmentCompletedEventHandler(object sender, GetAttachmentCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetAttachmentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetAttachmentCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public GetAttachmentResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((GetAttachmentResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void GetDelegateCompletedEventHandler(object sender, GetDelegateCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetDelegateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetDelegateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public GetDelegateResponseMessageType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((GetDelegateResponseMessageType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void AddDelegateCompletedEventHandler(object sender, AddDelegateCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddDelegateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal AddDelegateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public AddDelegateResponseMessageType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((AddDelegateResponseMessageType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void RemoveDelegateCompletedEventHandler(object sender, RemoveDelegateCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RemoveDelegateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal RemoveDelegateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public RemoveDelegateResponseMessageType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((RemoveDelegateResponseMessageType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void UpdateDelegateCompletedEventHandler(object sender, UpdateDelegateCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateDelegateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal UpdateDelegateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public UpdateDelegateResponseMessageType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((UpdateDelegateResponseMessageType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void GetUserAvailabilityCompletedEventHandler(object sender, GetUserAvailabilityCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetUserAvailabilityCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetUserAvailabilityCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public GetUserAvailabilityResponseType Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((GetUserAvailabilityResponseType)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void GetUserOofSettingsCompletedEventHandler(object sender, GetUserOofSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetUserOofSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetUserOofSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public GetUserOofSettingsResponse Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((GetUserOofSettingsResponse)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + public delegate void SetUserOofSettingsCompletedEventHandler(object sender, SetUserOofSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetUserOofSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal SetUserOofSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public SetUserOofSettingsResponse Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((SetUserOofSettingsResponse)(this.results[0])); + } + } + } +} diff --git a/Code/Channels/Exchange/Inbox2.Channels.Exchange.csproj b/Code/Channels/Exchange/Inbox2.Channels.Exchange.csproj new file mode 100644 index 0000000..0a27077 --- /dev/null +++ b/Code/Channels/Exchange/Inbox2.Channels.Exchange.csproj @@ -0,0 +1,193 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {357C154B-152A-4381-A5C2-A17A5993B129} + Library + Properties + Inbox2.Channels.Exchange + Inbox2.Channels.Exchange + v3.5 + 512 + OnOutputUpdated + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\..\Stable Assemblies\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + + False + ..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + 3.5 + + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + {43B96CD2-D7DA-4286-A209-EE9585EF6927} + Inbox2.Platform.Channels + + + {FB90E43A-0E32-41D5-A7AB-83EA0D936E5E} + Inbox2.Platform.Framework + + + {B9CE1540-1D68-43B2-83DB-47EC21D158A6} + Inbox2.Platform.Interfaces + + + {6AE2A2AF-9B61-45B0-A375-666C5225A5B4} + Inbox2.Platform.Logging + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Code/Channels/Exchange/Properties/AssemblyInfo.cs b/Code/Channels/Exchange/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..4ddc77f --- /dev/null +++ b/Code/Channels/Exchange/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2.Channels.Exchange")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2.Channels.Exchange")] +[assembly: AssemblyCopyright("Copyright © Tabdeelee 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("121474e6-35ab-4823-b8a3-7a354dd48e63")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Code/Channels/Exchange/Resources/icon-10.png b/Code/Channels/Exchange/Resources/icon-10.png new file mode 100644 index 0000000..7c888b3 Binary files /dev/null and b/Code/Channels/Exchange/Resources/icon-10.png differ diff --git a/Code/Channels/Exchange/Resources/icon-13.png b/Code/Channels/Exchange/Resources/icon-13.png new file mode 100644 index 0000000..999d4a0 Binary files /dev/null and b/Code/Channels/Exchange/Resources/icon-13.png differ diff --git a/Code/Channels/Exchange/Resources/icon-64.png b/Code/Channels/Exchange/Resources/icon-64.png new file mode 100644 index 0000000..163f764 Binary files /dev/null and b/Code/Channels/Exchange/Resources/icon-64.png differ diff --git a/Code/Channels/Facebook/ChannelHelper.cs b/Code/Channels/Facebook/ChannelHelper.cs new file mode 100644 index 0000000..5ade03a --- /dev/null +++ b/Code/Channels/Facebook/ChannelHelper.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.ServiceModel; +using System.ServiceModel.Description; +using Inbox2.Channels.Facebook.REST; + +namespace Inbox2.Channels.Facebook +{ + internal static class ChannelHelper + { + internal static IFacebookClient BuildChannel() + { + EndpointAddress address = new EndpointAddress("http://api.facebook.com/restserver.php"); + WebHttpBinding binding = new WebHttpBinding(WebHttpSecurityMode.None); + + binding.ReaderQuotas.MaxDepth = 2147483647; + binding.ReaderQuotas.MaxStringContentLength = 2147483647; + binding.ReaderQuotas.MaxArrayLength = 2147483647; + binding.ReaderQuotas.MaxBytesPerRead = 2147483647; + binding.ReaderQuotas.MaxNameTableCharCount = 2147483647; + binding.MaxReceivedMessageSize = Int32.MaxValue; + + ChannelFactory cf = new ChannelFactory(binding, address); + cf.Endpoint.Behaviors.Add(new WebHttpBehavior()); + + return cf.CreateChannel(); + } + + internal static DateTime ConvertFromUnixTimestamp(double timestamp) + { + DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0); + return origin.AddSeconds(timestamp); + } + } +} diff --git a/Code/Channels/Facebook/FacebookClientChannel.cs b/Code/Channels/Facebook/FacebookClientChannel.cs new file mode 100644 index 0000000..dea092d --- /dev/null +++ b/Code/Channels/Facebook/FacebookClientChannel.cs @@ -0,0 +1,340 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using Inbox2.Channels.Facebook.REST; +using Inbox2.Channels.Facebook.REST.DataContracts; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Channels.Web; + +namespace Inbox2.Channels.Facebook +{ + public class FacebookClientChannel : IClientInputChannel, IClientOutputChannel, IClientContactsChannel, IClientStatusUpdatesChannel + { + #region Fields + + protected const string MessageComposePageMobile = "http://m.facebook.com/inbox/?rfb157ae2=&compose=&ids={0}&refid=0"; + protected FacebookRESTClient client; + + #endregion + + #region Properties + + public string Hostname + { + get { return "http://api.facebook.com/restserver.php"; } + set { } + } + + public int Port + { + get { return 80; } + set { } + } + + public bool IsSecured + { + get { return false; } + set { } + } + + public bool IsEnabled + { + get; set; + } + + public int MaxConcurrentConnections + { + get; set; + } + + public IChannelCredentialsProvider CredentialsProvider + { + get; set; + } + + public string Protocol + { + get { return "Facebook API"; } + } + + public string SourceAdress + { + get { return CredentialsProvider.GetCredentials().Claim; } + } + + public string AuthMessage { get; private set; } + + #endregion + + public FacebookClientChannel() + { + } + + public ConnectResult Connect() + { + BuildRestClient(); + + FbAuth result = client.Authenticate(); + + if (result == FbAuth.Success) + return ConnectResult.Success; + + return ConnectResult.AuthFailure; + } + + public IEnumerable GetFolders() + { + yield return new ChannelFolder("inbox", "inbox", ChannelFolderType.Inbox); + } + + public void SelectFolder(ChannelFolder folder) + { + + } + + public IEnumerable GetHeaders() + { + BuildRestClient(); + + var messages = client.GetMessages(FbMessageFolder.Inbox).ToList(); + + foreach (FbMessage fbMessage in messages) + { + var header = new ChannelMessageHeader(); + + header.MessageIdentifier = fbMessage.MessageId; + header.MessageNumber = fbMessage.MessageId; + header.Context = fbMessage.Subject; + header.From = fbMessage.From; + header.To = fbMessage.To; + header.Body = fbMessage.Body; + header.IsRead = fbMessage.Read; + header.DateReceived = fbMessage.DateCreated; + header.Metadata.i2mpRelationId = fbMessage.ThreadId; + + yield return header; + } + } + + public IEnumerable GetMessage(ChannelMessageHeader header) + { + ChannelMessage message = new ChannelMessage(); + message.MessageNumber = header.MessageNumber; + message.MessageIdentifier = header.MessageIdentifier; + message.From = header.From; + message.Context = header.Context; + message.BodyText = header.Body.ToStream(); + message.IsRead = header.IsRead; + message.DateReceived = header.DateReceived; + message.ConversationId = header.Metadata.i2mpRelationId; + + yield return message; + } + + public IEnumerable GetContacts() + { + BuildRestClient(); + + int count = 1; + var waitTime = new TimeSpan(0, 0, 1); + + foreach (FbContact fbContact in client.GetContacts()) + { + ChannelContact contact = ParseFbContact(fbContact); + + if (count % 10 == 0) + Thread.Sleep(waitTime); + + count++; + yield return contact; + } + } + + IClientContactsChannel IClientContactsChannel.Clone() + { + return new FacebookClientChannel + { + Hostname = Hostname, + Port = Port, + IsSecured = IsSecured, + MaxConcurrentConnections = MaxConcurrentConnections, + CredentialsProvider = CredentialsProvider + }; + } + + public void Send(ChannelMessage message) + { + } + + public ChannelSocialProfile GetProfile() + { + BuildRestClient(); + var user = client.GetLoggedInUser(); + + return new ChannelSocialProfile + { + Id = user.UserId, + FullName = user.Name, + AvatarUrl = user.AvatarSquareUrl + }; + } + + public IEnumerable GetMentions(int pageSize) + { + yield break; + } + + public IEnumerable GetUpdates(int pageSize) + { + BuildRestClient(); + + foreach (var fbStatus in client.GetStatusses(pageSize)) + { + var status = ParseFbStatus(fbStatus); + + status.Children.AddRange(fbStatus.Comments.Select(ParseFbStatus)); + + yield return status; + } + } + + public IEnumerable GetUserUpdates(string username, int pageSize) + { + BuildRestClient(); + + // Always select 50 from fb and return the requested nr because some updates from + // Facebook might be filtered out due to actorid being different from sourceid. + return client.GetStatusses(username, 50).Select(ParseFbStatus).Take(pageSize); + } + + public IEnumerable GetUpdates(string keyword, int pageSize) + { + BuildRestClient(); + + yield break; + } + + public void UpdateMyStatus(ChannelStatusUpdate update) + { + BuildRestClient(); + + if (String.IsNullOrEmpty(update.InReplyTo)) + client.SetStatus(update.Status); + else + client.PostComment(update.Status, update.InReplyTo); + } + + IClientStatusUpdatesChannel IClientStatusUpdatesChannel.Clone() + { + return new FacebookClientChannel + { + Hostname = Hostname, + Port = Port, + IsSecured = IsSecured, + MaxConcurrentConnections = MaxConcurrentConnections, + CredentialsProvider = CredentialsProvider + }; + } + + public bool Disconnect() + { + if (client != null) + { + client.Dispose(); + client = null; + } + + return true; + } + + public IClientInputChannel Clone() + { + FacebookClientChannel channel = new FacebookClientChannel(); + channel.Hostname = Hostname; + channel.Port = Port; + channel.IsSecured = IsSecured; + channel.MaxConcurrentConnections = MaxConcurrentConnections; + channel.CredentialsProvider = CredentialsProvider; + + return channel; + } + + void BuildRestClient() + { + if (client == null) + { + var sessionKey = ChannelContext.Current.ClientContext.GetSetting("/Channels/Facebook/SessionKey").ToString(); + var sessionSecret = ChannelContext.Current.ClientContext.GetSetting("/Channels/Facebook/SessionSecret").ToString(); + + var apiKey = FacebookApiKeys.GetApiKey(); + var apiSecret = FacebookApiKeys.GetApiSecret(); + + if ("/Settings/Channels/Codebase".AsKey("cloud") == "client") + { + client = new FacebookRESTClient(apiKey, sessionSecret, sessionKey, sessionSecret); + } + else + { + client = new FacebookRESTClient(apiKey, apiSecret, sessionKey, sessionSecret); + } + } + } + + public void Dispose() + { + Disconnect(); + } + + ChannelContact ParseFbContact(FbContact fbContact) + { + ChannelContact contact = new ChannelContact(); + + contact.Person.Firstname = fbContact.Firstname; + contact.Person.Lastname = fbContact.Lastname; + + contact.Profile.ChannelProfileKey = fbContact.UserId; + contact.Profile.ProfileType = ProfileType.Social; + contact.Profile.SourceAddress = new SourceAddress(fbContact.UserId, contact.Person.Name); + + if (!String.IsNullOrEmpty(fbContact.AvatarSquareUrl.Trim())) + { + ChannelAvatar avatar = new ChannelAvatar(); + avatar.Url = fbContact.AvatarSquareUrl; + avatar.ContentStream = WebContentStreamHelper.GetContentStream(avatar.Url); + + contact.Profile.ChannelAvatar = avatar; + } + + return contact; + } + + ChannelStatusUpdate ParseFbStatus(FbStatus fbStatus) + { + var status = new ChannelStatusUpdate(); + + status.ChannelStatusKey = fbStatus.StatusId; + status.From = fbStatus.From; + status.To = fbStatus.To; + status.Status = fbStatus.Message; + status.DatePosted = fbStatus.DateCreated; + + foreach (var fbAttachment in fbStatus.Attachments) + { + var attachment = new ChannelStatusUpdateAttachment(); + + attachment.MediaType = (short)fbAttachment.MediaType; + attachment.PreviewAltText = fbAttachment.PreviewAltText; + attachment.PreviewImageUrl = fbAttachment.PreviewImageUrl; + attachment.TargetUrl = fbAttachment.TargetUrl; + + status.Attachments.Add(attachment); + } + + return status; + } + } +} diff --git a/Code/Channels/Facebook/FacebookConfiguration.cs b/Code/Channels/Facebook/FacebookConfiguration.cs new file mode 100644 index 0000000..4776256 --- /dev/null +++ b/Code/Channels/Facebook/FacebookConfiguration.cs @@ -0,0 +1,70 @@ +using System; +using System.ComponentModel.Composition; +using System.Xml.Serialization; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Interfaces.Enumerations; + +namespace Inbox2.Channels.Facebook +{ + [Serializable] + [Export(typeof(ChannelConfiguration))] + public class FacebookConfiguration : ChannelConfiguration + { + public FacebookConfiguration() + { + InnerInputChannel = new Channel { Type = typeof(FacebookClientChannel), Port = 80, IsSecured = false, MaxConcurrentConnections = 2 }; + InnerOutputChannel = new Channel { Type = typeof(FacebookClientChannel), Port = 80, IsSecured = false, MaxConcurrentConnections = 1 }; + InnerContactsChannel = new Channel { Type = typeof(FacebookClientChannel), Port = 80, IsSecured = false, MaxConcurrentConnections = 1 }; + InnerStatusUpdatesChannel = new Channel { Type = typeof(FacebookClientChannel), Port = 80, IsSecured = false, MaxConcurrentConnections = 1 }; + } + + public override string DisplayName + { + get { return "Facebook"; } + } + + public override DisplayStyle DisplayStyle + { + get { return DisplayStyle.FbConnect; } + } + + public override ChannelCharasteristics Charasteristics + { + get + { + var charasteristics = base.Charasteristics; + + charasteristics.SupportsEmail = false; + charasteristics.SupportsHtml = false; + charasteristics.SupportsPrivateMessage = false; + charasteristics.SupportsPublicMessage = true; + charasteristics.CanSendFiles = false; + charasteristics.CanReply = false; + charasteristics.SupportsReadStates = false; + charasteristics.SupportsStatusUpdates = true; + charasteristics.SupportsProfiles = true; + charasteristics.SupportsStatusUpdatesReply = true; + + return charasteristics; + } + } + + public override IWebRedirectBuilder RedirectBuilder + { + get { return new FacebookRedirectBuilder(); } + } + + public override ChannelProfileInfoBuilder ProfileInfoBuilder + { + get { return new FacebookProfileInfoBuilder(); } + } + + public override ChannelConfiguration Clone() + { + return this.DeepCopy(new XmlSerializer(typeof(FacebookConfiguration))); + } + } +} diff --git a/Code/Channels/Facebook/FacebookProfileInfoBuilder.cs b/Code/Channels/Facebook/FacebookProfileInfoBuilder.cs new file mode 100644 index 0000000..3d1b409 --- /dev/null +++ b/Code/Channels/Facebook/FacebookProfileInfoBuilder.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Entities; + +namespace Inbox2.Channels.Facebook +{ + public class FacebookProfileInfoBuilder : ChannelProfileInfoBuilder + { + public override string StreamUrl + { + get { return "http://www.facebook.com/home.php"; } + } + + public override string InboxUrl + { + get { return "http://www.facebook.com/?sk=messages"; } + } + + public override string BuildServiceProfileUrl(SourceAddress address) + { + return String.Format("http://www.facebook.com/profile.php?id={0}", address.Address); + } + + public override string BuildServiceProfileUrl(ChannelProfile profile) + { + return String.Format("http://www.facebook.com/profile.php?id={0}", profile.SourceAddress.Address); + } + } +} diff --git a/Code/Channels/Facebook/FacebookRedirectBuilder.cs b/Code/Channels/Facebook/FacebookRedirectBuilder.cs new file mode 100644 index 0000000..20d1e89 --- /dev/null +++ b/Code/Channels/Facebook/FacebookRedirectBuilder.cs @@ -0,0 +1,87 @@ +using System; +using System.Web; +using Inbox2.Channels.Facebook.REST; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Channels.Text; +using Inbox2.Platform.Framework; +using Inbox2.Platform.Framework.Extensions; +using Newtonsoft.Json.Linq; + +namespace Inbox2.Channels.Facebook +{ + /// + /// Redirect builder is only used for configuring the Facebook channel in the desktop client. + /// + public class FacebookRedirectBuilder : IWebRedirectBuilder + { + public string Token { get; set; } + + public string TokenSecret { get; set; } + + public bool IsCloudRedirect { get; set; } + + public string SuccessUri + { + get { return "?session="; } + } + + public FacebookRedirectBuilder() + { + Token = SafeSession.Current["/Channels/Facebook/Redirect/Token"] as string; + TokenSecret = SafeSession.Current["/Channels/Facebook/Redirect/TokenSecret"] as string; + } + + public Uri BuildRedirectUri() + { + // The API then piggy backs off the same login mechanism as used by the desktop + // client but uses the cloud specific API keys. FB expects the domain name to be something like + // www..inbox2.com in that case. + string environment = "/Settings/Application/Environment".AsKey(String.Empty); + var cloudRedirectUrl = String.IsNullOrEmpty(environment) + ? "http://www.inbox2.com/" + : String.Concat("http://www.", environment, ".inbox2.com"); + + return new Uri(String.Format("http://www.facebook.com/login.php?api_key={0}&connect_display=popup&v=1.0&next={1}&fbconnect=true&return_session=true&skipcookie=true&req_perms=read_stream,read_mailbox,publish_stream,offline_access", + FacebookApiKeys.GetApiKey(), IsCloudRedirect ? cloudRedirectUrl : "http://desktop.inbox2.com/success")); + } + + public string ParseVerifier(string returnValue) + { + return returnValue; + } + + public bool ValidateReturnValue(string returnValue) + { + var queryParams = NameValueParser.GetCollection(new Uri(returnValue).Query, "?", "&"); + + if (queryParams["session"] == null) + return false; + + JObject result = JObject.Parse(HttpUtility.UrlDecode(queryParams["session"])); + + if (result["session_key"] == null || result["secret"] == null) + return false; + + Token = result["session_key"].Value(); + TokenSecret = result["secret"].Value(); + + if (ChannelContext.Current != null && ChannelContext.Current.ClientContext != null) + { + // 7. Save auth keys + ChannelContext.Current.ClientContext.SaveSetting("/Channels/Facebook/SessionKey", Token); + ChannelContext.Current.ClientContext.SaveSetting("/Channels/Facebook/SessionSecret", TokenSecret); + } + + return true; + } + + public string GetUsername() + { + FacebookRESTClient client = new FacebookRESTClient(FacebookApiKeys.GetApiKey(), TokenSecret, Token, TokenSecret); + var user = client.GetLoggedInUser(); + + return user.Name; + } + } +} diff --git a/Code/Channels/Facebook/Inbox2.Channels.Facebook.csproj b/Code/Channels/Facebook/Inbox2.Channels.Facebook.csproj new file mode 100644 index 0000000..e3e4cfb --- /dev/null +++ b/Code/Channels/Facebook/Inbox2.Channels.Facebook.csproj @@ -0,0 +1,209 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {8B39A324-31DB-4317-B81E-8C5CA18260AB} + Library + Properties + Inbox2.Channels.Facebook + Inbox2.Channels.Facebook + v3.5 + 512 + OnOutputUpdated + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\..\Stable Assemblies\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + + ..\..\..\ThirdParty\Json.Net\Newtonsoft.Json.dll + + + + False + ..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + 3.5 + + + 3.0 + + + 3.0 + + + 3.5 + + + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + {43B96CD2-D7DA-4286-A209-EE9585EF6927} + Inbox2.Platform.Channels + + + {FB90E43A-0E32-41D5-A7AB-83EA0D936E5E} + Inbox2.Platform.Framework + + + {B9CE1540-1D68-43B2-83DB-47EC21D158A6} + Inbox2.Platform.Interfaces + + + {6AE2A2AF-9B61-45B0-A375-666C5225A5B4} + Inbox2.Platform.Logging + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Code/Channels/Facebook/Properties/AssemblyInfo.cs b/Code/Channels/Facebook/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e9eadf3 --- /dev/null +++ b/Code/Channels/Facebook/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2.Channels.Facebook")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2.Channels.Facebook")] +[assembly: AssemblyCopyright("Copyright © Tabdeelee 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b2ec2aa8-20f7-4ad5-b1dd-f046c3d5fdb3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Code/Channels/Facebook/REST/DataContracts/FbAttachment.cs b/Code/Channels/Facebook/REST/DataContracts/FbAttachment.cs new file mode 100644 index 0000000..e6c5eea --- /dev/null +++ b/Code/Channels/Facebook/REST/DataContracts/FbAttachment.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Channels.Facebook.REST.DataContracts +{ + public class FbAttachment + { + public string PreviewImageUrl { get; set; } + + public string PreviewAltText { get; set; } + + public string TargetUrl { get; set; } + + public FbMediaType MediaType { get; set; } + } +} diff --git a/Code/Channels/Facebook/REST/DataContracts/FbAuth.cs b/Code/Channels/Facebook/REST/DataContracts/FbAuth.cs new file mode 100644 index 0000000..d86994f --- /dev/null +++ b/Code/Channels/Facebook/REST/DataContracts/FbAuth.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Channels.Facebook.REST.DataContracts +{ + public enum FbAuth + { + NoAuthKey, + Error, + Success + } +} diff --git a/Code/Channels/Facebook/REST/DataContracts/FbContact.cs b/Code/Channels/Facebook/REST/DataContracts/FbContact.cs new file mode 100644 index 0000000..43948d6 --- /dev/null +++ b/Code/Channels/Facebook/REST/DataContracts/FbContact.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Channels.Facebook.REST.DataContracts +{ + public class FbContact + { + public string UserId { get; set; } + public string Name { get; set; } + public string Firstname { get; set; } + public string Lastname { get; set; } + public string AvatarSquareUrl { get; set; } + } +} diff --git a/Code/Channels/Facebook/REST/DataContracts/FbMediaType.cs b/Code/Channels/Facebook/REST/DataContracts/FbMediaType.cs new file mode 100644 index 0000000..4c08eb0 --- /dev/null +++ b/Code/Channels/Facebook/REST/DataContracts/FbMediaType.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Channels.Facebook.REST.DataContracts +{ + public enum FbMediaType : short + { + Link = 10, + Photo = 20, + Video = 40, + } +} diff --git a/Code/Channels/Facebook/REST/DataContracts/FbMessage.cs b/Code/Channels/Facebook/REST/DataContracts/FbMessage.cs new file mode 100644 index 0000000..8497adf --- /dev/null +++ b/Code/Channels/Facebook/REST/DataContracts/FbMessage.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Channels.Entities; + +namespace Inbox2.Channels.Facebook.REST.DataContracts +{ + public class FbMessage + { + public string MessageId { get; set; } + public string ThreadId { get; set; } + public string Subject { get; set; } + public string Body { get; set; } + + public bool Read { get; set; } + + public DateTime DateCreated { get; set; } + + public SourceAddress From { get; set; } + public SourceAddressCollection To { get; set; } + } +} \ No newline at end of file diff --git a/Code/Channels/Facebook/REST/DataContracts/FbMessageFolder.cs b/Code/Channels/Facebook/REST/DataContracts/FbMessageFolder.cs new file mode 100644 index 0000000..b0da200 --- /dev/null +++ b/Code/Channels/Facebook/REST/DataContracts/FbMessageFolder.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Channels.Facebook.REST.DataContracts +{ + public enum FbMessageFolder + { + Inbox = 0, + Outbox = 1, + Updates = 4 + } +} diff --git a/Code/Channels/Facebook/REST/DataContracts/FbNotifications.cs b/Code/Channels/Facebook/REST/DataContracts/FbNotifications.cs new file mode 100644 index 0000000..6abfdb5 --- /dev/null +++ b/Code/Channels/Facebook/REST/DataContracts/FbNotifications.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Channels.Facebook.REST.DataContracts +{ + public class FbNotifications + { + public string MostRecentMessage { get; set; } + + public List FriendRequests { get; set; } + + public FbNotifications() + { + FriendRequests = new List(); + } + } +} diff --git a/Code/Channels/Facebook/REST/DataContracts/FbPermissions.cs b/Code/Channels/Facebook/REST/DataContracts/FbPermissions.cs new file mode 100644 index 0000000..b43d8a6 --- /dev/null +++ b/Code/Channels/Facebook/REST/DataContracts/FbPermissions.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Channels.Facebook.REST.DataContracts +{ + public enum FbPermission + { + read_mailbox, + read_stream, + publish_stream, + } +} diff --git a/Code/Channels/Facebook/REST/DataContracts/FbStatus.cs b/Code/Channels/Facebook/REST/DataContracts/FbStatus.cs new file mode 100644 index 0000000..d9920bf --- /dev/null +++ b/Code/Channels/Facebook/REST/DataContracts/FbStatus.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Channels.Entities; + +namespace Inbox2.Channels.Facebook.REST.DataContracts +{ + public class FbStatus + { + public long Uid { get; set; } + public string StatusId { get; set; } + public string Message { get; set; } + public SourceAddress From { get; set; } + public SourceAddress To { get; set; } + public DateTime DateCreated { get; set; } + + public List Comments { get; private set; } + public List Attachments { get; private set; } + + public FbStatus() + { + Comments = new List(); + Attachments = new List(); + } + } + + public class FbStatusComparer : IEqualityComparer + { + public bool Equals(FbStatus x, FbStatus y) + { + return x.StatusId.Equals(y.StatusId); + } + + public int GetHashCode(FbStatus obj) + { + return obj.StatusId.GetHashCode(); + } + } +} diff --git a/Code/Channels/Facebook/REST/FacebookApiKeys.cs b/Code/Channels/Facebook/REST/FacebookApiKeys.cs new file mode 100644 index 0000000..ac50436 --- /dev/null +++ b/Code/Channels/Facebook/REST/FacebookApiKeys.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Framework.Extensions; + +namespace Inbox2.Channels.Facebook.REST +{ + public static class FacebookApiKeys + { + public static string GetApiKey() + { + return "4d339f4fbe43e5ba1cfe7c491c1b1622"; + } + + public static string GetApiSecret() + { + return String.Empty; + } + } +} diff --git a/Code/Channels/Facebook/REST/FacebookRESTClient.cs b/Code/Channels/Facebook/REST/FacebookRESTClient.cs new file mode 100644 index 0000000..83a4a7f --- /dev/null +++ b/Code/Channels/Facebook/REST/FacebookRESTClient.cs @@ -0,0 +1,611 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Net; +using System.Security.Cryptography; +using System.Text; +using System.Web; +using System.Xml.Linq; +using Inbox2.Channels.Facebook.REST.DataContracts; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Extensions; +using Inbox2.Platform.Channels.Text; +using Inbox2.Platform.Logging; + +namespace Inbox2.Channels.Facebook.REST +{ + public class FacebookRESTClient : IDisposable + { + protected IFacebookClient channel; + protected readonly string apiKey; + protected readonly string apiSecret; + + protected string sessionKey; + protected string sessionSecret; + protected string uid; + + public FacebookRESTClient(string apiKey, string apiSecret) + : this(apiKey, apiSecret, null, null) + { + } + + public FacebookRESTClient(string apiKey, string apiSecret, string sessionKey, string sessionSecret) + { + // Note: use ApiSecret as the sessionSecret with web apps, desktop apps would use the SessionSecret + + channel = ChannelHelper.BuildChannel(); + + this.apiKey = apiKey; + this.apiSecret = apiSecret; + this.sessionKey = sessionKey; + this.sessionSecret = sessionSecret; + } + + public FbAuth Authenticate() + { + // Allready logged in + if (!String.IsNullOrEmpty(sessionKey)) + return FbAuth.Success; + + string authToken = ChannelContext.Current.ClientContext.GetSetting("/Channels/Facebook/AuthToken").ToString(); + + if (String.IsNullOrEmpty(authToken)) + return FbAuth.NoAuthKey; + + Dictionary requestParams = new Dictionary(); + requestParams.Add("method", "auth.getSession"); + requestParams.Add("api_key", apiKey); + requestParams.Add("v", "1.0"); + requestParams.Add("auth_token", authToken); + + var result = channel.GetSession(apiKey, GenerateSignature(requestParams, apiSecret), authToken); + + foreach (XElement resultElement in result.Elements()) + { + if (resultElement.Name.LocalName.Equals("error_code")) + return FbAuth.Error; + + if (resultElement.Name.LocalName.Equals("session_key")) + sessionKey = resultElement.Value; + else if (resultElement.Name.LocalName.Equals("uid")) + uid = resultElement.Value; + else if (resultElement.Name.LocalName.Equals("secret")) + sessionSecret = resultElement.Value; + } + + ChannelContext.Current.ClientContext.SaveSetting("/Channels/Facebook/SessionKey", sessionKey); + ChannelContext.Current.ClientContext.SaveSetting("/Channels/Facebook/SessionSecret", sessionSecret); + ChannelContext.Current.ClientContext.DeleteSetting("/Channels/Facebook/AuthToken"); + + return FbAuth.Success; + } + + public FbContact GetLoggedInUser() + { + Authenticate(); + + string call_id = GetNextCallNr(); + + Dictionary requestParams = new Dictionary(); + requestParams.Add("method", "users.getloggedinuser"); + requestParams.Add("api_key", apiKey); + requestParams.Add("session_key", sessionKey); + requestParams.Add("call_id", call_id); + requestParams.Add("v", "1.0"); + + var result = channel.GetLoggedInUser(apiKey, sessionKey, call_id, GenerateSignature(requestParams, sessionSecret)); + var userId = result.Value; + + return GetUsersInfo(userId).First(); + } + + public IEnumerable GetContacts() + { + Authenticate(); + + string call_id = GetNextCallNr(); + + Dictionary requestParams = new Dictionary(); + requestParams.Add("method", "friends.get"); + requestParams.Add("api_key", apiKey); + requestParams.Add("session_key", sessionKey); + requestParams.Add("call_id", call_id); + requestParams.Add("v", "1.0"); + + var result = channel.GetContacts(apiKey, sessionKey, call_id, GenerateSignature(requestParams, sessionSecret)); + + XNamespace ns = result.GetDefaultNamespace(); + + List friendsList = result.Elements().Select(e => e.Value).ToList(); + + for (int i = 0; i < friendsList.Count; i += 10) + { + // Creates lists like id1,id2,id3, etc + var ids = String.Join(",", friendsList.Skip(i).Take(10).ToArray()); + + // Now get the desired data for user's contact to define the attributes of ChannelContact object + foreach (var info in GetUsersInfo(ids)) + { + yield return info; + } + } + } + + public IEnumerable GetUsersInfo(string ids) + { + Authenticate(); + + string call_id = GetNextCallNr(); + + Dictionary requestParamsUserInfo = new Dictionary(); + requestParamsUserInfo.Add("method", "users.getinfo"); + requestParamsUserInfo.Add("api_key", apiKey); + requestParamsUserInfo.Add("session_key", sessionKey); + requestParamsUserInfo.Add("call_id", call_id); + requestParamsUserInfo.Add("v", "1.0"); + requestParamsUserInfo.Add("uids", ids); + requestParamsUserInfo.Add("fields", "name,last_name,first_name,pic_square"); + + XElement result = channel.GetUserInfo(apiKey, sessionKey, call_id, GenerateSignature(requestParamsUserInfo, sessionSecret), ids, "name,last_name,first_name,pic_square"); + XNamespace ns = result.GetDefaultNamespace(); + + if (!IsError(result)) + { + foreach (XElement resultElement in result.Elements()) + { + FbContact contact = new FbContact(); + + try + { + contact.UserId = resultElement.Element(ns + "uid").Value; + contact.Name = resultElement.Element(ns + "name").Value; + contact.Lastname = resultElement.Element(ns + "last_name").Value; + contact.Firstname = resultElement.Element(ns + "first_name").Value; + contact.AvatarSquareUrl = resultElement.Element(ns + "pic_square").Value; + + } + catch (NullReferenceException e) + { + Logger.Error("Unable to retreive contact details for contact. Uid = {0}", LogSource.Channel, resultElement.Value); + + continue; + } + + yield return contact; + } + } + } + + public IEnumerable GetMessages(FbMessageFolder folder) + { + Authenticate(); + + string call_id = GetNextCallNr(); + var query = new StringBuilder(); + query.Append("{"); + query.Append("\"threads\":\"SELECT thread_id, subject, recipients, updated_time, parent_message_id, parent_thread_id, unread FROM thread WHERE folder_id = 0\","); + query.Append("\"messages\":\"SELECT thread_id, body, author_id, created_time, attachment FROM message WHERE thread_id IN (SELECT thread_id FROM #threads)\","); + query.Append("\"users\":\"SELECT uid, name FROM user WHERE uid IN (SELECT author_id FROM #messages)\""); + query.Append("}"); + + Dictionary requestParams = new Dictionary(); + requestParams.Add("method", "fql.multiquery"); + requestParams.Add("api_key", apiKey); + requestParams.Add("session_key", sessionKey); + requestParams.Add("call_id", call_id); + requestParams.Add("v", "1.0"); + requestParams.Add("queries", query.ToString()); + + var result = channel.ExecuteMultiQueries(apiKey, sessionKey, call_id, GenerateSignature(requestParams, sessionSecret), query.ToString()); + XNamespace ns = result.GetDefaultNamespace(); + + // Fire one call to retreive names for all recipients in messages + var uids = result.Descendants(ns + "recipients").Elements(ns + "uid").Select(n => n.Value).ToArray(); + var addresses = GetAddresses(String.Join(", ", uids)).ToList(); + + foreach (XElement messageElement in result.Descendants(ns + "message")) + { + FbMessage message = new FbMessage(); + + try + { + var threadid = messageElement.Element(ns + "thread_id").Value; + var from = messageElement.Element(ns + "author_id").Value; + + //if (String.IsNullOrEmpty(from)) + // System.Diagnostics.Debugger.Break(); + + // Find the associated thread which contains the subject and readstate + var threadElement = result.Descendants(ns + "thread").FirstOrDefault(t => t.Element(ns + "thread_id").Value == threadid); + var senderElement = result.Descendants(ns + "user").FirstOrDefault(u => u.Element(ns + "uid").Value == from); + + if (threadElement == null || senderElement == null) + { + Logger.Error("Unable to determine sender for Facebook message, ignoring", LogSource.Channel); + + continue; + } + + message.ThreadId = threadid; + message.Subject = threadElement.Element(ns + "subject").Value; + message.Body = messageElement.Element(ns + "body").Value; + message.From = new SourceAddress(senderElement.Element(ns + "uid").Value, senderElement.Element(ns + "name").Value); + message.To = new SourceAddressCollection(); + message.Read = threadElement.Element(ns + "unread").Value == "0"; + message.DateCreated = Int64.Parse(threadElement.Element(ns + "updated_time").Value).ToUnixTime(); + + foreach (XElement recipientElement in threadElement.Element(ns + "recipients").Elements()) + message.To.Add(addresses.FirstOrDefault(a => a.Address == recipientElement.Value)); + + message.MessageId = message.ThreadId + message.From.Address; + } + catch (Exception ex) + { + Logger.Error("Unable to retreive mesaage. Result = {0}. Exception = {1}", LogSource.Channel, messageElement.Value, ex); + + continue; + } + + yield return message; + } + } + + public IEnumerable GetAddresses(string uids) + { + Authenticate(); + + string call_id = GetNextCallNr(); + string query = String.Format("SELECT uid, name FROM user WHERE uid IN ({0})", uids); + + Dictionary requestParams = new Dictionary(); + requestParams.Add("method", "fql.query"); + requestParams.Add("api_key", apiKey); + requestParams.Add("session_key", sessionKey); + requestParams.Add("call_id", call_id); + requestParams.Add("v", "1.0"); + requestParams.Add("query", query); + + var result = channel.ExecuteQuery(apiKey, sessionKey, call_id, GenerateSignature(requestParams, sessionSecret), query); + + XNamespace ns = result.GetDefaultNamespace(); + + foreach (XElement element in result.Descendants(ns + "user")) + { + SourceAddress address; + + try + { + address = new SourceAddress(element.Element(ns + "uid").Value, element.Element(ns + "name").Value); + } + catch (Exception ex) + { + Logger.Error("Unable to retreive user source address. Result = {0}. Exception = {1}", LogSource.Channel, element.Value, ex); + + continue; + } + + yield return address; + } + } + + public IEnumerable GetStatusses(int pageSize) + { + Authenticate(); + + string call_id = GetNextCallNr(); + string limit = pageSize.ToString(); + + Dictionary requestParams = new Dictionary(); + requestParams.Add("method", "stream.get"); + requestParams.Add("api_key", apiKey); + requestParams.Add("session_key", sessionKey); + requestParams.Add("call_id", call_id); + requestParams.Add("source_ids", ""); + requestParams.Add("v", "1.0"); + requestParams.Add("limit", limit); + + var result = channel.GetStream(apiKey, sessionKey, call_id, GenerateSignature(requestParams, sessionSecret), "", limit); + + XNamespace ns = result.GetDefaultNamespace(); + + foreach (XElement element in result.Descendants(ns + "stream_post")) + { + var status = new FbStatus(); + + try + { + var id = element.Element(ns + "actor_id").Value; + var userElement = result.Descendants(ns + "profile").First(p => p.Element(ns + "id").Value == id); + + status.From = new SourceAddress(id, userElement.Element(ns + "name").Value, + userElement.Element(ns + "pic_square").Value); + + if (element.Element(ns + "target_id") != null && !String.IsNullOrEmpty(element.Element(ns + "target_id").Value)) + { + var toid = element.Element(ns + "target_id").Value; + + if (!String.IsNullOrEmpty(toid)) + { + var toUserElement = result.Descendants(ns + "profile").First(p => p.Element(ns + "id").Value == toid); + + status.To = new SourceAddress(toid, toUserElement.Element(ns + "name").Value, + toUserElement.Element(ns + "pic_square").Value); + } + } + + status.Uid = Int64.Parse(element.Element(ns + "actor_id").Value); + status.StatusId = element.Element(ns + "post_id").Value; + status.Message = element.Element(ns + "message").Value; + status.DateCreated = Int64.Parse(element.Element(ns + "created_time").Value).ToUnixTime(); + + foreach (var commentElement in element.Descendants(ns + "comment")) + { + var comment = new FbStatus(); + var commentid = commentElement.Element(ns + "fromid").Value; + var commentUserElement = result.Descendants(ns + "profile").First(p => p.Element(ns + "id").Value == commentid); + + comment.From = new SourceAddress(commentid, commentUserElement.Element(ns + "name").Value, + commentUserElement.Element(ns + "pic_square").Value); + + comment.Uid = Int64.Parse(commentElement.Element(ns + "fromid").Value); + comment.StatusId = commentElement.Element(ns + "id").Value; + comment.Message = commentElement.Element(ns + "text").Value; + comment.DateCreated = Int64.Parse(commentElement.Element(ns + "time").Value).ToUnixTime(); + + status.Comments.Add(comment); + } + + foreach (var attachmentElement in element.Descendants(ns + "stream_media")) + { + var attachment = new FbAttachment(); + attachment.MediaType = (FbMediaType)Enum.Parse(typeof(FbMediaType), attachmentElement.Element(ns + "type").Value, true); + + switch (attachment.MediaType) + { + case FbMediaType.Link: + { + attachment.TargetUrl = HttpUtility.HtmlDecode(attachmentElement.Element(ns + "href").Value); + attachment.PreviewAltText = HttpUtility.HtmlDecode(attachmentElement.Element(ns + "alt").Value); + attachment.PreviewImageUrl = HttpUtility.HtmlDecode(attachmentElement.Element(ns + "src").Value); + + break; + } + case FbMediaType.Photo: + { + attachment.TargetUrl = HttpUtility.HtmlDecode(attachmentElement.Element(ns + "href").Value); + attachment.PreviewAltText = HttpUtility.HtmlDecode(attachmentElement.Element(ns + "alt").Value); + attachment.PreviewImageUrl = HttpUtility.HtmlDecode(attachmentElement.Element(ns + "src").Value); + + break; + } + case FbMediaType.Video: + { + var src = new Uri(attachmentElement.Element(ns + "src").Value); + var uriParams = NameValueParser.GetCollection(src.Query, "&"); + + attachment.TargetUrl = HttpUtility.HtmlDecode(attachmentElement.Element(ns + "video").Element(ns + "display_url").Value); + attachment.PreviewAltText = HttpUtility.HtmlDecode(attachmentElement.Element(ns + "alt").Value); + attachment.PreviewImageUrl = HttpUtility.UrlDecode(uriParams["url"]); + + break; + } + } + + status.Attachments.Add(attachment); + } + } + catch (Exception ex) + { + Logger.Error("Unable to retreive user source address. Result = {0}. Exception = {1}", LogSource.Channel, element.Value, ex); + + continue; + } + + yield return status; + } + } + + public IEnumerable GetStatusses(string userid, int pageSize) + { + Authenticate(); + + string call_id = GetNextCallNr(); + string limit = pageSize.ToString(); + + Dictionary requestParams = new Dictionary(); + requestParams.Add("method", "stream.get"); + requestParams.Add("api_key", apiKey); + requestParams.Add("session_key", sessionKey); + requestParams.Add("call_id", call_id); + requestParams.Add("source_ids", userid); + requestParams.Add("v", "1.0"); + requestParams.Add("limit", limit); + + var result = channel.GetStream(apiKey, sessionKey, call_id, GenerateSignature(requestParams, sessionSecret), userid, limit); + + XNamespace ns = result.GetDefaultNamespace(); + + foreach (XElement element in result.Descendants(ns + "stream_post")) + { + var status = new FbStatus(); + string id; + + try + { + id = element.Element(ns + "actor_id").Value; + + var userElement = result.Descendants(ns + "profile").First(p => p.Element(ns + "id").Value == id); + + status.From = new SourceAddress(id, userElement.Element(ns + "name").Value, + userElement.Element(ns + "pic_square").Value); + + if (element.Element(ns + "target_id") != null && !String.IsNullOrEmpty(element.Element(ns + "target_id").Value)) + { + var toid = element.Element(ns + "target_id").Value; + + if (!String.IsNullOrEmpty(toid)) + { + var toUserElement = result.Descendants(ns + "profile").First(p => p.Element(ns + "id").Value == toid); + + status.To = new SourceAddress(toid, toUserElement.Element(ns + "name").Value, + toUserElement.Element(ns + "pic_square").Value); + } + } + + status.Uid = Int64.Parse(element.Element(ns + "actor_id").Value); + status.StatusId = element.Element(ns + "post_id").Value; + status.Message = element.Element(ns + "message").Value; + status.DateCreated = Int64.Parse(element.Element(ns + "created_time").Value).ToUnixTime(); + } + catch (Exception ex) + { + Logger.Error("Unable to retreive user source address. Result = {0}. Exception = {1}", LogSource.Channel, element.Value, ex); + + continue; + } + + // If id and actorid are not equal then this is a message directed at user we are + // looking at by someone else, in that case skip it as we are only interested in updates + // by this specific user. + if (userid == id) + yield return status; + } + } + + public void SendNotification(string to, string notification) + { + Authenticate(); + + string call_id = GetNextCallNr(); + + // Now get the desired data for user's contact to define the attributes of ChannelContact object + Dictionary requestParams = new Dictionary(); + requestParams.Add("method", "notifications.send"); + requestParams.Add("api_key", apiKey); + requestParams.Add("session_key", sessionKey); + requestParams.Add("call_id", call_id); + requestParams.Add("v", "1.0"); + requestParams.Add("to_ids", to); + requestParams.Add("notification", notification); + + //var result = channel.SendNotification(apiKey, sessionKey, call_id, GenerateSignature(requestParams, sessionSecret), to, notification); + + var queryString = + String.Format( + "?method=notifications.send&api_key={0}&session_key={1}&call_id={2}&sig={3}&v=1.0&to_ids={4}¬ification={5}", + apiKey, sessionKey, call_id, GenerateSignature(requestParams, sessionSecret), to, notification); + + WebClient wc = new WebClient(); + wc.DownloadString("http://api.facebook.com/restserver.php" + queryString); + } + + public void SetStatus(string status) + { + Authenticate(); + + string call_id = GetNextCallNr(); + + Dictionary requestParams = new Dictionary(); + requestParams.Add("method", "status.set"); + requestParams.Add("api_key", apiKey); + requestParams.Add("session_key", sessionKey); + requestParams.Add("call_id", call_id); + requestParams.Add("v", "1.0"); + requestParams.Add("status", status); + + var result = channel.SetStatus(apiKey, sessionKey, call_id, GenerateSignature(requestParams, sessionSecret), status); + + if (IsError(result)) + { + Logger.Error("Unable to update status. Error = {0}", LogSource.Channel, result); + } + } + + public void PostComment(string comment, string inReplyTo) + { + Authenticate(); + + string call_id = GetNextCallNr(); + + Dictionary requestParams = new Dictionary(); + requestParams.Add("method", "stream.addcomment"); + requestParams.Add("api_key", apiKey); + requestParams.Add("session_key", sessionKey); + requestParams.Add("call_id", call_id); + requestParams.Add("v", "1.0"); + requestParams.Add("post_id", inReplyTo); + requestParams.Add("comment", comment); + + var result = channel.AddComment(apiKey, sessionKey, call_id, GenerateSignature(requestParams, sessionSecret), inReplyTo, comment); + + if (IsError(result)) + { + Logger.Error("Unable to update status. Error = {0}", LogSource.Channel, result); + } + } + + public void Dispose() + { + ((IDisposable)channel).Dispose(); + + channel = null; + } + + #region Helper methods + + bool IsError(XElement resultElement) + { + var ns = resultElement.GetDefaultNamespace(); + + return (resultElement.Element(ns + "error_code") != null); + } + + string GenerateSignature(IDictionary args, string currentSecret) + { + SortedDictionary sortedD = new SortedDictionary(args); + List argsAsKvpStrings = ConvertParameterDictionaryToList(sortedD); + + StringBuilder signatureBuilder = new StringBuilder(); + // Append all the parameters to the signature input paramaters + foreach (string s in argsAsKvpStrings) + signatureBuilder.Append(s); + + // Append the secret to the signature builder + signatureBuilder.Append(currentSecret); + byte[] hash; + + MD5 md5 = MD5.Create(); + // Compute the MD5 hash of the signature builder + hash = md5.ComputeHash(Encoding.UTF8.GetBytes(signatureBuilder.ToString())); + + // Reinitialize the signature builder to store the actual signature + signatureBuilder = new StringBuilder(); + + // Append the hash to the signature + for (int i = 0; i < hash.Length; i++) + signatureBuilder.Append(hash[i].ToString("x2", CultureInfo.InvariantCulture)); + + return signatureBuilder.ToString(); + } + + List ConvertParameterDictionaryToList(IDictionary parameterDictionary) + { + List parameters = new List(); + + foreach (KeyValuePair kvp in parameterDictionary) + { + parameters.Add(String.Format(CultureInfo.InvariantCulture, "{0}={1}", kvp.Key, kvp.Value)); + } + return parameters; + } + + string GetNextCallNr() + { + return DateTime.Now.Ticks.ToString(); + } + + #endregion + } +} \ No newline at end of file diff --git a/Code/Channels/Facebook/REST/IFacebookClient.cs b/Code/Channels/Facebook/REST/IFacebookClient.cs new file mode 100644 index 0000000..69279c3 --- /dev/null +++ b/Code/Channels/Facebook/REST/IFacebookClient.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.ServiceModel; +using System.ServiceModel.Web; +using System.Xml.Linq; + +namespace Inbox2.Channels.Facebook.REST +{ + [ServiceContract] + [XmlSerializerFormat] + public interface IFacebookClient + { + [OperationContract] + [WebGet( + BodyStyle = WebMessageBodyStyle.Bare, + RequestFormat = WebMessageFormat.Xml, + ResponseFormat = WebMessageFormat.Xml, + UriTemplate = "?method=auth.createToken&api_key={api_key}&sig={signature}&v=1.0")] + XElement CreateToken(string api_key, string signature); + + [OperationContract] + [WebGet( + BodyStyle = WebMessageBodyStyle.Bare, + RequestFormat = WebMessageFormat.Xml, + ResponseFormat = WebMessageFormat.Xml, + UriTemplate = "?method=auth.getSession&api_key={api_key}&sig={signature}&v=1.0&auth_token={auth_token}")] + XElement GetSession(string api_key, string signature, string auth_token); + + [OperationContract] + [WebGet( + BodyStyle = WebMessageBodyStyle.Bare, + RequestFormat = WebMessageFormat.Xml, + ResponseFormat = WebMessageFormat.Xml, + UriTemplate = "?method=users.getloggedinuser&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0")] + XElement GetLoggedInUser(string api_key, string session_key, string call_id, string signature); + + [OperationContract] + [WebGet( + BodyStyle = WebMessageBodyStyle.Bare, + RequestFormat = WebMessageFormat.Xml, + ResponseFormat = WebMessageFormat.Xml, + UriTemplate = "?method=friends.get&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0")] + XElement GetContacts(string api_key, string session_key, string call_id, string signature); + + [OperationContract] + [WebGet( + BodyStyle = WebMessageBodyStyle.Bare, + RequestFormat = WebMessageFormat.Xml, + ResponseFormat = WebMessageFormat.Xml, + UriTemplate = "?method=users.getinfo&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0&uids={uids}&fields={fields}")] + XElement GetUserInfo(string api_key, string session_key, string call_id, string signature, string uids, string fields); + + [OperationContract] + [WebGet( + BodyStyle = WebMessageBodyStyle.Bare, + RequestFormat = WebMessageFormat.Xml, + ResponseFormat = WebMessageFormat.Xml, + UriTemplate = "?method=notifications.get&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0")] + XElement GetNotifications(string api_key, string session_key, string call_id, string signature); + + [OperationContract] + [WebGet( + BodyStyle = WebMessageBodyStyle.Bare, + RequestFormat = WebMessageFormat.Xml, + ResponseFormat = WebMessageFormat.Xml, + UriTemplate = "?method=stream.get&api_key={api_key}&session_key={session_key}&call_id={call_id}&source_ids={source_ids}&sig={signature}&v=1.0&limit={limit}")] + XElement GetStream(string api_key, string session_key, string call_id, string signature, string source_ids, string limit); + + [OperationContract] + [WebGet( + BodyStyle = WebMessageBodyStyle.Bare, + RequestFormat = WebMessageFormat.Xml, + ResponseFormat = WebMessageFormat.Xml, + UriTemplate = "?method=fql.query&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0&query={query}")] + XElement ExecuteQuery(string api_key, string session_key, string call_id, string signature, string query); + + [OperationContract] + [WebGet( + BodyStyle = WebMessageBodyStyle.Bare, + RequestFormat = WebMessageFormat.Xml, + ResponseFormat = WebMessageFormat.Xml, + UriTemplate = "?method=fql.multiquery&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0&queries={queries}")] + XElement ExecuteMultiQueries(string api_key, string session_key, string call_id, string signature, string queries); + + [OperationContract] + [WebGet( + BodyStyle = WebMessageBodyStyle.Bare, + RequestFormat = WebMessageFormat.Xml, + ResponseFormat = WebMessageFormat.Xml, + UriTemplate = "?method=status.set&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0&status={status}")] + XElement SetStatus(string api_key, string session_key, string call_id, string signature, string status); + + [OperationContract] + [WebGet( + BodyStyle = WebMessageBodyStyle.Bare, + RequestFormat = WebMessageFormat.Xml, + ResponseFormat = WebMessageFormat.Xml, + UriTemplate = "?method=stream.addcomment&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0&post_id={post_id}&comment={comment}")] + XElement AddComment(string api_key, string session_key, string call_id, string signature, string post_id, string comment); + + [OperationContract] + [WebGet( + BodyStyle = WebMessageBodyStyle.Bare, + RequestFormat = WebMessageFormat.Xml, + ResponseFormat = WebMessageFormat.Xml, + UriTemplate = "?method=notifications.send&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0&to_ids={to_ids}¬ification={notification}")] + XElement SendNotification(string api_key, string session_key, string call_id, string signature, string to_ids, string notification); + } +} \ No newline at end of file diff --git a/Code/Channels/Facebook/Resources/icon-10.png b/Code/Channels/Facebook/Resources/icon-10.png new file mode 100644 index 0000000..40e2c00 Binary files /dev/null and b/Code/Channels/Facebook/Resources/icon-10.png differ diff --git a/Code/Channels/Facebook/Resources/icon-13.png b/Code/Channels/Facebook/Resources/icon-13.png new file mode 100644 index 0000000..67b0f0b Binary files /dev/null and b/Code/Channels/Facebook/Resources/icon-13.png differ diff --git a/Code/Channels/Facebook/Resources/icon-64.png b/Code/Channels/Facebook/Resources/icon-64.png new file mode 100644 index 0000000..1f6acab Binary files /dev/null and b/Code/Channels/Facebook/Resources/icon-64.png differ diff --git a/Code/Channels/GMail/GMailConfiguration.cs b/Code/Channels/GMail/GMailConfiguration.cs new file mode 100644 index 0000000..2dedace --- /dev/null +++ b/Code/Channels/GMail/GMailConfiguration.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Linq; +using System.Text; +using System.Xml.Serialization; +using Inbox2.Channels.Imap2; +using Inbox2.Channels.Smtp; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Framework.Extensions; + +namespace Inbox2.Channels.GMail +{ + [Serializable] + [Export(typeof(ChannelConfiguration))] + public class GMailConfiguration : ChannelConfiguration + { + public GMailConfiguration() + { + InnerInputChannel = new Channel { Type = typeof(Imap2ClientChannel), Hostname = "imap.gmail.com", Port = 993, IsSecured = true, MaxConcurrentConnections = 1 }; + InnerOutputChannel = new Channel { Type = typeof(SmtpClientChannel), Hostname = "smtp.gmail.com", Port = 465, IsSecured = true, MaxConcurrentConnections = 1 }; + InnerContactsChannel = new Channel { Type = typeof(GoogleContactsChannel) }; + InnerCalendarChannel = new Channel { Type = typeof(GoogleCalendarChannel) }; + } + + public override string DisplayName + { + get { return "GMail"; } + } + + public override string DefaultDomain + { + get { return "gmail.com"; } + } + + public override int PreferredSortOrder + { + get { return 10; } + } + + public override ChannelCharasteristics Charasteristics + { + get + { + var charasteristics = ChannelCharasteristics.Default; + + charasteristics.SupportsReadStates = true; + charasteristics.SupportsLabels = true; + charasteristics.CanCustomize = true; + + return charasteristics; + } + } + + public override ChannelConfiguration Clone() + { + return this.DeepCopy(new XmlSerializer(typeof(GMailConfiguration))); + } + } +} diff --git a/Code/Channels/GMail/GoogleCalendarChannel.cs b/Code/Channels/GMail/GoogleCalendarChannel.cs new file mode 100644 index 0000000..2e78d8e --- /dev/null +++ b/Code/Channels/GMail/GoogleCalendarChannel.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Google.GData.Calendar; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Framework.Web; +using Inbox2.Platform.Logging; + +namespace Inbox2.Channels.GMail +{ + public class GoogleCalendarChannel : IClientCalendarChannel + { + protected CalendarService service = new CalendarService("Tabdeelee-Inbox2-1"); + + #region Properties + + public string Hostname + { + get { return "http://www.google.com/calendar/feeds/"; } + set { } + } + public int Port + { + get { return 80; } + set { } + } + + public bool IsSecured + { + get { return false; } + set { } + } + + public bool IsEnabled { get; set; } + public int MaxConcurrentConnections { get; set; } + public IChannelCredentialsProvider CredentialsProvider { get; set; } + + public string Protocol + { + get { return "GoogleContactsAIP"; } + } + + #endregion + + public IEnumerable GetCalendars() + { + yield return new ChannelCalendar(); + } + + public IEnumerable GetEvents(ChannelCalendar calendar) + { + var creds = CredentialsProvider.GetCredentials(); + service.setUserCredentials(creds.Claim, creds.Evidence); + string url = String.Format("http://www.google.com/calendar/feeds/{0}/private/full", creds.Claim); + + // Check for 404 with custom httpclient on photourl since regular HttpWebClient keeps throwing exceptions + var token = service.QueryAuthenticationToken(); + var code = HttpStatusClient.GetStatusCode(url, + new Dictionary { { "Authorization", "GoogleLogin auth=" + token } }); + + if (!(code == 200 || code == 302)) + { + Logger.Warn("Not downloading calendar events because of un expected HttpStatusCode. Code = [0}", LogSource.Sync, code); + + yield break; + } + + EventQuery query = new EventQuery { Uri = new Uri(url) }; + EventFeed feed = service.Query(query); + + foreach (EventEntry item in feed.Entries) + { + // Create a new channelevent + ChannelEvent evt = new ChannelEvent(); + + // Get the event key + evt.ChannelEventKey = item.Id.Uri.ToString(); + + // Get subject, description and location + evt.Subject = item.Title.Text; + evt.Description = item.Content.Content; + evt.Location = item.Locations[0].ValueString; + + // Get the start, end date and date modified + evt.StartDate = item.Times[0].StartTime; + evt.EndDate = item.Times[0].EndTime; + evt.Modified = item.Updated; + + // Get the date of the event when it was initially created + evt.Stamp = item.Published; + + // Set the date of the event when it was created by Inbox2 + evt.DateCreated = DateTime.Now; + + // Get the status + if (item.Status == EventEntry.EventStatus.CONFIRMED) evt.State = EventState.Confirmed; + else if (item.Status == EventEntry.EventStatus.TENTATIVE) evt.State = EventState.Tentative; + else if (item.Status == EventEntry.EventStatus.CANCELED) evt.State = EventState.Cancelled; + else evt.State = EventState.Confirmed; + + // Get the visability (/class) + if (item.EventVisibility.Value == EventEntry.Visibility.PUBLIC_VALUE) evt.Class = EventClassType.Public; + else if (item.EventVisibility.Value == EventEntry.Visibility.PRIVATE_VALUE) evt.Class = EventClassType.Private; + else if (item.EventVisibility.Value == EventEntry.Visibility.CONFIDENTIAL_VALUE) evt.Class = EventClassType.Confidential; + else if (item.EventVisibility.Value == EventEntry.Visibility.DEFAULT_VALUE) evt.Class = EventClassType.Public; + else evt.Class = EventClassType.Public; + + // Gmail hasn't a priority status, so set it to None + evt.Priority = EventPriority.None; + + // Return the event + yield return evt; + } + } + + public void Dispose() + { + + } + } +} diff --git a/Code/Channels/GMail/GoogleContactsChannel.cs b/Code/Channels/GMail/GoogleContactsChannel.cs new file mode 100644 index 0000000..641d98a --- /dev/null +++ b/Code/Channels/GMail/GoogleContactsChannel.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Google.Contacts; +using Google.GData.Client; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Extensions; +using Inbox2.Platform.Channels.Interfaces; + +namespace Inbox2.Channels.GMail +{ + public class GoogleContactsChannel : IClientContactsChannel + { + #region Properties + + public string Hostname + { + get { return "http://www.google.com/m8/feeds/contacts/"; } + set { } + } + public int Port + { + get { return 80; } + set { } + } + + public bool IsSecured + { + get { return false; } + set { } + } + + public bool IsEnabled { get; set; } + public int MaxConcurrentConnections { get; set; } + public IChannelCredentialsProvider CredentialsProvider { get; set; } + + public string Protocol + { + get { return "GoogleContactsAIP"; } + } + + #endregion + + public IEnumerable GetContacts() + { + var cred = CredentialsProvider.GetCredentials(); + var rs = new RequestSettings("Tabdeelee-Inbox2-1", cred.Claim, cred.Evidence) { AutoPaging = true }; + var cr = new ContactsRequest(rs); + + var feed = cr.GetContacts(); + + foreach (Contact entry in feed.Entries) + { + ChannelContact contact = new ChannelContact(); + + contact.Person.Name = entry.Title; + contact.Profile.ChannelProfileKey = entry.Id; + + if (entry.Phonenumbers.Count > 0) + { + var phone = entry.Phonenumbers.First(); + contact.Profile.PhoneNr = phone.Value; + } + + if (entry.PrimaryEmail != null) + contact.Profile.SourceAddress = new SourceAddress(entry.PrimaryEmail.Address, contact.Person.Name); + + try + { + // Check for 404 with custom httpclient on photourl since regular HttpWebClient keeps throwing exceptions + //var token = cr.Service.QueryAuthenticationToken(); + //var code = HttpStatusClient.GetStatusCode(entry.PhotoUri.ToString(), + // new Dictionary { { "Authorization", "GoogleLogin auth=" + token }}); + + //if (code.HasValue && code == 200) + //{ + IGDataRequest request = cr.Service.RequestFactory.CreateRequest(GDataRequestType.Query, entry.PhotoUri); + request.Execute(); + + using (var avatarstream = request.GetResponseStream()) + { + if (avatarstream != null) + { + ChannelAvatar avatar = new ChannelAvatar(); + + // Copy avatarstream to a new memorystream because the source + // stream does not support seek operations. + MemoryStream ms = new MemoryStream(); + avatarstream.CopyTo(ms); + + avatar.Url = entry.PhotoUri.ToString(); + avatar.ContentStream = ms; + + contact.Profile.ChannelAvatar = avatar; + } + } + //} + } + catch (CaptchaRequiredException) + { + // Since GMail will keep on raising CaptchaRequiredException, break out here + // todo let the user know in some way or another? + yield break; + } + catch (Exception) + { + + } + + yield return contact; + } + } + + public IClientContactsChannel Clone() + { + return new GoogleContactsChannel + { + Hostname = Hostname, + Port = Port, + IsSecured = IsSecured, + MaxConcurrentConnections = MaxConcurrentConnections, + CredentialsProvider = CredentialsProvider + }; + } + + public void Dispose() + { + + } + } +} \ No newline at end of file diff --git a/Code/Channels/GMail/Inbox2.Channels.GMail.csproj b/Code/Channels/GMail/Inbox2.Channels.GMail.csproj new file mode 100644 index 0000000..df380c6 --- /dev/null +++ b/Code/Channels/GMail/Inbox2.Channels.GMail.csproj @@ -0,0 +1,225 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {B16EA434-9B01-47E7-9027-F400F083CA38} + Library + Properties + Inbox2.Channels.GMail + Inbox2.Channels.GMail + v3.5 + 512 + OnOutputUpdated + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\..\Stable Assemblies\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + False + ..\..\..\ThirdParty\Google\Google.GData.AccessControl.dll + + + False + ..\..\..\ThirdParty\Google\Google.GData.Calendar.dll + + + False + ..\..\..\ThirdParty\Google\Google.GData.Client.dll + + + False + ..\..\..\ThirdParty\Google\Google.GData.Contacts.dll + + + False + ..\..\..\ThirdParty\Google\Google.GData.Extensions.dll + + + + False + ..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + 3.5 + + + 3.0 + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + {43B96CD2-D7DA-4286-A209-EE9585EF6927} + Inbox2.Platform.Channels + + + {FB90E43A-0E32-41D5-A7AB-83EA0D936E5E} + Inbox2.Platform.Framework + + + {B9CE1540-1D68-43B2-83DB-47EC21D158A6} + Inbox2.Platform.Interfaces + + + {6AE2A2AF-9B61-45B0-A375-666C5225A5B4} + Inbox2.Platform.Logging + + + {528A7823-5CED-4E31-ABDF-E1F6F821FCFD} + Inbox2.Channels.Imap2 + + + {D977B2FC-E1BE-410E-8544-8B7263AB44C6} + Inbox2.Channels.Smtp + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Code/Channels/GMail/Properties/AssemblyInfo.cs b/Code/Channels/GMail/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..4cd87d4 --- /dev/null +++ b/Code/Channels/GMail/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2.Channels.Gmail")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2.Channels.Gmail")] +[assembly: AssemblyCopyright("Copyright Tabdeelee © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("82dbe61b-c543-41ea-861e-4bcc05ac6189")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Code/Channels/GMail/RawMapper.cs b/Code/Channels/GMail/RawMapper.cs new file mode 100644 index 0000000..066c224 --- /dev/null +++ b/Code/Channels/GMail/RawMapper.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.ServiceModel; +using System.ServiceModel.Channels; +using System.Text; + +namespace Inbox2.Channels.Contacts.REST +{ + internal class RawMapper : WebContentTypeMapper + { + public override WebContentFormat GetMessageFormatForContentType(string contentType) + { + return WebContentFormat.Raw; // always + } + + internal static Binding GetBinding() + { + CustomBinding result = new CustomBinding(new WebHttpBinding()); + WebMessageEncodingBindingElement element = result.Elements.Find(); + element.ContentTypeMapper = new RawMapper(); + return result; + } + } +} diff --git a/Code/Channels/GMail/Resources/icon-10.png b/Code/Channels/GMail/Resources/icon-10.png new file mode 100644 index 0000000..c15956c Binary files /dev/null and b/Code/Channels/GMail/Resources/icon-10.png differ diff --git a/Code/Channels/GMail/Resources/icon-13.png b/Code/Channels/GMail/Resources/icon-13.png new file mode 100644 index 0000000..cd21b1f Binary files /dev/null and b/Code/Channels/GMail/Resources/icon-13.png differ diff --git a/Code/Channels/GMail/Resources/icon-64.png b/Code/Channels/GMail/Resources/icon-64.png new file mode 100644 index 0000000..00ecbe0 Binary files /dev/null and b/Code/Channels/GMail/Resources/icon-64.png differ diff --git a/Code/Channels/Hotmail/HotmailConfiguration.cs b/Code/Channels/Hotmail/HotmailConfiguration.cs new file mode 100644 index 0000000..0bf77b6 --- /dev/null +++ b/Code/Channels/Hotmail/HotmailConfiguration.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Linq; +using System.Text; +using System.Xml.Serialization; +using Inbox2.Channels.Pop3; +using Inbox2.Channels.Smtp; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Framework.Extensions; + +namespace Inbox2.Channels.Hotmail +{ + [Serializable] + [Export(typeof(ChannelConfiguration))] + public class HotmailConfiguration : ChannelConfiguration + { + public HotmailConfiguration() + { + InnerInputChannel = new Channel { Type = typeof(Pop3ClientChannel), Hostname = "pop3.live.com", Port = 995, IsSecured = true, MaxConcurrentConnections = 1 }; + InnerOutputChannel = new Channel { Type = typeof(SmtpClientChannel), Hostname = "smtp.live.com", Port = 25, IsSecured = false, MaxConcurrentConnections = 1 }; + //InnerContactsChannel = new Channel { Type = typeof(HotmailContactsChannel) }; + } + + public override string DefaultDomain + { + get { return "hotmail.com"; } + } + + public override string DisplayName + { + get { return "Hotmail"; } + } + + public override ChannelCharasteristics Charasteristics + { + get + { + var charasteristics = base.Charasteristics; + + charasteristics.SupportsReadStates = false; + charasteristics.CanCustomize = true; + + return charasteristics; + } + } + + public override ChannelConfiguration Clone() + { + return this.DeepCopy(new XmlSerializer(typeof(HotmailConfiguration))); + } + } +} diff --git a/Code/Channels/Hotmail/HotmailContactsChannel.cs b/Code/Channels/Hotmail/HotmailContactsChannel.cs new file mode 100644 index 0000000..2c1f06f --- /dev/null +++ b/Code/Channels/Hotmail/HotmailContactsChannel.cs @@ -0,0 +1,171 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.IO; +using System.IO.Compression; +using System.Linq; +using System.ServiceModel; +using System.ServiceModel.Description; +using System.ServiceModel.Web; +using System.Xml; +using System.Xml.Linq; +using Inbox2.Channels.Hotmail.REST; +using Inbox2.Platform.Channels.ServiceModel; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Interfaces; + +namespace Inbox2.Channels.Hotmail +{ + class HotmailContactsChannel : IClientContactsChannel + { + protected const string contactsFeedUrl = "https://livecontacts.services.live.com/users/@L@{0}/REST/LiveContacts/Contacts"; + private const string appId = "000000004C00C9B8"; + private const string secretKey = "3QYoxaTDOAi1gYzMqg3lls4bvhz48ip8"; + + private static string authHeader; + private static string lid; + + static void GetAuthHeader() + { + //TODO: replace this with scraping and return the right response values for the 4 variables + //i.e.: call method ContactsAuthentication.AuthenticateContactsSharing(username, password) + string responseConsentToken = "eact%3Duw5Ym5wpNL9Jo51f9N38Div7B9HmBTkwDof75T22MRvbToDeXSEYvZzWRuRMjHkw%252B8kbWcbKJ4ZwWdGcKm%252FeCJYCPIKTHMSCzx4gZscI9w21NKV%252BqjKFkQ6t9b6%252FccObokDfN6XCU1MBFddNoenuIAyo2o44luRpkDcokM3TgfSdtj%252Bg0hZUR8V8IIIvLmelc1KTjcI%252F3GJ2pBQXkxur0O4YKGu8cFF0y8gNVuXJvpL%252BcFq5%252Fdq8wMzTT6SnGbZgHyPqJv6UQZsYpC9EM%252FQmSlcxinLZf%252BV%252BxB25qNHE2GD05SFiUYKwEf%252FSS5a9RMziv8jThJTReCeFaBLbJClvGIr7D3zHh051REFWl97FlvH2oGcNMze5K9R%252Fxb9pi0%252BFcUCA6hTveVuyih0zOZY5TFyhvltaU2aemq3BBFOa%252FHRbTMu5kGAoW%252FUJiNf4FODvuZCF%252BrH%252BMMEV5V5b3WEsTPlytEG9HhzAjWpMV6i784pqXQjB7gF6Iuy2T8JKujk2wN%252FuFIS6F4Z%252BGMUbRYBxgmuLZMALShiscC6gC4JQuW7fr2zcTqBEmChmJAi9D9T97AVBWL5cyzrjxpkqm8Dr7z8KYqGcoWQ8VVy1JMcxW3vMGMJZPZBQUz1AOYut2xqd7kt1sssDfI7Owv4M7uU55K16IImxPR4LAmapujGLtTjWwfSoKYZBl2%252B41%252BuzPcvyUw%252BQqDu2aOCe1YuZ%252FaJry3tcIk43R0V9LFQ9HFEto8g8R7PeUlx9469jFhNPGPqzFy7Qlc%252BYGwf4nRwbrizAx5HKx9QuIcl%252FByK227CX0u7e7UkUzMQ%252FfTc13TpfvFk%252FBo5aXeoxjAKwrnyFeeDUKHiEsHwjwu2EW7kGfTdAOodUACDsoQDnrrrs%252BOX80Q4BzfVhZYy3F8XDAmdczqqzaGimQLK9UETvr%252F03GzCZdJResKRJNAeaaZ6Ahdy9ebJ64qvSvFq8jBOV1%252FY1rq8clX%252F5GZxnXzqT8gN%252F%252B9%252F8ktllYZi4QLmxaT2ChY2qnE8Fxx7GomY0k%252B5sDWhdqD18Ddu9HSFSaAFq4DflnTWis6jCLJ6WpqaeBGwJyPEGm0IYlVbQ0k7X5WnKYjKrC3kl68%252BqU6lL0T1nRoa8mZNXdeXZ72W%252FLQp21IrOH6NZhnomPBID2myyJ09QtuUkXlSaWbT5A0oRcE9ywPY4EvplbggyLxpke9jL%252BtIUQtNXdGN%252B%252FwjQhREw8dfMRHoRl6VN%252BmGLONeVvoR6Lvi%252BXJZhBz36XwwfhXtGb7kKIud8E9as%252FMC6YZcUNBn%252F28Zj9YdcRmM2iAAs9DBvw5tTmgAfPYU%253D"; + string responseResponseCode = "RequestApproved"; + string responseAction = "delauth"; + string responseAppctx = ""; + + NameValueCollection nvc = new NameValueCollection(4); + WindowsLiveLogin wll = new WindowsLiveLogin(appId, secretKey); + nvc.Add("ConsentToken", responseConsentToken); + nvc.Add("ResponseCode", responseResponseCode); + nvc.Add("action", responseAction); + nvc.Add("appctx", responseAppctx); + + WindowsLiveLogin.ConsentToken ct = wll.ProcessConsent(nvc); + authHeader = String.Format("DelegatedToken dt=\"{0}\"", ct.DelegationToken); + lid = ct.LocationID; + } + + public IEnumerable GetContacts() + { + EnsureAuthentication(); + UriBuilder uriBuilder = new UriBuilder(); + uriBuilder.Scheme = "HTTPS"; + uriBuilder.Path = "/users/@L@" + lid + "/REST/LiveContacts"; + uriBuilder.Host = "livecontacts.services.live.com"; + uriBuilder.Port = 443; + string uriPath = uriBuilder.Uri.AbsoluteUri; + + ILiveContacts channel = BuildContactsChannel(uriPath); + using (new OperationContextScope(channel as IContextChannel)) + { + // Auth header is required + WebOperationContext.Current.OutgoingRequest.Headers.Set("Authorization", authHeader); + WebOperationContext.Current.OutgoingRequest.Headers.Add("Accept-Encoding", "deflate"); + WebOperationContext.Current.OutgoingRequest.Headers.Add("Pragma", "No-Cache"); + WebOperationContext.Current.OutgoingRequest.UserAgent = "Windows Live Data Interactive SDK"; + WebOperationContext.Current.OutgoingRequest.Method = "GET"; + WebOperationContext.Current.OutgoingRequest.ContentType = "application/xml; charset=utf-8"; + + // Since the response is chucked we have to read it in as a Stream + Stream responseStream = channel.Contacts(); + responseStream = new DeflateStream(responseStream, CompressionMode.Decompress); + + XElement element; + + using (XmlTextReader reader = new XmlTextReader(responseStream)) + element = XElement.Load(reader); + + foreach (var entry in element.Elements("Contact")) + { + if(entry.Element("Emails") != null) + { + yield return ParseContact(entry); + } + } + } + } + + public IClientContactsChannel Clone() + { + return new HotmailContactsChannel + { + Hostname = Hostname, + Port = Port, + IsSecured = IsSecured, + MaxConcurrentConnections = MaxConcurrentConnections, + CredentialsProvider = CredentialsProvider + }; + } + + protected ILiveContacts BuildContactsChannel(string epAddress) + { + EndpointAddress address = new EndpointAddress(epAddress); + + var binding = RawMapper.GetCustomBinding(new WebHttpBinding(WebHttpSecurityMode.Transport)); + ChannelFactory cf = new ChannelFactory(binding, address); + cf.Endpoint.Behaviors.Add(new WebHttpBehavior()); + + var channel = cf.CreateChannel(); + + return channel; + } + + //TODO: right implementation + protected ChannelContact ParseContact(XElement element) + { + ChannelContact contact = new ChannelContact(); + + contact.Person.Name = element.Element("Profiles").Element("Personal").Element("DisplayName").Value; + contact.Profile.ChannelProfileKey = element.Element("ID").Value; + + // Todo could be different kind of addressses; home, work etc + contact.Profile.SourceAddress = new SourceAddress( + element.Element("Emails").Element("Email").Element("Address").Value, + element.Element("Profiles").Element("Personal").Element("DisplayName").Value); + + return contact; + } + + protected void EnsureAuthentication() + { + if (String.IsNullOrEmpty(authHeader)) + GetAuthHeader(); + } + + #region Properties + + public string Hostname + { + get { return "https://livecontacts.services.live.com/"; } + set { } + } + public int Port + { + get { return 443; } + set { } + } + + public bool IsSecured + { + get { return true; } + set { } + } + + public bool IsEnabled { get; set; } + public int MaxConcurrentConnections { get; set; } + public IChannelCredentialsProvider CredentialsProvider { get; set; } + + public string Protocol + { + get { return "HotmailContactsAPI"; } + } + + #endregion + + public void Dispose() + { + + } + } +} diff --git a/Code/Channels/Hotmail/Inbox2.Channels.Hotmail.csproj b/Code/Channels/Hotmail/Inbox2.Channels.Hotmail.csproj new file mode 100644 index 0000000..f3cb263 --- /dev/null +++ b/Code/Channels/Hotmail/Inbox2.Channels.Hotmail.csproj @@ -0,0 +1,200 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {DEE6C6F9-D037-44C4-AC98-E1896D6CEB17} + Library + Properties + Inbox2.Channels.Hotmail + Inbox2.Channels.Hotmail + v3.5 + 512 + OnOutputUpdated + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\..\Stable Assemblies\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + + False + ..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + 3.5 + + + 3.0 + + + 3.5 + + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + {43B96CD2-D7DA-4286-A209-EE9585EF6927} + Inbox2.Platform.Channels + + + {FB90E43A-0E32-41D5-A7AB-83EA0D936E5E} + Inbox2.Platform.Framework + + + {B9CE1540-1D68-43B2-83DB-47EC21D158A6} + Inbox2.Platform.Interfaces + + + {6AE2A2AF-9B61-45B0-A375-666C5225A5B4} + Inbox2.Platform.Logging + + + {60AE3B61-131B-4CC9-B49C-0892E701ACF0} + Inbox2.Channels.Pop3 + + + {D977B2FC-E1BE-410E-8544-8B7263AB44C6} + Inbox2.Channels.Smtp + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Code/Channels/Hotmail/Properties/AssemblyInfo.cs b/Code/Channels/Hotmail/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..477efd0 --- /dev/null +++ b/Code/Channels/Hotmail/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2.Channels.Hotmail")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2.Channels.Hotmail")] +[assembly: AssemblyCopyright("Copyright Tabdeelee © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("8ab51613-d8e0-448a-8137-03191c0c2edf")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Code/Channels/Hotmail/REST/ContactsAuthentication.cs b/Code/Channels/Hotmail/REST/ContactsAuthentication.cs new file mode 100644 index 0000000..7d3b6ec --- /dev/null +++ b/Code/Channels/Hotmail/REST/ContactsAuthentication.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; + +namespace Inbox2.Channels.Hotmail.REST +{ + class ContactsAuthentication + { + //Scraping returns + public static List AuthenticateContactsSharing(string username, string password) + { + return null; + + } + } +} diff --git a/Code/Channels/Hotmail/REST/ILiveContacts.cs b/Code/Channels/Hotmail/REST/ILiveContacts.cs new file mode 100644 index 0000000..22379c2 --- /dev/null +++ b/Code/Channels/Hotmail/REST/ILiveContacts.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.ServiceModel; +using System.ServiceModel.Web; + +namespace Inbox2.Channels.Hotmail.REST +{ + [ServiceContract] + [XmlSerializerFormat] + public interface ILiveContacts + { + [OperationContract] + [WebGet( + BodyStyle = WebMessageBodyStyle.Wrapped, + //RequestFormat = WebMessageFormat.Xml, + ResponseFormat = WebMessageFormat.Xml) + ] + Stream Contacts(); + } +} \ No newline at end of file diff --git a/Code/Channels/Hotmail/REST/WindowsLiveLogin.cs b/Code/Channels/Hotmail/REST/WindowsLiveLogin.cs new file mode 100644 index 0000000..2b026b3 --- /dev/null +++ b/Code/Channels/Hotmail/REST/WindowsLiveLogin.cs @@ -0,0 +1,2304 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Specialized; +using System.Collections; +using System.Web; +using System.Web.Configuration; +using System.Security.Cryptography; +using System.IO; +using System.Net; +using System.Reflection; +using System.Xml; + +/* + * FILE: WindowsLiveLogin.cs + * + * DESCRIPTION: Sample implementation of Web Authentication and Delegated + * Authentication protocol in C#. Also includes trusted + * sign-in and application verification sample + * implementations. + * + * VERSION: 1.1 + * + * Copyright (c) 2008 Microsoft Corporation. All Rights Reserved. + */ + + + +/// +/// Sample implementation of Web Authentication and Delegated Authentication +/// protocol. Also includes trusted sign-in and application +/// verification sample implementations. +/// +namespace Inbox2.Channels.Hotmail.REST +{ + + + public class WindowsLiveLogin + { + /// + /// Stub implementation for logging debug output. You can run + /// a tool such as 'dbmon' to see the output. + /// + static void debug(string msg) + { + System.Diagnostics.Debug.WriteLine(msg); + System.Diagnostics.Debug.Flush(); + } + + /// + /// Initialize the WindowsLiveLogin module with the + /// application ID and secret key. + /// + /// We recommend that you employ strong measures to protect + /// the secret key. The secret key should never be + /// exposed to the Web or other users. + /// + public WindowsLiveLogin(string appId, string secret) : + this(appId, secret, null) { } + + /// + /// Initialize the WindowsLiveLogin module with the + /// application ID, secret key, and security algorithm. + /// + /// We recommend that you employ strong measures to protect + /// the secret key. The secret key should never be + /// exposed to the Web or other users. + /// + public WindowsLiveLogin(string appId, string secret, string securityAlgorithm) : + this(appId, secret, securityAlgorithm, false) { } + + /// + /// Initialize the WindowsLiveLogin module with the + /// forceDelAuthNonProvisioned flag, policy URL, and return URL. + /// + /// The 'force_delauth_nonprovisioned' flag indicates whether + /// your application is registered for Delegated Authentication + /// (that is, whether it uses an application ID and secret key). We + /// recommend that your Delegated Authentication application always + /// be registered for enhanced security and functionality. + /// + public WindowsLiveLogin(bool forceDelAuthNonProvisioned, string policyUrl, string returnUrl) + { + ForceDelAuthNonProvisioned = forceDelAuthNonProvisioned; + PolicyUrl = policyUrl; + ReturnUrl = returnUrl; + } + + /// + /// Initialize the WindowsLiveLogin module with the + /// application ID, secret key, security algorithm and + /// forceDelAuthNonProvisioned flag. + /// + /// We recommend that you employ strong measures to protect + /// the secret key. The secret key should never be + /// exposed to the Web or other users. + /// + /// The 'force_delauth_nonprovisioned' flag indicates whether + /// your application is registered for Delegated Authentication + /// (that is, whether it uses an application ID and secret key). We + /// recommend that your Delegated Authentication application always + /// be registered for enhanced security and functionality. + /// + public WindowsLiveLogin(string appId, string secret, string securityAlgorithm, bool forceDelAuthNonProvisioned) : + this(appId, secret, securityAlgorithm, forceDelAuthNonProvisioned, null) { } + + /// + /// Initialize the WindowsLiveLogin module with the + /// application ID, secret key, security algorithm, + /// forceDelAuthNonProvisioned and policy URL use. + /// + /// We recommend that you employ strong measures to protect + /// the secret key. The secret key should never be + /// exposed to the Web or other users. + /// + /// The 'force_delauth_nonprovisioned' flag indicates whether + /// your application is registered for Delegated Authentication + /// (that is, whether it uses an application ID and secret key). We + /// recommend that your Delegated Authentication application always + /// be registered for enhanced security and functionality. + /// + public WindowsLiveLogin(string appId, string secret, string securityAlgorithm, bool forceDelAuthNonProvisioned, string policyUrl) : + this(appId, secret, securityAlgorithm, forceDelAuthNonProvisioned, policyUrl, null) { } + + /// + /// Initialize the WindowsLiveLogin module with the + /// application ID, secret key, security algorithm, + /// forceDelAuthNonProvisioned, policy URL and return URL. + /// + /// We recommend that you employ strong measures to protect + /// the secret key. The secret key should never be + /// exposed to the Web or other users. + /// + /// The 'force_delauth_nonprovisioned' flag indicates whether + /// your application is registered for Delegated Authentication + /// (that is, whether it uses an application ID and secret key). We + /// recommend that your Delegated Authentication application always + /// be registered for enhanced security and functionality. + public WindowsLiveLogin(string appId, string secret, string securityAlgorithm, bool forceDelAuthNonProvisioned, string policyUrl, string returnUrl) + { + ForceDelAuthNonProvisioned = forceDelAuthNonProvisioned; + AppId = appId; + Secret = secret; + SecurityAlgorithm = securityAlgorithm; + PolicyUrl = policyUrl; + ReturnUrl = returnUrl; + } + + /// + /// Initialize the WindowsLiveLogin module from the + /// web.config file if loadAppSettings is true. Otherwise, + /// you will have to manually set the AppId, Secret and + /// SecurityAlgorithm properties. + /// + /// In a Delegated Authentication scenario, you may also specify + /// the return and privacy policy URLs to use, as shown in the + /// Delegated Authentication samples. + /// + public WindowsLiveLogin(bool loadAppSettings) + { + if (!loadAppSettings) { return; } + + NameValueCollection appSettings = WebConfigurationManager.AppSettings; + if (appSettings == null) + { + throw new IOException("Error: WindowsLiveLogin: Failed to load the Web application settings."); + } + + string forceDelAuthNonProvisioned = appSettings["wll_force_delauth_nonprovisioned"]; + + if (!string.IsNullOrEmpty(forceDelAuthNonProvisioned) && + (forceDelAuthNonProvisioned.ToLower() == "true")) + { + ForceDelAuthNonProvisioned = true; + } + else + { + ForceDelAuthNonProvisioned = false; + } + + AppId = appSettings["wll_appid"]; + Secret = appSettings["wll_secret"]; + OldSecret = appSettings["wll_oldsecret"]; + OldSecretExpiry = appSettings["wll_oldsecretexpiry"]; + SecurityAlgorithm = appSettings["wll_securityalgorithm"]; + PolicyUrl = appSettings["wll_policyurl"]; + ReturnUrl = appSettings["wll_returnurl"]; + BaseUrl = appSettings["wll_baseurl"]; + SecureUrl = appSettings["wll_secureurl"]; + ConsentUrl = appSettings["wll_consenturl"]; + } + + /// + /// APPID + /// SECRET + /// wsignin1.0 + /// http://[your domain]/[your privacy policy] + /// http://[your domain]/[your return url] + /// + /// + /// In a Delegated Authentication scenario, you may also specify + /// 'returnurl' and 'policyurl' in the settings file. + /// + /// We recommend that you store the Windows Live Login settings file + /// in an area on your server that cannot be accessed through + /// the Internet. This file contains important confidential + /// information. + /// ]]> + public WindowsLiveLogin(string settingsFile) + { + NameValueCollection settings = parseSettings(settingsFile); + + string forceDelAuthNonProvisioned = settings["force_delauth_nonprovisioned"]; + + if (!string.IsNullOrEmpty(forceDelAuthNonProvisioned) && + (forceDelAuthNonProvisioned.ToLower() == "true")) + { + ForceDelAuthNonProvisioned = true; + } + else + { + ForceDelAuthNonProvisioned = false; + } + + AppId = settings["appid"]; + Secret = settings["secret"]; + OldSecret = settings["oldsecret"]; + OldSecretExpiry = settings["oldsecretexpiry"]; + SecurityAlgorithm = settings["securityalgorithm"]; + PolicyUrl = settings["policyurl"]; + ReturnUrl = settings["returnurl"]; + BaseUrl = settings["baseurl"]; + SecureUrl = settings["secureurl"]; + ConsentUrl = settings["consenturl"]; + } + + string appId; + + /// + /// Gets or sets the application ID. + /// + public string AppId + { + set + { + if (string.IsNullOrEmpty(value)) + { + if (ForceDelAuthNonProvisioned) + { + return; + } + + throw new ArgumentNullException("value"); + } + + Regex re = new Regex(@"^\w+$"); + if (!re.IsMatch(value)) + { + throw new ArgumentException("Error: AppId: Application ID must be alphanumeric: " + value); + } + + appId = value; + } + + get + { + if (string.IsNullOrEmpty(appId)) + { + throw new InvalidOperationException("Error: AppId: Application ID was not set. Aborting."); + } + + return appId; + } + } + + byte[] cryptKey; + byte[] signKey; + + /// + /// Sets your secret key. Use this method if you did not specify + /// a secret key at initialization. + /// + public string Secret + { + set + { + if (string.IsNullOrEmpty(value)) + { + if (ForceDelAuthNonProvisioned) + { + return; + } + + throw new ArgumentNullException("value"); + } + + if (value.Length < 16) + { + throw new ArgumentException("Error: Secret: Secret key is expected to be longer than 16 characters: " + value.Length); + } + + cryptKey = derive(value, "ENCRYPTION"); + signKey = derive(value, "SIGNATURE"); + } + + get { return null; } + } + + byte[] oldCryptKey; + byte[] oldSignKey; + + /// + /// Sets your old secret key. + /// + /// Use this property to set your old secret key if you are in the + /// process of transitioning to a new secret key. You may need this + /// property because the Windows Live ID servers can take up to + /// 24 hours to propagate a new secret key after you have updated + /// your application settings. + /// + /// If an old secret key is specified here and has not expired + /// (as determined by the OldSecretExpiry setting), it will be used + /// as a fallback if token decryption fails with the new secret + /// key. + /// + public string OldSecret + { + set + { + if (string.IsNullOrEmpty(value)) + { + return; + } + + if (value.Length < 16) + { + throw new ArgumentException("Error: OldSecret: Secret key is expected to be longer than 16 characters: " + value.Length); + } + + oldCryptKey = derive(value, "ENCRYPTION"); + oldSignKey = derive(value, "SIGNATURE"); + } + + get { return null; } + } + + string oldSecretExpiryString; + DateTime oldSecretExpiry; + + /// + /// Sets or gets the expiry time for your old secret key. + /// + /// After this time has passed, the old secret key will no longer be + /// used even if token decryption fails with the new secret key. + /// + /// The old secret expiry time is represented as the number of seconds + /// elapsed since January 1, 1970. + /// + public string OldSecretExpiry + { + set + { + if (string.IsNullOrEmpty(value)) + { + return; + } + + oldSecretExpiryString = value; + int timestampInt; + + try + { + timestampInt = Convert.ToInt32(value); + } + catch (Exception) + { + throw new ArgumentException("Error: OldSecretExpiry: Invalid timestamp: " + + value); + } + + DateTime refTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + oldSecretExpiry = refTime.AddSeconds(timestampInt); + } + + get { return oldSecretExpiryString; } + } + + string securityAlgorithm; + + /// + /// Sets or gets the version of the security algorithm being used. + /// + public string SecurityAlgorithm + { + set { securityAlgorithm = value; } + + get + { + if (string.IsNullOrEmpty(securityAlgorithm)) + { + return "wsignin1.0"; + } + + return securityAlgorithm; + } + } + + bool forceDelAuthNonProvisioned = false; + + /// + /// Sets or gets a flag that indicates whether Delegated Authentication + /// is non-provisioned (i.e. does not use an application ID or secret + /// key). + /// + public bool ForceDelAuthNonProvisioned + { + set { forceDelAuthNonProvisioned = value; } + + get { return forceDelAuthNonProvisioned; } + } + + string policyUrl; + + /// + /// Sets or gets the privacy policy URL. + /// + /// Set the property for Delegated Authentication, if you did + /// not provide one at initialization time. + /// + public string PolicyUrl + { + set + { + if (string.IsNullOrEmpty(value) && ForceDelAuthNonProvisioned) + { + throw new ArgumentNullException("value"); + } + + policyUrl = value; + } + + get + { + if (string.IsNullOrEmpty(policyUrl)) + { + debug("Warning: In the initial release of Delegated Auth, a Policy URL must be configured in the SDK for both provisioned and non-provisioned scenarios."); + + if (ForceDelAuthNonProvisioned) + { + throw new InvalidOperationException("Error: PolicyUrl: Policy URL must be set in a Delegated Auth non-provisioned scenario. Aborting."); + } + } + + return policyUrl; + } + } + + string returnUrl; + + /// + /// Sets or gets the return URL--the URL on your site to which the consent + /// service redirects users (along with the action, consent token, + /// and application context) after they have successfully provided + /// consent information for Delegated Authentication. + /// + /// This value will override the return URL specified during + /// registration. + /// + public string ReturnUrl + { + set + { + if (string.IsNullOrEmpty(value) && ForceDelAuthNonProvisioned) + { + throw new ArgumentNullException("value"); + } + + returnUrl = value; + } + + get + { + if (string.IsNullOrEmpty(returnUrl) && ForceDelAuthNonProvisioned) + { + throw new InvalidOperationException("Error: ReturnUrl: Return URL must be specified in a delegated auth non-provisioned scenario. Aborting."); + } + + return returnUrl; + } + } + + string baseUrl; + + /// + /// Sets or gets the URL to use for the Windows Live Login server. + /// You should not have to use or change this. Furthermore, we + /// recommend that you use the Sign In control instead of + /// the URL methods provided here. + /// + public string BaseUrl + { + set { baseUrl = value; } + + get + { + if (string.IsNullOrEmpty(baseUrl)) + { + return "http://login.live.com/"; + } + + return baseUrl; + } + } + + string secureUrl; + + /// + /// Sets or gets the secure (HTTPS) URL to use for the Windows Live + /// Login server. You should not have to use or change this + /// directly. + // + public string SecureUrl + { + set { secureUrl = value; } + + get + { + if (string.IsNullOrEmpty(secureUrl)) + { + return "https://login.live.com/"; + } + + return secureUrl; + } + } + + string consentUrl; + + /// + /// Sets or gets the URL to use for the Windows Live Consent server. You + /// should not have to use or change this directly. + /// + public string ConsentUrl + { + set { consentUrl = value; } + + get + { + if (string.IsNullOrEmpty(consentUrl)) + { + return "https://consent.live.com/"; + } + + return consentUrl; + } + } + + /* Methods for Web Authentication support. */ + + /// + /// Returns the sign-in URL to use for the Windows Live Login server. + /// We recommend that you use the Sign In control instead. + /// + /// Sign-in URL + public string GetLoginUrl() + { + return GetLoginUrl(null); + } + + /// + /// Returns the sign-in URL to use for the Windows Live Login server. + /// We recommend that you use the Sign In control instead. + /// + /// If you specify it, will be returned as-is in the sign-in + /// response for site-specific use. + /// Sign-in URL + public string GetLoginUrl(string context) + { + return GetLoginUrl(context, null); + } + + /// + /// Returns the sign-in URL to use for the Windows Live Login server. + /// We recommend that you use the Sign In control instead. + /// + /// If you specify it, will be returned as-is in the sign-in + /// response for site-specific use. + /// The language in which the sign-in page is + /// displayed is configured by culture ID (For example, 'fr-fr' or + /// 'en-us') specified in the 'market' parameter. + /// Sign-in URL + public string GetLoginUrl(string context, string market) + { + string alg = "&alg=" + SecurityAlgorithm; + + context = string.IsNullOrEmpty(context) ? + string.Empty : "&appctx=" + HttpUtility.UrlEncode(context); + + market = string.IsNullOrEmpty(market) ? + string.Empty : "&mkt=" + HttpUtility.UrlEncode(market); + + return BaseUrl + "wlogin.srf?appid=" + AppId + + alg + context + market; + } + + /// + /// Returns the sign-out URL to use for the Windows Live Login server. + /// We recommend that you use the Sign In control instead. + /// + /// Sign-out URL + public string GetLogoutUrl() + { + return GetLogoutUrl(null); + } + + /// + /// Returns the sign-out URL to use for the Windows Live Login server. + /// We recommend that you use the Sign In control instead. + /// + /// The language in which the sign-in page is + /// displayed is configured by culture ID (For example, 'fr-fr' or + /// 'en-us') specified in the 'market' parameter. + /// Sign-out URL + public string GetLogoutUrl(string market) + { + market = string.IsNullOrEmpty(market) ? + string.Empty : "&mkt=" + HttpUtility.UrlEncode(market); + + return BaseUrl + "logout.srf?appid=" + AppId + market; + } + + /// + /// Holds the user information after a successful sign-in. + /// + public class User + { + public User(string timestamp, string id, string flags, string context, string token) + { + setTimestamp(timestamp); + setId(id); + setFlags(flags); + setContext(context); + setToken(token); + } + + DateTime timestamp; + + /// + /// Returns the timestamp as obtained from the SSO token. + /// + public DateTime Timestamp { get { return timestamp; } } + + /// + /// Sets the Unix timestamp. + /// + /// + private void setTimestamp(string timestamp) + { + if (string.IsNullOrEmpty(timestamp)) + { + throw new ArgumentException("Error: User: Null timestamp in token."); + } + + int timestampInt; + + try + { + timestampInt = Convert.ToInt32(timestamp); + } + catch (Exception) + { + throw new ArgumentException("Error: User: Invalid timestamp: " + + timestamp); + } + + DateTime refTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + this.timestamp = refTime.AddSeconds(timestampInt); + } + + string id; + + /// + /// Returns the pairwise unique ID for the user. + /// + public string Id { get { return id; } } + + /// + /// Sets the pairwise unique ID for the user. + /// + /// User id + private void setId(string id) + { + if (string.IsNullOrEmpty(id)) + { + throw new ArgumentException("Error: User: Null id in token."); + } + + Regex re = new Regex(@"^\w+$"); + if (!re.IsMatch(id)) + { + throw new ArgumentException("Error: User: Invalid id: " + id); + } + + this.id = id; + } + + bool usePersistentCookie; + + /// + /// Indicates whether the application + /// is expected to store the user token in a session or + /// persistent cookie. + /// + public bool UsePersistentCookie { get { return usePersistentCookie; } } + + /// + /// Sets the usePersistentCookie flag for the user. + /// + /// + private void setFlags(string flags) + { + this.usePersistentCookie = false; + + if (!string.IsNullOrEmpty(flags)) + { + try + { + int flagsInt = Convert.ToInt32(flags); + this.usePersistentCookie = ((flagsInt % 2) == 1); + } + catch (Exception) + { + throw new ArgumentException("Error: User: Invalid flags: " + + flags); + } + } + } + + string context; + + /// + /// Returns the application context that was originally passed + /// to the sign-in request, if any. + /// + public string Context { get { return context; } } + + /// + /// Sets the the Application context. + /// + /// + private void setContext(string context) + { + this.context = context; + } + + string token; + + /// + /// Returns the encrypted Web Authentication token containing + /// the UID. This can be cached in a cookie and the UID can be + /// retrieved by calling the ProcessToken method. + /// + public string Token { get { return token; } } + + /// + /// Sets the the User token. + /// + /// + private void setToken(string token) + { + this.token = token; + } + } + + /// + /// Processes the sign-in response from the Windows Live Login server. + /// + /// + /// Contains the preprocessed POST query + /// such as that returned by HttpRequest.Form + /// + /// The method returns a User object on successful + /// sign-in; otherwise null. + public User ProcessLogin(NameValueCollection query) + { + if (query == null) + { + debug("Error: ProcessLogin: Invalid query."); + return null; + } + + string action = query["action"]; + + if (action != "login") + { + debug("Warning: ProcessLogin: query action ignored: " + action); + return null; + } + + string token = query["stoken"]; + string context = query["appctx"]; + + if (context != null) + { + context = HttpUtility.UrlDecode(context); + } + + return ProcessToken(token, context); + } + + /// + /// Decodes and validates a Web Authentication token. Returns a User + /// object on success. + /// + public User ProcessToken(string token) + { + return ProcessToken(token, null); + } + + /// + /// Decodes and validates a Web Authentication token. Returns a User + /// object on success. If a context is passed in, it will be + /// returned as the context field in the User object. + /// + /// Web Authentication token + /// If you specify it, will be returned as-is in the sign-in + /// response for site-specific use. + /// User object + public User ProcessToken(string token, string context) + { + if (string.IsNullOrEmpty(token)) + { + debug("Error: ProcessToken: Invalid token."); + return null; + } + + string stoken = DecodeAndValidateToken(token); + + if (string.IsNullOrEmpty(stoken)) + { + debug("Error: ProcessToken: Failed to decode/validate token: " + + token); + return null; + } + + NameValueCollection parsedToken = parse(stoken); + if (parsedToken == null || parsedToken.Count < 3) + { + debug("Error: ProcessToken: Failed to parse token after decoding: " + + token); + return null; + } + + string appId = parsedToken["appid"]; + if (appId != AppId) + { + debug("Error: ProcessToken: Application ID in token did not match ours: " + + appId + ", " + AppId); + return null; + } + + User user = null; + try + { + user = new User(parsedToken["ts"], + parsedToken["uid"], + parsedToken["flags"], + context, token); + } + catch (Exception e) + { + debug("Error: ProcessToken: Contents of token considered invalid: " + e); + } + return user; + } + + /// + /// Returns an appropriate content type and body + /// response that the application handler can return to + /// signify a successful sign-out from the application. + /// + /// When a user signs out of Windows Live or a Windows Live + /// application, a best-effort attempt is made to sign the user out + /// from all other Windows Live applications the user might be signed + /// in to. This is done by calling the handler page for each + /// application with 'action' parameter set to 'clearcookie' in the query + /// string. The application handler is then responsible for clearing + /// any cookies or data associated with the sign-in. After successfully + /// signing the user out, the handler should return a GIF (any + /// GIF) as response to the action=clearcookie query. + /// + public void GetClearCookieResponse(out string type, out byte[] content) + { + const string gif = + "R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAEALAAAAAABAAEAAAIBTAA7"; + type = "image/gif"; + content = Convert.FromBase64String(gif); + } + + /* Methods for Delegated Authentication support. */ + + /// + /// Returns the consent URL to use for Delegated Authentication for + /// the given comma-delimited list of offers. + /// + /// Comma-delimited list of offers. + /// Consent URL + public string GetConsentUrl(string offers) + { + return GetConsentUrl(offers, null); + } + + /// + /// Returns the consent URL to use for Delegated Authentication for + /// the given comma-delimited list of offers. + /// + /// Comma-delimited list of offers. + /// If you specify it, will be returned as-is in the consent + /// response for site-specific use. + /// Consent URL + public string GetConsentUrl(string offers, string context) + { + return GetConsentUrl(offers, context, null); + } + + /// + /// Returns the consent URL to use for Delegated Authentication for + /// the given comma-delimited list of offers. + /// + /// Comma-delimited list of offers. + /// If you specify it, will be returned as-is in the consent + /// response for site-specific use. + /// The registered/configured return URL will be + /// overridden by 'ru' specified here. + /// Consent URL + public string GetConsentUrl(string offers, string context, string ru) + { + return GetConsentUrl(offers, context, ru, null); + } + + /// + /// Returns the consent URL to use for Delegated Authentication for + /// the given comma-delimited list of offers. + /// + /// Comma-delimited list of offers. + /// If you specify it, will be returned as-is in the sign-in + /// response for site-specific use. + /// The registered/configured return URL will be + /// overridden by 'ru' specified here. + /// The language in which the consent page is + /// displayed is configured by culture ID (For example, 'fr-fr' or + /// 'en-us') specified in the 'market' parameter. + /// Consent URL + public string GetConsentUrl(string offers, string context, string ru, string market) + { + if (string.IsNullOrEmpty(offers)) + { + throw new ArgumentException("Error: GetConsentUrl: Invalid offers list."); + } + + offers = "?ps=" + HttpUtility.UrlEncode(offers); + + context = string.IsNullOrEmpty(context) ? + string.Empty : "&appctx=" + HttpUtility.UrlEncode(context); + + if (string.IsNullOrEmpty(ru)) + { + ru = ReturnUrl; + } + + ru = string.IsNullOrEmpty(ru) ? + string.Empty : "&ru=" + HttpUtility.UrlEncode(ru); + + market = string.IsNullOrEmpty(market) ? + string.Empty : "&mkt=" + HttpUtility.UrlEncode(market); + + string pu = string.Empty; + + if (!string.IsNullOrEmpty(PolicyUrl)) + { + pu = "&pl=" + HttpUtility.UrlEncode(PolicyUrl); + } + + string app = string.Empty; + + if (!ForceDelAuthNonProvisioned) + { + app = "&app=" + GetAppVerifier(); + } + + return (ConsentUrl + "Delegation.aspx" + offers + context + ru + pu + market + app); + } + + /// + /// Returns the URL to use to download a new consent token, given the + /// offers and refresh token. + /// + /// Comma-delimited list of offers. + /// Refresh token. + /// Refresh consent token URL + public string GetRefreshConsentTokenUrl(string offers, string refreshToken) + { + return GetRefreshConsentTokenUrl(offers, refreshToken, null); + } + + /// + /// Returns the URL to use to download a new consent token, given the + /// offers and refresh token. + /// + /// Comma-delimited list of offers. + /// Refresh token. + /// Refresh consent token URL + /// The registered/configured return URL will be + /// overridden by 'ru' specified here. + /// Refresh consent token URL + public string GetRefreshConsentTokenUrl(string offers, string refreshToken, string ru) + { + if (string.IsNullOrEmpty(offers)) + { + throw new ArgumentException("Error: GetRefreshConsentTokenUrl: Invalid offers list."); + } + + offers = "?ps=" + HttpUtility.UrlEncode(offers); + + if (string.IsNullOrEmpty(refreshToken)) + { + throw new ArgumentException("Error: GetRefreshConsentTokenUrl: Invalid refresh token."); + } + + refreshToken = "&reft=" + refreshToken; + + if (string.IsNullOrEmpty(ru)) + { + ru = ReturnUrl; + } + + ru = string.IsNullOrEmpty(ru) ? + string.Empty : "&ru=" + HttpUtility.UrlEncode(ru); + + string app = string.Empty; + + if (!ForceDelAuthNonProvisioned) + { + app = "&app=" + GetAppVerifier(); + } + + return ConsentUrl + "RefreshToken.aspx" + offers + refreshToken + ru + app; + } + + /// + /// Returns the URL for the consent-management user interface. + /// + /// Manage consent URL + public string GetManageConsentUrl() + { + return GetManageConsentUrl(null); + } + + /// + /// Returns the URL for the consent-management user interface. + /// + /// The language in which the consent page is + /// displayed is configured by culture ID (For example, 'fr-fr' or + /// 'en-us') specified in the 'market' parameter. + /// Manage consent URL + public string GetManageConsentUrl(string market) + { + market = string.IsNullOrEmpty(market) ? + string.Empty : "?mkt=" + HttpUtility.UrlEncode(market); + + return ConsentUrl + "ManageConsent.aspx" + market; + } + + /// + /// Holds the Consent Token object corresponding to consent granted. + /// + public class ConsentToken + { + WindowsLiveLogin wll; + + /// + /// Initialize the ConsentToken. + /// + /// WindowsLiveLogin + /// Delegation token + /// Refresh token + /// Session key + /// Expiry + /// Offers + /// Location ID + /// Application context + /// Decoded token + /// Raw token + public ConsentToken(WindowsLiveLogin wll, string delegationToken, string refreshToken, string sessionKey, string expiry, string offers, string locationID, string context, string decodedToken, string token) + { + this.wll = wll; + setDelegationToken(delegationToken); + setRefreshToken(refreshToken); + setSessionKey(sessionKey); + setExpiry(expiry); + setOffers(offers); + setLocationID(locationID); + setContext(context); + setDecodedToken(decodedToken); + setToken(token); + } + + string delegationToken; + + /// + /// Gets the Delegation token. + /// + public string DelegationToken { get { return delegationToken; } } + + /// + /// Sets the Delegation token. + /// + /// Delegation token + private void setDelegationToken(string delegationToken) + { + if (string.IsNullOrEmpty(delegationToken)) + { + throw new ArgumentException("Error: ConsentToken: Null delegation token."); + } + + this.delegationToken = delegationToken; + } + + string refreshToken; + + /// + /// Gets the refresh token. + /// + public string RefreshToken { get { return refreshToken; } } + + /// + /// Sets the refresh token. + /// + /// Refresh token + private void setRefreshToken(string refreshToken) + { + this.refreshToken = refreshToken; + } + + byte[] sessionKey; + + /// + /// Gets the session key. + /// + public byte[] SessionKey { get { return sessionKey; } } + + /// + /// Sets the session key. + /// + /// Session key + private void setSessionKey(string sessionKey) + { + if (string.IsNullOrEmpty(sessionKey)) + { + throw new ArgumentException("Error: ConsentToken: Null session key."); + } + + this.sessionKey = WindowsLiveLogin.u64(sessionKey); + } + + DateTime expiry; + + /// + /// Gets the expiry time of delegation token. + /// + public DateTime Expiry { get { return expiry; } } + + /// + /// Sets the expiry time of delegation token. + /// + /// Expiry time + private void setExpiry(string expiry) + { + if (string.IsNullOrEmpty(expiry)) + { + throw new ArgumentException("Error: ConsentToken: Null expiry time."); + } + + int expiryInt; + + try + { + expiryInt = Convert.ToInt32(expiry); + } + catch (Exception) + { + throw new ArgumentException("Error: Consent: Invalid expiry time: " + + expiry); + } + + DateTime refTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + this.expiry = refTime.AddSeconds(expiryInt); + } + + IList offers; + + /// + /// Gets the list of offers/actions for which the user granted consent. + /// + public IList Offers { get { return offers; } } + + string offersString; + + /// + /// Gets the string representation of all the offers/actions for which + /// the user granted consent. + /// + public String OffersString { get { return offersString; } } + + /// + /// Sets the offers/actions for which user granted consent. + /// + /// Comma-delimited list of offers + private void setOffers(string offers) + { + if (string.IsNullOrEmpty(offers)) + { + throw new ArgumentException("Error: ConsentToken: Null offers."); + } + + offers = HttpUtility.UrlDecode(offers); + + this.offersString = string.Empty; + this.offers = new ArrayList(); + + string[] offersList = offers.Split(new Char[] { ';' }); + + foreach (string offer in offersList) + { + if (!(this.offersString == string.Empty)) + { + this.offersString += ","; + } + + int separator = offer.IndexOf(':'); + if (separator == -1) + { + debug("Warning: ConsentToken: offer may be invalid: " + offer); + this.offers.Add(offer); + this.offersString += offer; + } + else + { + string o = offer.Substring(0, separator); + this.offers.Add(o); + this.offersString += o; + } + } + } + + string locationID; + + /// + /// Gets the location ID. + /// + public string LocationID { get { return locationID; } } + + /// + /// Sets the location ID. + /// + /// Location ID + private void setLocationID(string locationID) + { + this.locationID = locationID; + } + + string context; + + /// + /// Returns the application context that was originally passed + /// to the consent request, if any. + /// + public string Context { get { return context; } } + + /// + /// Sets the application context. + /// + /// Application context + private void setContext(string context) + { + this.context = context; + } + + string decodedToken; + + /// + /// Gets the decoded token. + /// + public string DecodedToken { get { return decodedToken; } } + + /// + /// Sets the decoded token. + /// + /// Decoded token + private void setDecodedToken(string decodedToken) + { + this.decodedToken = decodedToken; + } + + string token; + + /// + /// Gets the raw token. + /// + public string Token { get { return token; } } + + /// + /// Sets the raw token. + /// + /// Raw token + private void setToken(string token) + { + this.token = token; + } + + /// + /// Indicates whether the delegation token is set and has not expired. + /// + /// + public bool IsValid() + { + if (string.IsNullOrEmpty(DelegationToken)) + { + return false; + } + + if (DateTime.UtcNow.AddSeconds(-300) > Expiry) + { + return false; + } + + return true; + } + + /// + /// Attempt to refresh the current token and replace it. If operation succeeds + /// true is returned to signify success. + /// + /// + public bool Refresh() + { + ConsentToken ct = wll.RefreshConsentToken(this); + + if (ct == null) + { + return false; + } + + copy(ct); + + return true; + } + + /// + /// Makes a copy of the ConsentToken object. + /// + /// + void copy(ConsentToken consentToken) + { + this.delegationToken = consentToken.delegationToken; + this.refreshToken = consentToken.refreshToken; + this.sessionKey = consentToken.sessionKey; + this.expiry = consentToken.expiry; + this.offers = consentToken.offers; + this.locationID = consentToken.locationID; + this.offersString = consentToken.offersString; + this.decodedToken = consentToken.decodedToken; + this.token = consentToken.token; + } + } + + /// + /// Processes the POST response from the Delegated Authentication + /// service after a user has granted consent. The processConsent + /// function extracts the consent token string and returns the result + /// of invoking the processConsentToken method. + /// + /// Response from the Delegated Authentication service. + /// ConsentToken + public ConsentToken ProcessConsent(NameValueCollection query) + { + if (query == null) + { + debug("Error: ProcessConsent: Invalid query."); + return null; + } + + string action = query["action"]; + + if (action != "delauth") + { + debug("Warning: ProcessConsent: query action ignored: " + action); + return null; + } + + if (query["ResponseCode"] != "RequestApproved") + { + debug("Error: ProcessConsent: Consent was not successfully granted: " + + query["ResponseCode"]); + return null; + } + + string token = query["ConsentToken"]; + string context = query["appctx"]; + + if (!string.IsNullOrEmpty(context)) + { + context = HttpUtility.UrlDecode(context); + } + + return ProcessConsentToken(token, context); + } + + /// + /// Processes the consent token string that is returned in the POST + /// response by the Delegated Authentication service after a + /// user has granted consent. + /// + /// Raw token. + /// ConsentToken + public ConsentToken ProcessConsentToken(string token) + { + return ProcessConsentToken(token, null); + } + + /// + /// Processes the consent token string that is returned in the POST + /// response by the Delegated Authentication service after a + /// user has granted consent. + /// + /// Raw token. + /// If you specify it, will be returned as-is in the sign-in + /// response for site-specific use. + /// + public ConsentToken ProcessConsentToken(string token, string context) + { + string decodedToken = token; + + if (string.IsNullOrEmpty(token)) + { + debug("Error: ProcessConsentToken: Null token."); + return null; + } + + NameValueCollection parsedToken = + parse(HttpUtility.UrlDecode(token)); + + if (!string.IsNullOrEmpty(parsedToken["eact"])) + { + decodedToken = DecodeAndValidateToken(parsedToken["eact"]); + if (string.IsNullOrEmpty(decodedToken)) + { + debug("Error: ProcessConsentToken: Failed to decode/validate token: " + + token); + return null; + } + + parsedToken = parse(decodedToken); + decodedToken = HttpUtility.UrlEncode(decodedToken); + } + + ConsentToken consentToken = null; + try + { + consentToken = new ConsentToken(this, + parsedToken["delt"], + parsedToken["reft"], + parsedToken["skey"], + parsedToken["exp"], + parsedToken["offer"], + parsedToken["lid"], + context, decodedToken, + token); + } + catch (Exception e) + { + debug("Error: ProcessConsentToken: Contents of token considered invalid: " + e); + } + + return consentToken; + } + + /// + /// Attempts to obtain a new, refreshed token and return it. The + /// original token is not modified. + /// + /// ConsentToken object. + /// Refreshed ConsentToken object. + public ConsentToken RefreshConsentToken(ConsentToken token) + { + return RefreshConsentToken(token, null); + } + + /// + /// Attempts to obtain a new, refreshed token and return it. The + /// original token is not modified. + /// + /// ConsentToken object. + /// The registered/configured return URL will be + /// overridden by 'ru' specified here. + /// Refreshed ConsentToken object. + public ConsentToken RefreshConsentToken(ConsentToken token, string ru) + { + if (token == null) + { + debug("Error: RefreshConsentToken: Null consent token."); + return null; + } + + return RefreshConsentToken(token.OffersString, token.RefreshToken, ru); + } + + /// + /// Attempts to obtain a new, refreshed token and return it using + /// the offers and refresh token. The original token is not modified. + /// + /// Comma-delimited list of offers. + /// Refresh token. + /// Refreshed ConsentToken object. + public ConsentToken RefreshConsentToken(string offers, string refreshToken) + { + return RefreshConsentToken(offers, refreshToken, null); + } + + /// + /// Attempts to obtain a new, refreshed token and return it using + /// the offers and refresh token. The original token is not modified. + /// + /// Comma-delimited list of offers. + /// Refresh token. + /// The registered/configured return URL will be + /// overridden by 'ru' specified here. + /// Refreshed ConsentToken object. + public ConsentToken RefreshConsentToken(string offers, string refreshToken, string ru) + { + string url = null; + + try + { + url = GetRefreshConsentTokenUrl(offers, refreshToken, ru); + } + catch (Exception e) + { + debug("Error: Failed to construct refresh consent token URL: " + e); + return null; + } + + if (string.IsNullOrEmpty(url)) + { + debug("Error: Failed to construct refresh consent token URL."); + return null; + } + + string body = fetch(url); + + if (string.IsNullOrEmpty(body)) + { + debug("Error: RefreshConsentToken: Failed to download token."); + return null; + } + + Regex re = new Regex("{\"ConsentToken\":\"(.*)\"}"); + GroupCollection gc = re.Match(body).Groups; + + if (gc.Count != 2) + { + debug("Error: RefreshConsentToken: Failed to extract token: " + body); + return null; + } + + CaptureCollection cc = gc[1].Captures; + + if (cc.Count != 1) + { + debug("Error: RefreshConsentToken: Failed to extract token: " + body); + return null; + } + + return ProcessConsentToken(cc[0].ToString()); + } + + /* Common methods. */ + + /// + /// Decodes and validates the raw token. + /// + /// + /// + public string DecodeAndValidateToken(string token) + { + bool haveOldSecret = false; + + if ((oldSecretExpiry != null) && (DateTime.UtcNow < oldSecretExpiry)) + { + if ((oldCryptKey != null) && (oldSignKey != null)) + { + haveOldSecret = true; + } + } + + string stoken = DecodeAndValidateToken(token, cryptKey, signKey); + + if (string.IsNullOrEmpty(stoken)) + { + if (haveOldSecret) + { + debug("Warning: Failed to validate token with current secret, attempting old secret."); + return DecodeAndValidateToken(token, oldCryptKey, oldSignKey); + } + } + + return stoken; + } + + /// + /// Decodes and validates the raw token with appropriate crypt key + /// and sign key. + /// + /// Raw token. + /// Crypt key. + /// Sign key. + /// + public string DecodeAndValidateToken(string token, byte[] cryptKey, byte[] signKey) + { + string stoken = DecodeToken(token, cryptKey); + + if (!string.IsNullOrEmpty(stoken)) + { + stoken = ValidateToken(stoken, signKey); + } + + return stoken; + } + + /// + /// Decode the given token. Returns null on failure. + /// + /// + /// + /// First, the string is URL unescaped and base64 + /// decoded. + /// Second, the IV is extracted from the first 16 bytes + /// of the string. + /// Finally, the string is decrypted by using the + /// encryption key. + /// + /// Raw token. + /// Decoded token. + public string DecodeToken(string token) + { + return DecodeToken(token, cryptKey); + } + + /// + /// Decode the given token. Returns null on failure. + /// + /// + /// + /// First, the string is URL unescaped and base64 + /// decoded. + /// Second, the IV is extracted from the first 16 bytes + /// of the string. + /// Finally, the string is decrypted by using the + /// encryption key. + /// + /// Raw token. + /// Crypt key. + /// Decoded token. + public string DecodeToken(string token, byte[] cryptKey) + { + if (cryptKey == null || cryptKey.Length == 0) + { + throw new InvalidOperationException("Error: DecodeToken: Secret key was not set. Aborting."); + } + + if (string.IsNullOrEmpty(token)) + { + debug("Error: DecodeToken: Null token input."); + return null; + } + + const int ivLength = 16; + byte[] ivAndEncryptedValue = u64(token); + + if ((ivAndEncryptedValue == null) || + (ivAndEncryptedValue.Length <= ivLength) || + ((ivAndEncryptedValue.Length % ivLength) != 0)) + { + debug("Error: DecodeToken: Attempted to decode invalid token."); + return null; + } + + Rijndael aesAlg = null; + MemoryStream memStream = null; + CryptoStream cStream = null; + StreamReader sReader = null; + string decodedValue = null; + + try + { + aesAlg = new RijndaelManaged(); + aesAlg.KeySize = 128; + aesAlg.Key = cryptKey; + aesAlg.Padding = PaddingMode.PKCS7; + memStream = new MemoryStream(ivAndEncryptedValue); + byte[] iv = new byte[ivLength]; + memStream.Read(iv, 0, ivLength); + aesAlg.IV = iv; + cStream = new CryptoStream(memStream, aesAlg.CreateDecryptor(), CryptoStreamMode.Read); + sReader = new StreamReader(cStream, Encoding.ASCII); + decodedValue = sReader.ReadToEnd(); + } + catch (Exception e) + { + debug("Error: DecodeToken: Decryption failed: " + e); + return null; + } + finally + { + try + { + if (sReader != null) { sReader.Close(); } + if (cStream != null) { cStream.Close(); } + if (memStream != null) { memStream.Close(); } + if (aesAlg != null) { aesAlg.Clear(); } + } + catch (Exception e) + { + debug("Error: DecodeToken: Failure during resource cleanup: " + e); + } + } + + return decodedValue; + } + + /// + /// Creates a signature for the given string. + /// + public byte[] SignToken(string token) + { + return SignToken(token, signKey); + } + + /// + /// Creates a signature for the given string by using the + /// signature key. + /// + public byte[] SignToken(string token, byte[] signKey) + { + if (signKey == null || signKey.Length == 0) + { + throw new InvalidOperationException("Error: SignToken: Secret key was not set. Aborting."); + } + + if (string.IsNullOrEmpty(token)) + { + debug("Attempted to sign null token."); + return null; + } + + using (HashAlgorithm hashAlg = new HMACSHA256(signKey)) + { + byte[] data = Encoding.Default.GetBytes(token); + byte[] hash = hashAlg.ComputeHash(data); + return hash; + } + } + + /// + /// Extracts the signature from the token and validates it. + /// + /// + /// + public string ValidateToken(string token) + { + return ValidateToken(token, signKey); + } + + /// + /// Extracts the signature from the token and validates it by using the + /// signature key. + /// + public string ValidateToken(string token, byte[] signKey) + { + if (string.IsNullOrEmpty(token)) + { + debug("Error: ValidateToken: Null token."); + return null; + } + + string[] s = { "&sig=" }; + string[] bodyAndSig = token.Split(s, StringSplitOptions.None); + + if (bodyAndSig.Length != 2) + { + debug("Error: ValidateToken: Invalid token: " + token); + return null; + } + + byte[] sig = u64(bodyAndSig[1]); + + if (sig == null) + { + debug("Error: ValidateToken: Could not extract the signature from the token."); + return null; + } + + byte[] sig2 = SignToken(bodyAndSig[0], signKey); + + if (sig2 == null) + { + debug("Error: ValidateToken: Could not generate a signature for the token."); + return null; + } + + if (sig.Length == sig2.Length) + { + for (int i = 0; i < sig.Length; i++) + { + if (sig[i] != sig2[i]) { goto badSig; } + } + + return token; + } + + badSig: + debug("Error: ValidateToken: Signature did not match."); + return null; + } + + /* Implementation of the methods needed to perform Windows Live + application verification as well as trusted sign-in. */ + + /// + /// Generates an Application Verifier token. + /// + public string GetAppVerifier() + { + return GetAppVerifier(null); + } + + /// + /// Generates an Application Verifier token. An IP address + /// can be included in the token. + /// + public string GetAppVerifier(string ip) + { + ip = string.IsNullOrEmpty(ip) ? string.Empty : ("&ip=" + ip); + string token = "appid=" + AppId + "&ts=" + getTimestamp() + ip; + string sig = e64(SignToken(token)); + + if (string.IsNullOrEmpty(sig)) + { + debug("Error: GetAppVerifier: Failed to sign the token."); + return null; + } + + token += "&sig=" + sig; + return HttpUtility.UrlEncode(token); + } + + /// + /// Returns the URL needed to retrieve the application + /// security token. The application security token + /// will be generated for the Windows Live site. + /// + /// JavaScript Output Notation (JSON) output is returned: + /// + /// {"token":"<value>"} + /// + public string GetAppLoginUrl() + { + return GetAppLoginUrl(null, null, false); + } + + /// + /// Returns the URL needed to retrieve the application + /// security token. + /// + /// By default, the application security token will be + /// generated for the Windows Live site; a specific Site ID + /// can optionally be specified in 'siteId'. + /// + /// JSON output is returned: + /// + /// {"token":"<value>"} + /// + public string GetAppLoginUrl(string siteId) + { + return GetAppLoginUrl(siteId, null, false); + } + + /// + /// Returns the URL needed to retrieve the application + /// security token. + /// + /// By default, the application security token will be + /// generated for the Windows Live site; a specific Site ID + /// can optionally be specified in 'siteId'. The IP address + /// can also optionally be included in 'ip'. + /// + /// JSON output is returned: + /// + /// {"token":"<value>"} + /// + public string GetAppLoginUrl(string siteId, string ip) + { + return GetAppLoginUrl(siteId, ip, false); + } + + /// + /// Returns the URL needed to retrieve the application + /// security token. + /// + /// By default, the application security token will be + /// generated for the Windows Live site; a specific Site ID + /// can optionally be specified in 'siteId'. The IP address + /// can also optionally be included in 'ip'. + /// + /// If 'js' is false, then JSON output is returned: + /// + /// {"token":"<value>"} + /// + /// Otherwise, a JavaScript response is returned. It is assumed + /// that WLIDResultCallback is a custom function implemented to + /// handle the token value: + /// + /// WLIDResultCallback("<tokenvalue>"); + /// + public string GetAppLoginUrl(string siteId, string ip, bool js) + { + string algPart = "&alg=" + SecurityAlgorithm; + string sitePart = string.IsNullOrEmpty(siteId) ? + string.Empty : "&id=" + siteId; + string jsPart = (!js) ? string.Empty : "&js=1"; + string url = SecureUrl + "wapplogin.srf?app=" + + GetAppVerifier(ip) + algPart + sitePart + jsPart; + return url; + } + + /// + /// Retrieves the application security token for application + /// verification from the application sign-in URL. The + /// application security token will be generated for the + /// Windows Live site. + /// + public string GetAppSecurityToken() + { + return GetAppSecurityToken(null, null); + } + + /// + /// Retrieves the application security token for application + /// verification from the application sign-in URL. + /// + /// By default, the application security token will be + /// generated for the Windows Live site; a specific Site ID + /// can optionally be specified in 'siteId'. + /// + public string GetAppSecurityToken(string siteId) + { + return GetAppSecurityToken(siteId, null); + } + + /// + /// Retrieves the application security token for application + /// verification from the application sign-in URL. + /// + /// By default, the application security token will be + /// generated for the Windows Live site; a specific Site ID + /// can optionally be specified in 'siteId'. The IP address + /// can also optionally be included in 'ip'. + /// + /// Implementation note: The application security token is + /// downloaded from the application sign-in URL in JSON format + /// {"token":"<value>"}, so we need to extract + /// <value> from the string and return it as seen here. + /// + public string GetAppSecurityToken(string siteId, string ip) + { + string url = GetAppLoginUrl(siteId, ip); + string body = fetch(url); + if (string.IsNullOrEmpty(body)) + { + debug("Error: GetAppSecurityToken: Failed to download token."); + return null; + } + + Regex re = new Regex("{\"token\":\"(.*)\"}"); + GroupCollection gc = re.Match(body).Groups; + + if (gc.Count != 2) + { + debug("Error: GetAppSecurityToken: Failed to extract token: " + body); + return null; + } + + CaptureCollection cc = gc[1].Captures; + + if (cc.Count != 1) + { + debug("Error: GetAppSecurityToken: Failed to extract token: " + body); + return null; + } + + return cc[0].ToString(); + } + + /// + /// Returns a string that can be passed to the GetTrustedParams + /// function as the 'retcode' parameter. If this is specified as + /// the 'retcode', then the app will be used as return URL + /// after it finishes trusted sign-in. + /// + public string GetAppRetCode() + { + return "appid=" + AppId; + } + + /// + /// Returns a table of key-value pairs that must be posted to + /// the sign-in URL for trusted sign-in. Use HTTP POST to do + /// this. Be aware that the values in the table are neither + /// URL nor HTML escaped and may have to be escaped if you are + /// inserting them in code such as an HTML form. + /// + /// The user to be trusted on the local site is passed in as + /// string 'user'. + /// + public NameValueCollection GetTrustedParams(string user) + { + return GetTrustedParams(user, null); + } + + /// + /// Returns a table of key-value pairs that must be posted to + /// the sign-in URL for trusted sign-in. Use HTTP POST to do + /// this. Be aware that the values in the table are neither + /// URL nor HTML escaped and may have to be escaped if you are + /// inserting them in code such as an HTML form. + /// + /// The user to be trusted on the local site is passed in as + /// string 'user'. + /// + /// Optionally, 'retcode' specifies the resource to which + /// successful sign-in is redirected, such as Windows Live Mail, + /// and is typically a string in the format 'id=2000'. If you + /// pass in the value from GetAppRetCode instead, sign-in will + /// be redirected to the application. Otherwise, an HTTP 200 + /// response is returned. + /// + public NameValueCollection GetTrustedParams(string user, string retcode) + { + string token = GetTrustedToken(user); + + if (string.IsNullOrEmpty(token)) { return null; } + + token = "" + token + "uri:WindowsLiveID"; + + NameValueCollection nvc = new NameValueCollection(3); + nvc["wa"] = SecurityAlgorithm; + nvc["wresult"] = token; + + if (retcode != null) + { + nvc["wctx"] = retcode; + } + + return nvc; + } + + /// + /// Returns the trusted sign-in token in the format needed by the + /// trusted sign-in gadget. + /// + /// User to be trusted on the local site is passed in as string + /// 'user'. + /// + public string GetTrustedToken(string user) + { + if (string.IsNullOrEmpty(user)) + { + debug("Error: GetTrustedToken: Invalid user specified."); + return null; + } + + string token = "appid=" + AppId + "&uid=" + + HttpUtility.UrlEncode(user) + "&ts=" + getTimestamp(); + string sig = e64(SignToken(token)); + + if (string.IsNullOrEmpty(sig)) + { + debug("Error: GetTrustedToken: Failed to sign the token."); + return null; + } + + token += "&sig=" + sig; + return HttpUtility.UrlEncode(token); + } + + /// + /// Returns the trusted sign-in URL to use for the Windows Live + /// Login server. + /// + public string GetTrustedLoginUrl() + { + return SecureUrl + "wlogin.srf"; + } + + /// + /// Returns the trusted sign-out URL to use for the Windows Live + /// Login server. + /// + public string GetTrustedLogoutUrl() + { + return SecureUrl + "logout.srf?appid=" + AppId; + } + + /* Helper methods */ + + /// + /// Function to parse the settings file. + /// + /// + /// + static NameValueCollection parseSettings(string settingsFile) + { + if (string.IsNullOrEmpty(settingsFile)) + { + throw new ArgumentNullException("settingsFile"); + } + + // Throws an exception on any failure. + XmlDocument xd = new XmlDocument(); + xd.Load(settingsFile); + + XmlNode topNode = xd.SelectSingleNode("//windowslivelogin"); + + if (topNode == null) + { + throw new XmlException("Error: parseSettings: Failed to parse settings file: " + settingsFile); + } + + NameValueCollection settings = new NameValueCollection(); + IEnumerator children = topNode.GetEnumerator(); + + while (children.MoveNext()) + { + XmlNode child = (XmlNode)children.Current; + settings[child.Name] = child.InnerText; + } + + return settings; + } + + /// + /// Derives the key, given the secret key and prefix as described in the + /// Web Authentication SDK documentation. + /// + static byte[] derive(string secret, string prefix) + { + using (HashAlgorithm hashAlg = HashAlgorithm.Create("SHA256")) + { + const int keyLength = 16; + byte[] data = Encoding.Default.GetBytes(prefix + secret); + byte[] hashOutput = hashAlg.ComputeHash(data); + byte[] byteKey = new byte[keyLength]; + Array.Copy(hashOutput, byteKey, keyLength); + return byteKey; + } + } + + /// + /// Parses query string and return a table representation of + /// the key and value pairs. Similar to + /// HttpUtility.ParseQueryString, except that no URL decoding + /// is done and only the last value is considered in the case + /// of multiple values with one key. + /// + static NameValueCollection parse(string input) + { + if (string.IsNullOrEmpty(input)) + { + debug("Error: parse: Null input."); + return null; + } + + NameValueCollection pairs = new NameValueCollection(); + + string[] kvs = input.Split(new Char[] { '&' }); + foreach (string kv in kvs) + { + int separator = kv.IndexOf('='); + + if ((separator == -1) || (separator == kv.Length)) + { + debug("Warning: parse: Ignoring pair: " + kv); + continue; + } + + pairs[kv.Substring(0, separator)] = kv.Substring(separator + 1); + } + + return pairs; + } + + /// + /// Generates a timestamp suitable for the application + /// verifier token. + /// + static string getTimestamp() + { + DateTime refTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + TimeSpan ts = DateTime.UtcNow - refTime; + return ((uint)ts.TotalSeconds).ToString(); + } + + /// + /// Base64-encodes and URL-escapes a byte array. + /// + static string e64(byte[] b) + { + string s = null; + if (b == null) { return s; } + + try + { + s = Convert.ToBase64String(b); + s = HttpUtility.UrlEncode(s); + } + catch (Exception e) + { + debug("Error: e64: Base64 conversion error: " + e); + } + + return s; + } + + /// + /// URL-unescapes and Base64-decodes a string. + /// + static byte[] u64(string s) + { + byte[] b = null; + if (s == null) { return b; } + s = HttpUtility.UrlDecode(s); + + try + { + b = Convert.FromBase64String(s); + } + catch (Exception e) + { + debug("Error: u64: Base64 conversion error: " + s + ", " + e); + } + return b; + } + + /// + /// Fetches the contents given a URL. + /// + static string fetch(string url) + { + string body = null; + try + { + WebRequest req = HttpWebRequest.Create(url); + req.Method = "GET"; + WebResponse res = req.GetResponse(); + using (StreamReader sr = new StreamReader(res.GetResponseStream(), Encoding.UTF8)) + { + body = sr.ReadToEnd(); + } + } + catch (Exception e) + { + debug("Error: fetch: Failed to get the document: " + url + + ", " + e); + } + return body; + } + } +} diff --git a/Code/Channels/Hotmail/Resources/icon-10.png b/Code/Channels/Hotmail/Resources/icon-10.png new file mode 100644 index 0000000..69f05bf Binary files /dev/null and b/Code/Channels/Hotmail/Resources/icon-10.png differ diff --git a/Code/Channels/Hotmail/Resources/icon-13.png b/Code/Channels/Hotmail/Resources/icon-13.png new file mode 100644 index 0000000..e4e35bb Binary files /dev/null and b/Code/Channels/Hotmail/Resources/icon-13.png differ diff --git a/Code/Channels/Hotmail/Resources/icon-64.png b/Code/Channels/Hotmail/Resources/icon-64.png new file mode 100644 index 0000000..3c67df5 Binary files /dev/null and b/Code/Channels/Hotmail/Resources/icon-64.png differ diff --git a/Code/Channels/Hyves/HyvesApiRequest.cs b/Code/Channels/Hyves/HyvesApiRequest.cs new file mode 100644 index 0000000..7175613 --- /dev/null +++ b/Code/Channels/Hyves/HyvesApiRequest.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using System.Xml.Linq; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Framework.OAuth; + +namespace Inbox2.Channels.Hyves +{ + public static class HyvesApiRequest + { + public const string AllMethods = "cities.get,countries.get,blogs.create,blogs.createRespect,blogs.get,blogs.getByTag,blogs.getByUser,blogs.getComments,blogs.getForFriends,blogs.getRespects,fancylayout.parse,friends.get,friends.getDistance,friends.getIncomingInvitations,friends.getOutgoingInvitations,gadgets.get,gadgets.getByUser,gadgets.create,gadgets.createRespect,gadgets.getComments,gadgets.getRespects,listeners.create,listeners.delete,listeners.get,listeners.getAll,listeners.getByType,media.get,media.getAlbums,media.getByAlbum,media.getByTag,media.getComments,media.getRespects,media.createRespect,pings.get,pings.getByTargetUser,pings.getByUser,regions.get,tips.createRespect,tips.get,tips.getByUser,tips.getCategories,tips.getComments,tips.getForFriends,tips.getRespects,users.get,users.getByUsername,users.getLoggedin,users.getRespects,users.getScraps,users.getTestimonials,users.search,users.searchInFriends,users.createRespect,wwws.get,wwws.getByUser,wwws.getForFriends,wwws.create,messages.getUnreadCount,messages.delete,messages.get,messages.getInbox,messages.setRead,messages.send"; + + public static XElement PerformRequest(Uri uri) + { + return PerformRequest(uri, null, null); + } + + public static XElement PerformRequest(Uri uri, string token, string tokenSecret) + { + string data = OAuthUriBuilder.Build(uri, + "/Settings/Channels/Hyves/ApiKey".AsKey("MTY3NV_uGz3T0QPqZ8hPKCI5Ep5m"), + "/Settings/Channels/Hyves/ApiSecret".AsKey("MTY3NV_y9u4XHMH0d2jFzT0eN6tX"), + token, + tokenSecret); + + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri("http://data.hyves-api.nl/")); + request.Method = "POST"; + request.ContentType = "application/x-www-form-urlencoded"; + request.UserAgent = "inbox2"; + + byte[] bytes = Encoding.UTF8.GetBytes(data); + request.ContentLength = bytes.Length; + + // Write post data to request stream + using (Stream requestStream = request.GetRequestStream()) + requestStream.Write(bytes, 0, bytes.Length); + + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + return XElement.Parse(response.GetResponseStream().ReadString()); + } + } +} diff --git a/Code/Channels/Hyves/HyvesClientChannel.cs b/Code/Channels/Hyves/HyvesClientChannel.cs new file mode 100644 index 0000000..4ba8ee9 --- /dev/null +++ b/Code/Channels/Hyves/HyvesClientChannel.cs @@ -0,0 +1,273 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Extensions; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Channels.Web; + +namespace Inbox2.Channels.Hyves +{ + public class HyvesClientChannel : IClientInputChannel, IClientOutputChannel, IClientContactsChannel + { + private string authToken; + private string authSecret; + + #region Properties + + public IChannelCredentialsProvider CredentialsProvider { get; set; } + + public string Hostname + { + get { return "http://data.hyves-api.nl/"; } + set { } + } + + public int Port + { + get { return 80; } + set { } + } + + public bool IsSecured + { + get { return true; } + set { } + } + + public int MaxConcurrentConnections + { + get { return 2; } + set { } + } + + public bool IsEnabled { get; set; } + + public string Protocol + { + get { return "Hyves API"; } + } + + public string SourceAdress + { + get { return CredentialsProvider.GetCredentials().Claim; } + } + + public string AuthMessage { get; private set; } + + #endregion + + public ConnectResult Connect() + { + authToken = ChannelContext.Current.ClientContext.GetSetting("/Channels/Hyves/AuthToken").ToString(); + authSecret = ChannelContext.Current.ClientContext.GetSetting("/Channels/Hyves/AuthSecret").ToString(); + + if (!String.IsNullOrEmpty(authToken) && !String.IsNullOrEmpty(authSecret)) + return ConnectResult.Success; + + return CredentialsProvider.ValidateCredentials(); + } + + public IEnumerable GetFolders() + { + yield return new ChannelFolder("inbox", "inbox", ChannelFolderType.Inbox); + } + + public void SelectFolder(ChannelFolder folder) + { + } + + public IEnumerable GetHeaders() + { + var messages = + PerformRequest("http://data.hyves-api.nl/?ha_method=messages.getInbox&messagetype=member_to_member&ha_version=experimental&ha_format=xml&ha_fancylayout=true&ha_resultsperpage=50"); + + foreach (var message in messages.Elements("message")) + { + yield return ParseHeader(message); + } + } + + public IEnumerable GetMessage(ChannelMessageHeader header) + { + ChannelMessage message = new ChannelMessage(); + message.MessageNumber = header.MessageNumber; + message.MessageIdentifier = header.MessageIdentifier; + message.Context = header.Context; + message.From = header.From; + message.To.AddRange(header.To); + message.InReplyTo = header.InReplyTo; + message.BodyHtml = header.Body.ToStream(); + message.DateReceived = header.DateReceived; + + yield return message; + } + + public IEnumerable GetContacts() + { + var friends = + PerformRequest("http://data.hyves-api.nl/?ha_method=friends.get&ha_version=experimental&ha_format=xml&ha_fancylayout=true"); + + List friendsList = friends.Elements("userid").Select(e => e.Value).ToList(); + + // Retrieve friends per 10 at a time + for (int i = 0; i < friendsList.Count; i += 10) + { + // Creates lists like id1,id2,id3, etc + var ids = String.Join(",", friendsList.Skip(i).Take(10).ToArray()); + + var friend = + PerformRequest( + String.Format("http://data.hyves-api.nl/?userid={0}&ha_responsefields=profilepicture,cityname,countryname&ha_method=users.get&ha_version=experimental&ha_format=xml&ha_fancylayout=true", ids)); + + foreach (var element in friend.Elements("user")) + { + yield return ParseContact(element); + } + } + } + + IClientContactsChannel IClientContactsChannel.Clone() + { + return new HyvesClientChannel + { + Hostname = Hostname, + Port = Port, + IsSecured = IsSecured, + MaxConcurrentConnections = MaxConcurrentConnections, + CredentialsProvider = CredentialsProvider + }; + } + + public void Send(ChannelMessage message) + { + foreach (var rcpt in message.To.Union(message.CC).Union(message.BCC)) + { + PerformRequest( + String.Format("http://data.hyves-api.nl/?title={0}&body={1}&target_userid={2}&ha_method=messages.send&ha_version=experimental&ha_format=xml&ha_fancylayout=true", + message.Context, + message.BodyHtml.ReadString().StripHtml(), + rcpt.Address)); + } + } + + public bool Disconnect() + { + return true; + } + + public IClientInputChannel Clone() + { + HyvesClientChannel channel = new HyvesClientChannel(); + channel.Hostname = Hostname; + channel.Port = Port; + channel.IsSecured = IsSecured; + channel.MaxConcurrentConnections = MaxConcurrentConnections; + channel.CredentialsProvider = CredentialsProvider; + + return channel; + } + + ChannelContact ParseContact(XElement source) + { + ChannelContact contact = new ChannelContact(); + + contact.Person.Firstname = source.Element("firstname").Value; + contact.Person.Lastname = source.Element("lastname").Value; + contact.Person.Gender = source.Element("gender").Value; + + contact.Profile.ScreenName = contact.Person.Name; + contact.Profile.ChannelProfileKey = source.Element("userid").Value; + contact.Profile.ProfileType = ProfileType.Social; + contact.Profile.Url = source.Element("url").Value; + contact.Profile.SourceAddress = + new SourceAddress(source.Element("userid").Value, contact.Person.Name); + + if (source.Element("cityname") != null) + contact.Profile.City = source.Element("cityname").Value; + + if (source.Element("countryname") != null) + contact.Profile.Country = source.Element("countryname").Value; + + if (source.Element("countryname") != null) + contact.Profile.Country = source.Element("countryname").Value; + + if (source.Element("birthday") != null && + !(String.IsNullOrEmpty(source.Element("birthday").Element("year").Value)) && + !(String.IsNullOrEmpty(source.Element("birthday").Element("month").Value)) && + !(String.IsNullOrEmpty(source.Element("birthday").Element("day").Value))) + { + contact.Person.DateOfBirth = new DateTime( + Int32.Parse(source.Element("birthday").Element("year").Value), + Int32.Parse(source.Element("birthday").Element("month").Value), + Int32.Parse(source.Element("birthday").Element("day").Value) + ); + } + + if (source.Element("profilepicture") != null) + { + string url = source.Element("profilepicture").Element("icon_extralarge").Element("src").Value; + + ChannelAvatar avatar = new ChannelAvatar(); + avatar.Url = url; + avatar.ContentStream = WebContentStreamHelper.GetContentStream(avatar.Url); + + contact.Profile.ChannelAvatar = avatar; + } + + return contact; + } + + ChannelMessageHeader ParseHeader(XElement source) + { + ChannelMessageHeader header = new ChannelMessageHeader(); + header.Context = source.Element("title").Value; + header.MessageNumber = source.Element("messageid").Value; + header.MessageIdentifier = source.Element("messageid").Value; + + string sourceid = source.Element("userid").Value; + string targetid = source.Element("target_userid").Value; + + var recipients = + PerformRequest( + String.Format("http://data.hyves-api.nl/?userid={0}&ha_responsefields=profilepicture,cityname,countryname&ha_method=users.get&ha_version=experimental&ha_format=xml&ha_fancylayout=true", String.Join(",", new[] { sourceid, targetid}))); + + var from = ParseContact(recipients.Elements("user").First(u => u.Element("userid").Value == sourceid)); + var to = ParseContact(recipients.Elements("user").First(u => u.Element("userid").Value == targetid)); + + header.From = new SourceAddress(from.Profile.ChannelProfileKey, from.Profile.ScreenName); + header.To.Add(new SourceAddress(to.Profile.ChannelProfileKey, to.Profile.ScreenName)); + + string bodyType = source.Element("format").Value; + + if (bodyType == "html") + { + // For some weird reason, hyves sometimes sends htmlBody and sometimes htmlbody (lowercase b) + var elem = source.Element("htmlBody") ?? source.Element("htmlbody"); + + header.Body = elem.Value; + } + else + header.Body = source.Element("body").Value; + + header.DateReceived = Int64.Parse(source.Element("created").Value).ToUnixTime(); + + return header; + } + + internal static XElement PerformRequest(string requestUri) + { + var authorizedToken = ChannelContext.Current.ClientContext.GetSetting("/Channels/Hyves/AuthToken").ToString(); + var authorizedSecret = ChannelContext.Current.ClientContext.GetSetting("/Channels/Hyves/AuthSecret").ToString(); + + return HyvesApiRequest.PerformRequest(new Uri(requestUri), authorizedToken, authorizedSecret); + } + + public void Dispose() + { + + } + } +} diff --git a/Code/Channels/Hyves/HyvesConfiguration.cs b/Code/Channels/Hyves/HyvesConfiguration.cs new file mode 100644 index 0000000..02c36dd --- /dev/null +++ b/Code/Channels/Hyves/HyvesConfiguration.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Linq; +using System.Text; +using System.Xml.Serialization; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Interfaces.Enumerations; + +namespace Inbox2.Channels.Hyves +{ + [Export(typeof(ChannelConfiguration))] + [Serializable] + public class HyvesConfiguration : ChannelConfiguration + { + public HyvesConfiguration() + { + InnerInputChannel = new Channel { Type = typeof(HyvesClientChannel), Port = 80, IsSecured = false, MaxConcurrentConnections = 1 }; + InnerOutputChannel = new Channel { Type = typeof(HyvesClientChannel), Port = 80, IsSecured = false, MaxConcurrentConnections = 1 }; + InnerContactsChannel = new Channel { Type = typeof(HyvesClientChannel), Port = 80, IsSecured = false, MaxConcurrentConnections = 1 }; + } + + public override DisplayStyle DisplayStyle + { + get { return DisplayStyle.Redirect; } + } + + public override string DisplayName + { + get { return "Hyves"; } + } + + public override IWebRedirectBuilder RedirectBuilder + { + get { return new HyvesRedirectBuilder(); } + } + + public override ChannelCharasteristics Charasteristics + { + get + { + var actions = base.Charasteristics; + + actions.SupportsEmail = false; + actions.SupportsHtml = false; + actions.SupportsPublicMessage = true; + actions.SupportsMobileMessage = true; + actions.CanSendFiles = false; + actions.CanReply = "/Settings/Channels/Codebase".AsKey("") == "cloud"; + actions.SupportsReadStates = false; + + return actions; + } + } + + public override ChannelConfiguration Clone() + { + return this.DeepCopy(new XmlSerializer(typeof(HyvesConfiguration))); + } + } +} diff --git a/Code/Channels/Hyves/HyvesRedirectBuilder.cs b/Code/Channels/Hyves/HyvesRedirectBuilder.cs new file mode 100644 index 0000000..151491d --- /dev/null +++ b/Code/Channels/Hyves/HyvesRedirectBuilder.cs @@ -0,0 +1,100 @@ +using System; +using System.IO; +using System.Net; +using System.ServiceModel; +using System.ServiceModel.Web; +using System.Text; +using System.Xml.Linq; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Channels.Text; +using Inbox2.Platform.Framework; +using Inbox2.Platform.Framework.Extensions; + +namespace Inbox2.Channels.Hyves +{ + public class HyvesRedirectBuilder : IWebRedirectBuilder + { + public string Token { get; set; } + + public string TokenSecret { get; set; } + + public string SuccessUri + { + get { return "http://jump.inbox2.com/channels/hyves"; } + } + + public HyvesRedirectBuilder() + { + Token = SafeSession.Current["/Channels/Hyves/Redirect/Token"] as string; + TokenSecret = SafeSession.Current["/Channels/Hyves/Redirect/TokenSecret"] as string; + } + + public Uri BuildRedirectUri() + { + // 1. Get Auth Token + Uri uri = new Uri(String.Format("http://data.hyves-api.nl/?methods={0}&expirationtype=infinite&ha_method=auth.requesttoken&ha_version=experimental&ha_format=xml&ha_fancylayout=false", HyvesApiRequest.AllMethods)); + + XElement result = HyvesApiRequest.PerformRequest(uri); + + Token = result.Element("oauth_token").Value; + TokenSecret = result.Element("oauth_token_secret").Value; + + // Save data in session for re-materialization + SafeSession.Current["/Channels/Hyves/Redirect/Token"] = Token; + SafeSession.Current["/Channels/Hyves/Redirect/TokenSecret"] = TokenSecret; + + return new Uri(String.Format("http://www.hyves.nl/api/authorize/?oauth_token={0}&oauth_callback={1}", Token, BuildEnvironmentUrl())); + } + + public string ParseVerifier(string returnValue) + { + return NameValueParser.GetCollection(new Uri(returnValue).Query, "&")["oauth_token"]; + } + + public bool ValidateReturnValue(string returnValue) + { + // 6. Exchange auth.token for access.token + Uri uri = new Uri("http://data.hyves-api.nl/?ha_method=auth.accesstoken&ha_version=experimental&ha_format=xml&ha_fancylayout=false"); + + XElement accessResult = HyvesApiRequest.PerformRequest(uri, Token, TokenSecret); + + if (ChannelContext.Current == null) + throw new ArgumentNullException("ChannelContext.Current"); + + string authorizedToken = accessResult.Element("oauth_token").Value; + string authorizedSecret = accessResult.Element("oauth_token_secret").Value; + string userid = accessResult.Element("userid").Value; + + // Remove token from session + SafeSession.Current.Remove("/Channels/Hyves/Redirect/Token"); + SafeSession.Current.Remove("/Channels/Hyves/Redirect/TokenSecret"); + + // 7. Save auth keys + ChannelContext.Current.ClientContext.SaveSetting("/Channels/Hyves/AuthToken", authorizedToken); + ChannelContext.Current.ClientContext.SaveSetting("/Channels/Hyves/AuthSecret", authorizedSecret); + ChannelContext.Current.ClientContext.SaveSetting("/Channels/Hyves/UserId", userid); + + return true; + } + + public string GetUsername() + { + var friend = HyvesClientChannel.PerformRequest( + String.Format("http://data.hyves-api.nl/?userid={0}&ha_method=users.get&ha_version=experimental&ha_format=xml&ha_fancylayout=false", + ChannelContext.Current.ClientContext.GetSetting("/Channels/Hyves/UserId"))); + + return friend.Element("user").Element("displayname").Value; + } + + static string BuildEnvironmentUrl() + { + string environment = "/Settings/Application/Environment".AsKey(String.Empty); + + if (String.IsNullOrEmpty(environment)) + return "http://jump.inbox2.com/channels/hyves"; + + return String.Concat("http://jump.", environment, ".inbox2.com/channels/hyves"); + } + } +} diff --git a/Code/Channels/Hyves/Inbox2.Channels.Hyves.csproj b/Code/Channels/Hyves/Inbox2.Channels.Hyves.csproj new file mode 100644 index 0000000..2eb6375 --- /dev/null +++ b/Code/Channels/Hyves/Inbox2.Channels.Hyves.csproj @@ -0,0 +1,183 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {A30AE8E8-3A4C-441A-B10E-5B83269CC9D4} + Library + Properties + Inbox2.Channels.Hyves + Inbox2.Channels.Hyves + v3.5 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\..\Stable Assemblies\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + + + False + ..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + 3.5 + + + 3.0 + + + 3.5 + + + False + C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Web.dll + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + {43B96CD2-D7DA-4286-A209-EE9585EF6927} + Inbox2.Platform.Channels + + + {FB90E43A-0E32-41D5-A7AB-83EA0D936E5E} + Inbox2.Platform.Framework + + + {B9CE1540-1D68-43B2-83DB-47EC21D158A6} + Inbox2.Platform.Interfaces + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + \ No newline at end of file diff --git a/Code/Channels/Hyves/Properties/AssemblyInfo.cs b/Code/Channels/Hyves/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6307f77 --- /dev/null +++ b/Code/Channels/Hyves/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2.Channels.Hyves")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2.Channels.Hyves")] +[assembly: AssemblyCopyright("Copyright Tabdeelee © 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3524e1cd-db44-4ac0-a332-62dd7e38713c")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Code/Channels/Hyves/Resources/icon-10.png b/Code/Channels/Hyves/Resources/icon-10.png new file mode 100644 index 0000000..e9b2387 Binary files /dev/null and b/Code/Channels/Hyves/Resources/icon-10.png differ diff --git a/Code/Channels/Hyves/Resources/icon-13.png b/Code/Channels/Hyves/Resources/icon-13.png new file mode 100644 index 0000000..310a7f9 Binary files /dev/null and b/Code/Channels/Hyves/Resources/icon-13.png differ diff --git a/Code/Channels/Hyves/Resources/icon-64.png b/Code/Channels/Hyves/Resources/icon-64.png new file mode 100644 index 0000000..64be266 Binary files /dev/null and b/Code/Channels/Hyves/Resources/icon-64.png differ diff --git a/Code/Channels/Imap2/FolderHelper.cs b/Code/Channels/Imap2/FolderHelper.cs new file mode 100644 index 0000000..c40829b --- /dev/null +++ b/Code/Channels/Imap2/FolderHelper.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Channels.Entities; + +namespace Inbox2.Channels.Imap2 +{ + internal static class FolderHelper + { + static string[] inbox = new[] { "Inbox", "Posteingang", "Boîte de réception", "Recibidos", "Postvak IN", "Innboks", "Indbakke", "Inkorgen", "Posta in arrivo" }; + static string[] sentItems = new[] { "Sent Mail", "Gesendet", "Messages envoyés", "Enviados", "Verzonden berichten", "Sendt e-post", "Sendte e-mails", "Skickade mail", "Posta inviata" }; + static string[] drafts = new[] { "Drafts ", "Entwürfe ", "Brouillons ", "Borradores ", "Concepten", "Utkast", "Kladder", "Utkast", "Bozze" }; + static string[] spam = new[] { "Spam", "Spam", "Spam", "Spam", "Spam", "Søppelpost", "Spam", "Skräppost", "Spam" }; + static string[] trash = new[] { "Trash", "Papierkorb", "Corbeille", "Papelera", "Prullenbak", "Papirkurv", "Papirkurv", "Papperskorgen", "Cestino" }; + static string[] archive = new[] { "All Mail", "Alle Nachrichten", "Tous les messages", "Todos", "Alle berichten", "All e-post", "Alle e-mails", "Alla mail", "Tutti i messaggi" }; + + internal static ChannelFolderType GetImapFolderType(string name) + { + string[] parts = name.Split('/'); + string foldername = parts.Last(); + + if (IsMatch(foldername, inbox)) + return ChannelFolderType.Inbox; + + if (IsMatch(foldername, sentItems)) + return ChannelFolderType.SentItems; + + if (IsMatch(foldername, drafts)) + return ChannelFolderType.Drafts; + + if (IsMatch(foldername, spam)) + return ChannelFolderType.Spam; + + if (IsMatch(foldername, trash)) + return ChannelFolderType.Trash; + + if (IsMatch(foldername, archive)) + return ChannelFolderType.Archive; + + return ChannelFolderType.Label; + } + + static bool IsMatch(string foldername, string[] list) + { + foreach (var item in list) + { + if (item.Equals(foldername, StringComparison.InvariantCultureIgnoreCase)) + return true; + } + + return false; + } + } +} diff --git a/Code/Channels/Imap2/Imap2ClientChannel.cs b/Code/Channels/Imap2/Imap2ClientChannel.cs new file mode 100644 index 0000000..0bdbd50 --- /dev/null +++ b/Code/Channels/Imap2/Imap2ClientChannel.cs @@ -0,0 +1,309 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using Inbox2.Platform.Channels.Connections; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Exceptions; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Channels.Parsing; +using LumiSoft.Net.IMAP; +using LumiSoft.Net.IMAP.Client; +using LumiSoft.Net.MIME; + +namespace Inbox2.Channels.Imap2 +{ + public class Imap2ClientChannel : PoolableConnectionBase, IClientInputChannel, IReversePagableChannel, IReadStateChannel, IProgressChannel, ILabelsChannel, IPushChannel + { + #region Properties + + public long StartIndex { get; set; } + + public long EndIndex { get; set; } + + public long PageSize { get; set; } + + public ChannelProgressDelegate BytesRead { get; set; } + + public ChannelProgressDelegate BytesWritten { get; set; } + + public override string Protocol + { + get { return "IMAP"; } + } + + public string SourceAdress + { + get + { + string username = CredentialsProvider.GetCredentials().Claim; + + return username.Contains("@") ? username : String.Format("{0}@{1}", username, Hostname); + } + } + + public string AuthMessage { get; private set; } + + public LabelsSupport LabelsSupport { get { return LabelsSupport.Folders; } } + + #endregion + + public ConnectResult Connect() + { + var credentials = CredentialsProvider.GetCredentials(); + + Imap2Connection instance; + + // Get the connection for the current server and mailbox (username) + bool isFree = ConnectionPool.AcquireLock(out instance, Hostname, Port, IsSecured, credentials.Claim, credentials.Evidence); + + if (isFree == false) + return ConnectResult.Delay; + + connection = instance; + + if (instance == null) + throw new ChannelFunctionalException("Connection was null in Connect"); + + try + { + connection.Open(); + connection.Authenticate(); + + return ConnectResult.Success; + } + catch (ChannelAuthenticationException ex) + { + AuthMessage = ex.Message; + + return ConnectResult.AuthFailure; + } + } + + public IEnumerable GetFolders() + { + if (connection == null) + throw new ChannelFunctionalException("Connection was null in GetFolders"); + + var folders = connection.Client.GetFolders(); + + if (folders != null && folders.Length > 0) + { + foreach (var folder in folders) + yield return new ChannelFolder(folder, folder, FolderHelper.GetImapFolderType(folder)); + } + } + + public long GetNumberOfItems() + { + return connection.Client.UIDNext -1; + } + + public void SelectFolder(ChannelFolder folder) + { + connection.Client.SelectFolder(folder.FolderId); + } + + public IEnumerable GetHeaders() + { + var set = new IMAP_SequenceSet(String.Format("{0}:{1}", StartIndex <= 1 ? 1 : StartIndex, EndIndex < 0 ? "*" : EndIndex.ToString())); + + return FetchImapSet(set); + } + + public IEnumerable GetMessage(ChannelMessageHeader header) + { + connection.Client.SelectFolder(header.SourceFolder); + + using (var ms = new MemoryStream()) + { + connection.Client.FetchMessage(Int32.Parse(header.MessageNumber), ms); + + yield return ChannelMessageParser.From(ms, header); + } + } + + public bool Disconnect() + { + if (connection != null) + ConnectionPool.ReleaseLock(connection); + + return true; + } + + public IEnumerable BeginWaitForPush() + { + var commands = connection.Client.Idle(); + + foreach (var command in commands) + { + if (command.ToUpper().Contains("EXISTS")) + { + var parts = command.Split(new[] { " " }, StringSplitOptions.None); + + foreach (var header in FetchImapSet(new IMAP_SequenceSet(String.Format("{0}:*", parts[0])))) + yield return header; + } + } + + yield break; + } + + public void EndWaitForPush() + { + connection.Client.IdleDone(); + } + + IEnumerable FetchImapSet(IMAP_SequenceSet set) + { + var result = connection.Client.FetchMessages(set, + IMAP_FetchItem_Flags.UID | IMAP_FetchItem_Flags.MessageFlags | + IMAP_FetchItem_Flags.InternalDate | IMAP_FetchItem_Flags.Size | + IMAP_FetchItem_Flags.Header | IMAP_FetchItem_Flags.Envelope, false, true); + + if (result != null && result.Length > 0) + { + foreach (var item in result) + { + var header = new ChannelMessageHeader(); + header.MessageNumber = item.UID.ToString(); + header.SourceFolder = connection.Client.SelectedFolder; + header.Size = item.Size; + header.Context = item.Envelope.Subject; + header.DateReceived = item.Envelope.Date; + header.IsRead = !item.IsNewMessage; + + // Message is starred + if ((item.MessageFlags & IMAP_MessageFlags.Flagged) == IMAP_MessageFlags.Flagged) + header.IsStarred = true; + + header.MessageIdentifier = item.Envelope.MessageID; + header.InReplyTo = item.Envelope.InReplyTo; + + var provider = new MIME_h_Provider(); + var headers = new MIME_h_Collection(provider); + headers.Parse(item.HeaderData); + + var i2mpMessageId = headers.GetFirst("x-i2mp-messageid"); + if (i2mpMessageId != null) + { + var unstructured = (MIME_h_Unstructured) i2mpMessageId; + header.Metadata.i2mpMessageId = unstructured.Value; + } + + yield return header; + } + } + } + + public IClientInputChannel Clone() + { + return new Imap2ClientChannel + { + Hostname = Hostname, + Port = Port, + IsSecured = IsSecured, + MaxConcurrentConnections = MaxConcurrentConnections, + CredentialsProvider = CredentialsProvider + }; + } + + public virtual void MarkRead(ChannelMessageHeader message) + { + if (String.IsNullOrEmpty(message.SourceFolder)) return; + + connection.Client.SelectFolder(message.SourceFolder); + connection.Client.StoreMessageFlags(new IMAP_SequenceSet(message.MessageNumber), IMAP_MessageFlags.Seen, true); + } + + public virtual void MarkUnread(ChannelMessageHeader message) + { + if (String.IsNullOrEmpty(message.SourceFolder)) return; + + connection.Client.SelectFolder(message.SourceFolder); + connection.Client.StoreMessageFlags(new IMAP_SequenceSet(message.MessageNumber), IMAP_MessageFlags.None, true); + } + + public virtual void MarkDeleted(ChannelMessageHeader message) + { + if (String.IsNullOrEmpty(message.SourceFolder)) return; + + connection.Client.SelectFolder(message.SourceFolder); + connection.Client.StoreMessageFlags(new IMAP_SequenceSet(message.MessageNumber), IMAP_MessageFlags.Deleted, true); + } + + public virtual void SetStarred(ChannelMessageHeader message, bool starred) + { + if (String.IsNullOrEmpty(message.SourceFolder)) return; + + IMAP_MessageFlags flags = message.IsRead ? IMAP_MessageFlags.Seen : IMAP_MessageFlags.None; + + if (starred) flags = (flags | IMAP_MessageFlags.Flagged); + + connection.Client.SelectFolder(message.SourceFolder); + connection.Client.StoreMessageFlags(new IMAP_SequenceSet(message.MessageNumber), flags, true); + } + + public virtual void Purge(ChannelMessageHeader message) + { + // todo this is not working correctly with gmail because it moves stuff to the All Mail folder? + //if (String.IsNullOrEmpty(message.SourceFolder)) return; + + //connection.Client.SelectFolder(message.SourceFolder); + //connection.Client.DeleteMessages(new IMAP_SequenceSet(message.MessageNumber), true); + } + + public ChannelFolder CreateFolder(string folderName) + { + connection.Client.CreateFolder(folderName); + + return new ChannelFolder(folderName, folderName, FolderHelper.GetImapFolderType(folderName)); + } + + public virtual void MoveToFolder(ChannelMessageHeader message, ChannelFolder folder) + { + if (String.IsNullOrEmpty(message.SourceFolder)) return; + + connection.Client.SelectFolder(message.SourceFolder); + connection.Client.MoveMessages(new IMAP_SequenceSet(message.MessageNumber), folder.FolderId, true); + } + + public void CopyToFolder(ChannelMessageHeader message, ChannelFolder folder) + { + if (String.IsNullOrEmpty(message.SourceFolder)) return; + + connection.Client.SelectFolder(message.SourceFolder); + connection.Client.CopyMessages(new IMAP_SequenceSet(message.MessageNumber), folder.FolderId, true); + } + + public void RemoveFromFolder(ChannelMessageHeader message, ChannelFolder folder) + { + if (String.IsNullOrEmpty(message.SourceFolder)) return; + + connection.Client.SelectFolder(folder.FolderId); + connection.Client.DeleteMessages(new IMAP_SequenceSet(message.MessageNumber), true); + } + + public void AddLabel(ChannelMessageHeader message, string labelname) + { + connection.Client.SelectFolder(message.SourceFolder); + connection.Client.CopyMessages(new IMAP_SequenceSet(message.MessageNumber), labelname, true); + } + + public void RemoveLabel(string messagenumber, string labelname) + { + connection.Client.SelectFolder(labelname); + connection.Client.DeleteMessages(new IMAP_SequenceSet(messagenumber), true); + } + + public override void Dispose() + { + if (connection != null) + { + Disconnect(); + + connection.Close(); + } + } + } +} diff --git a/Code/Channels/Imap2/Imap2Connection.cs b/Code/Channels/Imap2/Imap2Connection.cs new file mode 100644 index 0000000..b4e0a8e --- /dev/null +++ b/Code/Channels/Imap2/Imap2Connection.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Connections; +using Inbox2.Platform.Channels.Exceptions; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Logging; +using LumiSoft.Net.IMAP.Client; +using Logger = Inbox2.Platform.Logging.Logger; + +namespace Inbox2.Channels.Imap2 +{ + public class Imap2Connection : ChannelConnectionBase + { + private IMAP_Client client; + + public IMAP_Client Client + { + get { return client; } + } + + public Imap2Connection(string hostname, int port, bool isSecured, string username, string password) : base(hostname, port, isSecured, username, password) + { + + } + + public override void Open() + { + Logger.Debug("Opening IMAP connection {0}", LogSource.Channel, UniqueId); + + if (!(channelState == ChannelState.Closed || channelState == ChannelState.Broken)) + { + Logger.Debug("SUCCESS Connection was allready open {0}", LogSource.Channel, UniqueId); + + return; + } + + channelState = ChannelState.Connecting; + client = new IMAP_Client(); + + if ("/Settings/Channels/LoggerEnabled".AsKey(false)) + { + client.Logger = new LumiSoft.Net.Log.Logger(); + client.Logger.WriteLog += (sender, e) => Logger.Debug(e.LogEntry.Text.Replace("{", "{{").Replace("}", "}}"), LogSource.Channel); + } + + try + { + client.Connect(Hostname, Port, IsSecured); + + channelState = ChannelState.Connected; + } + catch (Exception ex) + { + channelState = ChannelState.Closed; + + Logger.Debug("Unable to connect to server. Exception = {0}", LogSource.Channel, ex); + + throw new ChannelException("Unable to connect to server", ex); + } + + Logger.Debug("SUCCESS Opening connection {0}", LogSource.Channel, UniqueId); + } + + public override void Authenticate() + { + Logger.Debug("Authenticating connection {0}", LogSource.Channel, UniqueId); + + if (channelState == ChannelState.Authenticated) + return; + + if (channelState != ChannelState.Connected) + { + Logger.Error("Unable to authenticate in current channel state. ChannelState = {0}", LogSource.Channel, channelState); + + throw new ChannelException("Unable to authenticate in current channel state"); + } + + try + { + client.Capability(); + client.YahooImap(); + client.Authenticate(Username, Password); + + channelState = ChannelState.Authenticated; + + Logger.Debug("SUCCESS Authenticating connection {0}", LogSource.Channel, UniqueId); + } + catch (IMAP_ClientException ex) + { + channelState = ChannelState.Broken; + + Logger.Debug("FAILED Authenticating connection {0}. Server said {1}", LogSource.Channel, UniqueId, ex.ResponseText); + + throw new ChannelAuthenticationException(ex.ResponseText, ex); + } + } + + public override void Close() + { + if (client != null && client.IsConnected) + { + client.Disconnect(); + } + + channelState = ChannelState.Closed; + } + + public override void Dispose() + { + } + } +} diff --git a/Code/Channels/Imap2/Inbox2.Channels.Imap2.csproj b/Code/Channels/Imap2/Inbox2.Channels.Imap2.csproj new file mode 100644 index 0000000..909115f --- /dev/null +++ b/Code/Channels/Imap2/Inbox2.Channels.Imap2.csproj @@ -0,0 +1,170 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {528A7823-5CED-4E31-ABDF-E1F6F821FCFD} + Library + Properties + Inbox2.Channels.Imap2 + Inbox2.Channels.Imap2 + v3.5 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\..\Stable Assemblies\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + {7AB36CCF-5FFD-4780-A54E-A102ECA028B5} + LumiSoft.Net + + + {43B96CD2-D7DA-4286-A209-EE9585EF6927} + Inbox2.Platform.Channels + + + {FB90E43A-0E32-41D5-A7AB-83EA0D936E5E} + Inbox2.Platform.Framework + + + {B9CE1540-1D68-43B2-83DB-47EC21D158A6} + Inbox2.Platform.Interfaces + + + {6AE2A2AF-9B61-45B0-A375-666C5225A5B4} + Inbox2.Platform.Logging + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/Code/Channels/Imap2/Properties/AssemblyInfo.cs b/Code/Channels/Imap2/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e511e84 --- /dev/null +++ b/Code/Channels/Imap2/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2.Channels.Imap2")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2.Channels.Imap2")] +[assembly: AssemblyCopyright("Copyright © Tabdeelee 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("1b28a7da-793d-4272-b176-15c266db3cfb")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Code/Channels/LinkedIn/ChannelHelper.cs b/Code/Channels/LinkedIn/ChannelHelper.cs new file mode 100644 index 0000000..1d94efc --- /dev/null +++ b/Code/Channels/LinkedIn/ChannelHelper.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Channels; + +namespace Inbox2.Channels.LinkedIn +{ + public static class ChannelHelper + { + public const string ConsumerKey = "dIGHvmnGRaola5G-nWZnLyo-dxxMfKcu0XwkW4TNMrEiPa8MSNzX_gPLUoX7onBU"; + public const string ConsumerSecret = "z1JhKifIwPARS6_p58zoc_i9nhL1gZG9xX23csxGBb3aBiyT1iwy4G6K3gvFofa5"; + + public static string Token + { + get { return ChannelContext.Current.ClientContext.GetSetting("/Channels/LinkedIn/AuthToken") as string; } + } + + public static string TokenSecret + { + get { return ChannelContext.Current.ClientContext.GetSetting("/Channels/LinkedIn/AuthSecret") as string; } + } + } +} \ No newline at end of file diff --git a/Code/Channels/LinkedIn/Inbox2.Channels.LinkedIn.csproj b/Code/Channels/LinkedIn/Inbox2.Channels.LinkedIn.csproj new file mode 100644 index 0000000..9147c22 --- /dev/null +++ b/Code/Channels/LinkedIn/Inbox2.Channels.LinkedIn.csproj @@ -0,0 +1,184 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {9A6A1888-D1F0-4B41-BAF5-5B3B82858A73} + Library + Properties + Inbox2.Channels.LinkedIn + Inbox2.Channels.LinkedIn + v3.5 + 512 + OnOutputUpdated + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\..\Stable Assemblies\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + + + False + ..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + 3.5 + + + + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + {43B96CD2-D7DA-4286-A209-EE9585EF6927} + Inbox2.Platform.Channels + + + {FB90E43A-0E32-41D5-A7AB-83EA0D936E5E} + Inbox2.Platform.Framework + + + {B9CE1540-1D68-43B2-83DB-47EC21D158A6} + Inbox2.Platform.Interfaces + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Code/Channels/LinkedIn/LinkedInClientChannel.cs b/Code/Channels/LinkedIn/LinkedInClientChannel.cs new file mode 100644 index 0000000..a3aef65 --- /dev/null +++ b/Code/Channels/LinkedIn/LinkedInClientChannel.cs @@ -0,0 +1,342 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Channels.Extensions; + +namespace Inbox2.Channels.LinkedIn +{ + public class LinkedInClientChannel : IClientInputChannel, IClientContactsChannel, IClientStatusUpdatesChannel + { + public string Hostname + { + get { return "http://m.linkedin.com"; } + set { } + } + public int Port + { + get { return 80; } + set { } + } + + public bool IsSecured + { + get { return false; } + set { } + } + + public bool IsEnabled { get; set; } + + public int MaxConcurrentConnections { get; set; } + + public IChannelCredentialsProvider CredentialsProvider { get; set; } + + public string Protocol + { + get { return "LinkedIn"; } + } + + /// + /// See: http://developer.linkedin.com/docs/DOC-1004 + /// + /// + public IEnumerable GetContacts() + { + var result = LinkedInWebRequest.PerformRequest(new Uri("http://api.linkedin.com/v1/people/~/connections"), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + + if (result.Element("connections").Elements().Count() == 0) + yield break; + + foreach (var response in result.Elements("connections").Elements("person")) + { + ChannelContact contact = new ChannelContact(); + contact.Profile.ChannelProfileKey = response.Element("id").Value; + contact.Person.Firstname = response.Element("first-name").Value; + contact.Person.Lastname = response.Element("last-name").Value; + + contact.Profile.Title = response.Element("headline").Value; + contact.Profile.Url = response.Element("site-standard-profile-request").Element("url").Value; + + if (response.Element("picture-url") != null) + { + contact.Profile.ChannelAvatar = new ChannelAvatar(); + contact.Profile.ChannelAvatar.Url = response.Element("picture-url").Value; + } + + contact.Profile.SourceAddress = new SourceAddress(response.Element("id").Value, contact.Person.Name); + contact.Profile.ProfileType = ProfileType.Social; + + yield return contact; + } + } + + IClientContactsChannel IClientContactsChannel.Clone() + { + return new LinkedInClientChannel + { + Hostname = Hostname, + Port = Port, + IsSecured = IsSecured, + MaxConcurrentConnections = MaxConcurrentConnections, + CredentialsProvider = CredentialsProvider + }; + } + + public ChannelSocialProfile GetProfile() + { + var result = LinkedInWebRequest.PerformRequest(new Uri("http://api.linkedin.com/v1/people/~:(id,first-name,last-name,picture-url)"), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + + var response = result.Element("person"); + + return new ChannelSocialProfile + { + Id = response.Element("id").Value, + FullName = String.Concat(response.Element("first-name").Value, " ", response.Element("last-name").Value), + AvatarUrl = response.Element("picture-url") == null ? String.Empty : response.Element("picture-url").Value + }; + } + + public IEnumerable GetMentions(int pageSize) + { + yield break; + } + + public IEnumerable GetUpdates(int pageSize) + { + var result = LinkedInWebRequest.PerformRequest(new Uri("http://api.linkedin.com/v1/people/~/network"), ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + + if (result.Element("network").Elements().Count() == 0) + yield break; + + foreach (var response in result.Element("network").Element("updates").Elements("update")) + { + ChannelStatusUpdate statusUpdate = null; + var updateType = (LinkedInUpdateType)Enum.Parse(typeof(LinkedInUpdateType), + response.Element("update-type").Value); + + switch (updateType) + { + case LinkedInUpdateType.ANSW: + // TODO : Answer Update + break; + case LinkedInUpdateType.APPS: + case LinkedInUpdateType.APPM: + // TODO : Application Update + break; + case LinkedInUpdateType.CONN: + case LinkedInUpdateType.NCON: + case LinkedInUpdateType.CCEM: + // Connection updates + statusUpdate = new ChannelStatusUpdate + { + ChannelStatusKey = BuildChannelStatusKey(response), + From = BuildSourceAddress(response), + Status = BuildConnectionStatusMessage(response), + DatePosted = GetDateTime(response) + }; + break; + case LinkedInUpdateType.JOBS: + case LinkedInUpdateType.JOBP: + // TODO : Posted a job + break; + case LinkedInUpdateType.JGRP: + // TODO : Joined a group + break; + case LinkedInUpdateType.PICT: + case LinkedInUpdateType.PICU: + // TODO : Changed a picture + break; + case LinkedInUpdateType.RECU: + case LinkedInUpdateType.PREC: + // TODO : Recommendations + break; + case LinkedInUpdateType.PRFU: + case LinkedInUpdateType.PROF: + // TODO : Changed profile + break; + case LinkedInUpdateType.QSTN: + // TODO : Question update + break; + case LinkedInUpdateType.STAT: + // Status update + statusUpdate = new ChannelStatusUpdate + { + ChannelStatusKey = BuildChannelStatusKey(response), + From = BuildSourceAddress(response), + Status = response.Element("update-content").Element("person").Element("current-status").Value, + DatePosted = GetDateTime(response) + }; + break; + } + + if (statusUpdate != null) + yield return statusUpdate; + } + } + + private DateTime GetDateTime(XElement response) + { + // LinkedIn returns us Milliseconds instead of seconds. + // We first need to convert this to seconds. + return ((long)TimeSpan.FromMilliseconds(Int64.Parse(response.Element("timestamp").Value)).TotalSeconds).ToUnixTime(); + } + + private string BuildChannelStatusKey(XElement response) + { + return string.Format( + "{0}-{1}", + response.Element("timestamp").Value, + response.Element("update-content").Element("person").Element("id").Value + ); + } + + private SourceAddress BuildSourceAddress(XElement response) + { + if (response.Element("update-content").Element("person").Element("picture-url") != null) + { + // User has avatar + return new SourceAddress( + response.Element("update-content").Element("person").Element("id").Value, + string.Format("{0} {1}", + response.Element("update-content").Element("person").Element("first-name").Value, + response.Element("update-content").Element("person").Element("last-name").Value), + response.Element("update-content").Element("person").Element("picture-url").Value, + response.Element("update-content").Element("person").Element("site-standard-profile-request").Element("url").Value); + } + else + { + // No Avatar + var address = new SourceAddress( + response.Element("update-content").Element("person").Element("id").Value, + string.Format("{0} {1}", + response.Element("update-content").Element("person").Element("first-name").Value, + response.Element("update-content").Element("person").Element("last-name").Value)); + + address.ProfileUrl = + response.Element("update-content").Element("person").Element("site-standard-profile-request").Element("url").Value; + + return address; + } + } + + private string BuildConnectionStatusMessage(XElement response) + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append("is now connected to "); + + var persons = response.Element("update-content").Element("person").Element("connections").Elements("person").ToArray(); + var connectedTo = new string[persons.Count()]; + for (int i = 0; i < persons.Count(); i++) + { + connectedTo[i] = String.Format("{0} {1}", persons[i].Element("first-name").Value, persons[i].Element("last-name").Value); + } + stringBuilder.Append(String.Join(", ", connectedTo)); + + return stringBuilder.ToString(); + } + + public IEnumerable GetUserUpdates(string username, int pageSize) + { + var result = LinkedInWebRequest.PerformRequest(new Uri(String.Concat("http://api.linkedin.com/v1/people/id=", username, ":(current-status,current-status-timestamp)")), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + + if (result.Elements("person").Elements().Count() == 0) + yield break; + + foreach (var response in result.Elements("person")) + { + var update = new ChannelStatusUpdate(); + + update.Status = response.Element("current-status").Value; + + var ts = TimeSpan.FromMilliseconds(Double.Parse(response.Element("current-status-timestamp").Value)); + update.DatePosted = ((long) ts.TotalSeconds).ToUnixTime(); + + yield return update; + } + } + + public IEnumerable GetUpdates(string keyword, int pageSize) + { + yield break; + } + + public void UpdateMyStatus(ChannelStatusUpdate update) + { + var element = new XElement("current-status", update.Status.StripHtml()); + + LinkedInWebRequest.Put(new Uri("http://api.linkedin.com/v1/people/~/current-status"), element.ToString(), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + } + + IClientStatusUpdatesChannel IClientStatusUpdatesChannel.Clone() + { + return new LinkedInClientChannel + { + Hostname = Hostname, + Port = Port, + IsSecured = IsSecured, + MaxConcurrentConnections = MaxConcurrentConnections, + CredentialsProvider = CredentialsProvider + }; + } + + public string SourceAdress + { + get { return CredentialsProvider.GetCredentials().Claim; } + } + + public string AuthMessage { get; private set; } + + public ConnectResult Connect() + { + return ConnectResult.Success; + } + + public IEnumerable GetFolders() + { + yield return new ChannelFolder("inbox", "inbox", ChannelFolderType.Inbox); + } + + public void SelectFolder(ChannelFolder folder) + { + } + + public IEnumerable GetHeaders() + { + yield break; + } + + public IEnumerable GetMessage(ChannelMessageHeader header) + { + yield break; + } + + public bool Disconnect() + { + return true; + } + + public IClientInputChannel Clone() + { + LinkedInClientChannel channel = new LinkedInClientChannel(); + channel.Hostname = Hostname; + channel.Port = Port; + channel.IsSecured = IsSecured; + channel.MaxConcurrentConnections = MaxConcurrentConnections; + channel.CredentialsProvider = CredentialsProvider; + + return channel; + } + + public void Dispose() + { + + } + } +} diff --git a/Code/Channels/LinkedIn/LinkedInConfiguration.cs b/Code/Channels/LinkedIn/LinkedInConfiguration.cs new file mode 100644 index 0000000..c1227bc --- /dev/null +++ b/Code/Channels/LinkedIn/LinkedInConfiguration.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Linq; +using System.Text; +using System.Xml.Serialization; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Interfaces.Enumerations; + +namespace Inbox2.Channels.LinkedIn +{ + [Serializable] + [Export(typeof(ChannelConfiguration))] + public class LinkedInConfiguration : ChannelConfiguration + { + public LinkedInConfiguration() + { + InnerInputChannel = new Channel { Type = typeof(LinkedInClientChannel) }; + InnerContactsChannel = new Channel { Type = typeof(LinkedInClientChannel) }; + InnerStatusUpdatesChannel = new Channel { Type = typeof(LinkedInClientChannel) }; + } + + public override DisplayStyle DisplayStyle + { + get { return DisplayStyle.Redirect; } + } + + public override string DisplayName + { + get { return "LinkedIn"; } + } + + public override IWebRedirectBuilder RedirectBuilder + { + get { return new LinkedInRedirectBuilder(); } + } + + public override ChannelProfileInfoBuilder ProfileInfoBuilder + { + get { return new LinkedInProfileInfoBuilder(); } + } + + public override ChannelCharasteristics Charasteristics + { + get + { + var charasteristics = base.Charasteristics; + + charasteristics.SupportsEmail = false; + charasteristics.SupportsHtml = false; + charasteristics.SupportsPrivateMessage = false; + charasteristics.SupportsPublicMessage = true; + charasteristics.CanSendFiles = false; + charasteristics.SupportsReadStates = false; + charasteristics.SupportsProfiles = true; + charasteristics.SupportsStatusUpdates = true; + charasteristics.SupportsStatusUpdatesReply = false; + + return charasteristics; + } + } + + public override ChannelConfiguration Clone() + { + return this.DeepCopy(new XmlSerializer(typeof(LinkedInConfiguration))); + } + } +} diff --git a/Code/Channels/LinkedIn/LinkedInProfileInfoBuilder.cs b/Code/Channels/LinkedIn/LinkedInProfileInfoBuilder.cs new file mode 100644 index 0000000..dd494b4 --- /dev/null +++ b/Code/Channels/LinkedIn/LinkedInProfileInfoBuilder.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Entities; + +namespace Inbox2.Channels.LinkedIn +{ + public class LinkedInProfileInfoBuilder : ChannelProfileInfoBuilder + { + public override string StreamUrl + { + get { return "http://www.linkedin.com/home"; } + } + + public override string BuildServiceProfileUrl(SourceAddress address) + { + return address.ProfileUrl; + } + + public override string BuildServiceProfileUrl(ChannelProfile profile) + { + return profile.Url; + } + } +} diff --git a/Code/Channels/LinkedIn/LinkedInRedirectBuilder.cs b/Code/Channels/LinkedIn/LinkedInRedirectBuilder.cs new file mode 100644 index 0000000..4d10511 --- /dev/null +++ b/Code/Channels/LinkedIn/LinkedInRedirectBuilder.cs @@ -0,0 +1,91 @@ +using System; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Framework; +using Inbox2.Platform.Channels.Text; +using Inbox2.Platform.Framework.Extensions; + +namespace Inbox2.Channels.LinkedIn +{ + public class LinkedInRedirectBuilder: IWebRedirectBuilder + { + public string Token { get; set; } + + public string TokenSecret { get; set; } + + public string SuccessUri + { + get { return "http://jump.inbox2.com/channels/linkedin"; } + } + + public LinkedInRedirectBuilder() + { + Token = SafeSession.Current["/Channels/LinkedIn/Redirect/Token"] as string; + TokenSecret = SafeSession.Current["/Channels/LinkedIn/Redirect/TokenSecret"] as string; + } + + public Uri BuildRedirectUri() + { + // 1. Get Auth Token + var result = LinkedInWebRequest.PerformRequest(new Uri("https://api.linkedin.com/uas/oauth/requestToken"), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret); + var parts = NameValueParser.GetCollection(result, "&"); + + this.Token = parts["oauth_token"]; + this.TokenSecret = parts["oauth_token_secret"]; + + // Save data in session for re-materialization + SafeSession.Current["/Channels/LinkedIn/Redirect/Token"] = Token; + SafeSession.Current["/Channels/LinkedIn/Redirect/TokenSecret"] = TokenSecret; + + return new Uri("https://api.linkedin.com/uas/oauth/authorize?oauth_token=" + Token + "&oauth_callback=" + BuildEnvironmentUrl()); + } + + public string ParseVerifier(string returnValue) + { + return NameValueParser.GetCollection(new Uri(returnValue).Query, "&")["oauth_verifier"]; + } + + public bool ValidateReturnValue(string verifier) + { + var result = LinkedInWebRequest.PerformRequest(new Uri("https://api.linkedin.com/uas/oauth/accessToken"), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, Token, TokenSecret, verifier); + + var parts = NameValueParser.GetCollection(result, "&"); + + if (ChannelContext.Current == null) + throw new ArgumentNullException("ChannelContext.Current"); + + // Remove token from session + SafeSession.Current.Remove("/Channels/LinkedIn/Redirect/Token"); + SafeSession.Current.Remove("/Channels/LinkedIn/Redirect/TokenSecret"); + + // 7. Save auth keys + ChannelContext.Current.ClientContext.SaveSetting("/Channels/LinkedIn/AuthToken", parts["oauth_token"]); + ChannelContext.Current.ClientContext.SaveSetting("/Channels/LinkedIn/AuthSecret", parts["oauth_token_secret"]); + + Token = parts["oauth_token"]; + TokenSecret = parts["oauth_token_secret"]; + + return true; + } + + public string GetUsername() + { + var result = LinkedInWebRequest.PerformRequest(new Uri("https://api.linkedin.com/v1/people/~"), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, Token, TokenSecret); + + return result.Element("person").Element("first-name").Value + " " + result.Element("person").Element("last-name").Value; + } + + static string BuildEnvironmentUrl() + { + string environment = "/Settings/Application/Environment".AsKey(String.Empty); + + if (String.IsNullOrEmpty(environment)) + return "http://jump.inbox2.com/channels/linkedin"; + + return String.Concat("http://jump.", environment, ".inbox2.com/channels/linkedin"); + } + } +} diff --git a/Code/Channels/LinkedIn/LinkedInUpdateType.cs b/Code/Channels/LinkedIn/LinkedInUpdateType.cs new file mode 100644 index 0000000..323e429 --- /dev/null +++ b/Code/Channels/LinkedIn/LinkedInUpdateType.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Channels.LinkedIn +{ + public enum LinkedInUpdateType + { + ANSW, + APPS, + APPM, + CONN, + NCON, + CCEM, + JOBS, + JOBP, + JGRP, + PICT, + PICU, + RECU, + PREC, + PRFU, + PROF, + QSTN, + STAT + } +} diff --git a/Code/Channels/LinkedIn/LinkedInWebRequest.cs b/Code/Channels/LinkedIn/LinkedInWebRequest.cs new file mode 100644 index 0000000..dcc3aa2 --- /dev/null +++ b/Code/Channels/LinkedIn/LinkedInWebRequest.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.IO; +using System.Net; +using Inbox2.Platform.Framework.OAuth; +using System.Web; +using Inbox2.Platform.Channels.Text; +using System.Xml.Linq; +using Inbox2.Platform.Framework.Extensions; + +namespace Inbox2.Channels.LinkedIn +{ + public class LinkedInWebRequest + { + public static string Put(Uri sourceUri, string data, string consumerKey, string consumerSecret, string token, string tokenSecret) + { + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sourceUri); + request.Method = "PUT"; + //request.ContentType = "application/x-www-form-urlencoded"; + request.UserAgent = "inbox2"; + string authParams = BuildOAuthParams(sourceUri, consumerKey, consumerSecret, token, tokenSecret, null, "PUT"); + request.Headers.Add("Authorization", authParams); + + byte[] bytes = Encoding.UTF8.GetBytes(data); + request.ContentLength = bytes.Length; + + // Write post data to request stream + using (Stream requestStream = request.GetRequestStream()) + requestStream.Write(bytes, 0, bytes.Length); + + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + using (var responseStream = response.GetResponseStream()) + return responseStream.ReadString(); + } + + public static string PerformRequest(Uri sourceUri, string consumerKey, string consumerSecret) + { + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sourceUri); + request.Method = "POST"; + request.ContentType = "application/x-www-form-urlencoded"; + request.UserAgent = "inbox2"; + string authParams = BuildOAuthParams(sourceUri, consumerKey, consumerSecret, null, null, null); + request.Headers.Add("Authorization", authParams); + + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + using (var responseStream = response.GetResponseStream()) + return responseStream.ReadString(); + } + + public static string PerformRequest(Uri sourceUri, string consumerKey, string consumerSecret, string token, string tokenSecret, string verifier) + { + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sourceUri); + request.Method = "POST"; + request.ContentType = "application/x-www-form-urlencoded"; + request.UserAgent = "inbox2"; + string authParams = BuildOAuthParams(sourceUri, consumerKey, consumerSecret, token, tokenSecret, verifier); + request.Headers.Add("Authorization", authParams); + + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + using (var responseStream = response.GetResponseStream()) + return responseStream.ReadString(); + } + + public static XDocument PerformRequest(Uri sourceUri, string consumerKey, string consumerSecret, string token, string tokenSecret) + { + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sourceUri); + request.Method = "GET"; + request.UserAgent = "inbox2"; + string authParams = BuildOAuthParams(sourceUri, consumerKey, consumerSecret, token, tokenSecret, null, "GET"); + request.Headers.Add("Authorization", authParams); + + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + string responseString; + using (var responseStream = response.GetResponseStream()) + responseString = responseStream.ReadString(); + + return XDocument.Parse(responseString); + } + + static string BuildOAuthParams(Uri source, string consumerKey, string consumerSecret, string token, string tokenSecret, string verifier) + { + return BuildOAuthParams(source, consumerKey, consumerSecret, token, tokenSecret, verifier, "POST"); + } + + static string BuildOAuthParams(Uri source, string consumerKey, string consumerSecret, string token, string tokenSecret, string verifier, string httpMethod) + { + OAuthBase oauth = new OAuthBase(); + + string timeStamp = OAuthBase.GenerateTimeStamp(); + string nonce = OAuthBase.GenerateNonce(); + + // Calling source.Query returns an urlencoded string, but we don't want that since we will use + // oauth.UrlEncode ourselves + var query = HttpUtility.UrlDecode(source.Query.Contains("?") ? source.Query.Remove(0, 1) : source.Query); + var parameters = NameValueParser.GetCollection(query, "&"); + + parameters.Add("oauth_nonce", nonce); + parameters.Add("oauth_signature_method", "HMAC-SHA1"); + + parameters.Add("oauth_timestamp", timeStamp); + parameters.Add("oauth_consumer_key", consumerKey); + + if (!String.IsNullOrEmpty(token)) + parameters.Add("oauth_token", token); + + if (!String.IsNullOrEmpty(verifier)) + parameters.Add("oauth_verifier", verifier); + + parameters.Add("oauth_version", "1.0"); + + StringBuilder requestBuilder = new StringBuilder(); + + string signature = oauth.GenerateSignature(source, parameters, consumerKey, consumerSecret, token, tokenSecret, httpMethod, timeStamp, nonce, OAuthBase.SignatureTypes.HMACSHA1); + + parameters.Add("oauth_signature", signature); + + requestBuilder.Append("OAuth "); + + foreach (string key in parameters) + { + requestBuilder.Append(key); + requestBuilder.Append("="); + requestBuilder.Append(@"""" + OAuthBase.UrlEncode(parameters[key]) + @""""); + + requestBuilder.Append(", "); + } + + return requestBuilder.ToString(); + } + } +} diff --git a/Code/Channels/LinkedIn/Properties/AssemblyInfo.cs b/Code/Channels/LinkedIn/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..81d75e7 --- /dev/null +++ b/Code/Channels/LinkedIn/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2.Channels.LinkedIn")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2.Channels.LinkedIn")] +[assembly: AssemblyCopyright("Copyright Tabdeelee © 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d1ce60f9-105d-47d4-a5e7-4ef7c83e2b19")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Code/Channels/LinkedIn/Resources/icon-10.png b/Code/Channels/LinkedIn/Resources/icon-10.png new file mode 100644 index 0000000..994a116 Binary files /dev/null and b/Code/Channels/LinkedIn/Resources/icon-10.png differ diff --git a/Code/Channels/LinkedIn/Resources/icon-13.png b/Code/Channels/LinkedIn/Resources/icon-13.png new file mode 100644 index 0000000..4ed4262 Binary files /dev/null and b/Code/Channels/LinkedIn/Resources/icon-13.png differ diff --git a/Code/Channels/LinkedIn/Resources/icon-64.png b/Code/Channels/LinkedIn/Resources/icon-64.png new file mode 100644 index 0000000..8fc25c6 Binary files /dev/null and b/Code/Channels/LinkedIn/Resources/icon-64.png differ diff --git a/Code/Channels/Other/Inbox2.Channels.Other.csproj b/Code/Channels/Other/Inbox2.Channels.Other.csproj new file mode 100644 index 0000000..50960d3 --- /dev/null +++ b/Code/Channels/Other/Inbox2.Channels.Other.csproj @@ -0,0 +1,91 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {1369054D-65DD-4B12-8AC2-BF3A73EFC01D} + Library + Properties + Inbox2.Channels.Other + Inbox2.Channels.Other + v3.5 + 512 + + + + true + full + false + ..\..\Stable Assemblies\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + {43B96CD2-D7DA-4286-A209-EE9585EF6927} + Inbox2.Platform.Channels + + + {FB90E43A-0E32-41D5-A7AB-83EA0D936E5E} + Inbox2.Platform.Framework + + + {B9CE1540-1D68-43B2-83DB-47EC21D158A6} + Inbox2.Platform.Interfaces + + + {6AE2A2AF-9B61-45B0-A375-666C5225A5B4} + Inbox2.Platform.Logging + + + {528A7823-5CED-4E31-ABDF-E1F6F821FCFD} + Inbox2.Channels.Imap2 + + + {60AE3B61-131B-4CC9-B49C-0892E701ACF0} + Inbox2.Channels.Pop3 + + + {D977B2FC-E1BE-410E-8544-8B7263AB44C6} + Inbox2.Channels.Smtp + + + + + + + + + + + \ No newline at end of file diff --git a/Code/Channels/Other/OtherConfiguration.cs b/Code/Channels/Other/OtherConfiguration.cs new file mode 100644 index 0000000..1a36712 --- /dev/null +++ b/Code/Channels/Other/OtherConfiguration.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Linq; +using System.Text; +using System.Xml.Serialization; +using Inbox2.Channels.Imap2; +using Inbox2.Channels.Smtp; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Interfaces.Enumerations; + +namespace Inbox2.Channels.Other +{ + [Serializable] + [Export(typeof(ChannelConfiguration))] + public class OtherConfiguration : ChannelConfiguration + { + public OtherConfiguration() + { + InnerInputChannel = new Channel { MaxConcurrentConnections = 1 }; + InnerOutputChannel = new Channel { Type = typeof(SmtpClientChannel), MaxConcurrentConnections = 1 }; + } + + public override string DisplayName + { + get { return "Other"; } + } + + public override DisplayStyle DisplayStyle + { + get { return DisplayStyle.Other; } + } + + public override ChannelCharasteristics Charasteristics + { + get + { + var baseChars = ChannelCharasteristics.Default; + + if (InnerInputChannel != null) + baseChars.SupportsReadStates = + (InnerInputChannel.TypeSurrogate != null && InnerInputChannel.Type == typeof(Imap2ClientChannel)); + + return baseChars; + } + } + + public override ChannelConfiguration Clone() + { + return this.DeepCopy(new XmlSerializer(typeof(OtherConfiguration))); + } + } +} diff --git a/Code/Channels/Other/Properties/AssemblyInfo.cs b/Code/Channels/Other/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5038391 --- /dev/null +++ b/Code/Channels/Other/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2.Channels.Other")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2.Channels.Other")] +[assembly: AssemblyCopyright("Copyright Tabdeelee © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("47ba984b-7b4d-4a5b-bfcc-bf1361adf1b3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Code/Channels/Other/Resources/icon-10.png b/Code/Channels/Other/Resources/icon-10.png new file mode 100644 index 0000000..b38b9e6 Binary files /dev/null and b/Code/Channels/Other/Resources/icon-10.png differ diff --git a/Code/Channels/Other/Resources/icon-13.png b/Code/Channels/Other/Resources/icon-13.png new file mode 100644 index 0000000..6519608 Binary files /dev/null and b/Code/Channels/Other/Resources/icon-13.png differ diff --git a/Code/Channels/Other/Resources/icon-64.png b/Code/Channels/Other/Resources/icon-64.png new file mode 100644 index 0000000..dbc82ad Binary files /dev/null and b/Code/Channels/Other/Resources/icon-64.png differ diff --git a/Code/Channels/Pop3/Inbox2.Channels.Pop3.csproj b/Code/Channels/Pop3/Inbox2.Channels.Pop3.csproj new file mode 100644 index 0000000..a4b96a4 --- /dev/null +++ b/Code/Channels/Pop3/Inbox2.Channels.Pop3.csproj @@ -0,0 +1,177 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {60AE3B61-131B-4CC9-B49C-0892E701ACF0} + Library + Properties + Inbox2.Channels.Pop3 + Inbox2.Channels.Pop3 + v3.5 + 512 + OnOutputUpdated + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\..\Stable Assemblies\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + + 3.5 + + + 3.0 + + + 3.5 + + + 3.5 + + + + + + + + + + + + {7AB36CCF-5FFD-4780-A54E-A102ECA028B5} + LumiSoft.Net + + + {43B96CD2-D7DA-4286-A209-EE9585EF6927} + Inbox2.Platform.Channels + + + {FB90E43A-0E32-41D5-A7AB-83EA0D936E5E} + Inbox2.Platform.Framework + + + {B9CE1540-1D68-43B2-83DB-47EC21D158A6} + Inbox2.Platform.Interfaces + + + {6AE2A2AF-9B61-45B0-A375-666C5225A5B4} + Inbox2.Platform.Logging + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + \ No newline at end of file diff --git a/Code/Channels/Pop3/Pop3ClientChannel.cs b/Code/Channels/Pop3/Pop3ClientChannel.cs new file mode 100644 index 0000000..8b6093d --- /dev/null +++ b/Code/Channels/Pop3/Pop3ClientChannel.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Inbox2.Platform.Channels.Connections; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Exceptions; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Channels.Parsing; +using LumiSoft.Net.POP3.Client; + +namespace Inbox2.Channels.Pop3 +{ + public class Pop3ClientChannel : PoolableConnectionBase, IClientInputChannel, IDisposable, IPagableChannel + { + private POP3_ClientMessageCollection messages; + + public long StartIndex { get; set; } + + public long EndIndex { get; set; } + + public long PageSize { get; set; } + + public override string Protocol + { + get { return "POP3"; } + } + + public string SourceAdress + { + get + { + string username = CredentialsProvider.GetCredentials().Claim; + + return username.Contains("@") ? username : String.Format("{0}@{1}", username, Hostname); + } + } + + public string AuthMessage + { + get; private set; + } + + public ConnectResult Connect() + { + Pop3Connection instance; + + var credentials = CredentialsProvider.GetCredentials(); + + // Get the connection for the current server and user + bool isFree = ConnectionPool.AcquireLock(out instance, Hostname, Port, IsSecured, credentials.Claim, credentials.Evidence); + + if (isFree == false) + return ConnectResult.Delay; + + connection = instance; + + try + { + connection.Open(); + connection.Authenticate(); + + return ConnectResult.Success; + } + catch (ChannelAuthenticationException ex) + { + AuthMessage = ex.Message; + + return ConnectResult.AuthFailure; + } + } + + public IEnumerable GetFolders() + { + yield return new ChannelFolder("inbox", "inbox", ChannelFolderType.Inbox); + } + + public void SelectFolder(ChannelFolder folder) + { + } + + public IEnumerable GetHeaders() + { + BuildMessages(); + + foreach (var item in messages.Skip((int)StartIndex).Take((int)PageSize)) + { + yield return new ChannelMessageHeader { MessageNumber = item.SequenceNumber.ToString(), Size = item.Size }; + } + } + + public IEnumerable GetMessage(ChannelMessageHeader header) + { + using (var ms = new MemoryStream()) + { + connection.Client.GetMessage(Int32.Parse(header.MessageNumber), ms); + + yield return ChannelMessageParser.From(ms, header); + } + } + + public long GetNumberOfItems() + { + BuildMessages(); + + return messages.Count; + } + + public bool Disconnect() + { + if (connection != null) + ConnectionPool.ReleaseLock(connection); + + return true; + } + + public IClientInputChannel Clone() + { + Pop3ClientChannel channel = new Pop3ClientChannel(); + channel.Hostname = Hostname; + channel.Port = Port; + channel.IsSecured = IsSecured; + channel.MaxConcurrentConnections = MaxConcurrentConnections; + channel.CredentialsProvider = CredentialsProvider; + + return channel; + } + + protected void BuildMessages() + { + // Only fetch messages when list is null because otherwise we would end up + // downloading the mailbox headers twice, which can be quite annoying with large mailboxes + if (messages == null) + messages = connection.Client.List(); + } + + public override void Dispose() + { + if (connection != null) + { + Disconnect(); + + connection.Close(); + } + } + } +} diff --git a/Code/Channels/Pop3/Pop3Connection.cs b/Code/Channels/Pop3/Pop3Connection.cs new file mode 100644 index 0000000..9a1946c --- /dev/null +++ b/Code/Channels/Pop3/Pop3Connection.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using Inbox2.Platform.Channels.Connections; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Exceptions; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Logging; +using LumiSoft.Net.POP3.Client; +using Logger=Inbox2.Platform.Logging.Logger; + +namespace Inbox2.Channels.Pop3 +{ + public class Pop3Connection : ChannelConnectionBase + { + #region Fields + + private POP3_Client client; + + #endregion + + #region Properties + + internal POP3_Client Client + { + get { return client; } + } + + #endregion + + #region Constructors + + public Pop3Connection(string hostname, int port, bool isSecured, string username, string password) + : base(hostname, port, isSecured, username, password) + { + } + + #endregion + + public override void Open() + { + if (!(channelState == ChannelState.Closed || channelState == ChannelState.Broken)) + { + return; + } + + channelState = ChannelState.Connecting; + + try + { + client = new POP3_Client(); + + if ("/Settings/Channels/LoggerEnabled".AsKey(false)) + { + client.Logger = new LumiSoft.Net.Log.Logger(); + client.Logger.WriteLog += (sender, e) => Logger.Debug(e.LogEntry.Text, LogSource.Channel); + } + + client.Connect(Hostname, Port, IsSecured); + + channelState = ChannelState.Connected; + } + catch (Exception ex) + { + channelState = ChannelState.Closed; + + throw new ChannelException("Unable to connect to server", ex); + } + } + + public override void Close() + { + if (client != null && client.IsConnected) + { + client.Disconnect(); + client.Dispose(); + } + + channelState = ChannelState.Closed; + } + + public override void Authenticate() + { + if (channelState == ChannelState.Authenticated) + return; + + if (channelState != ChannelState.Connected) + throw new ChannelException("Unable to authenticate in current channel state"); + + try + { + client.Authenticate(Username, Password, true); + + channelState = ChannelState.Authenticated; + } + catch (POP3_ClientException ex) + { + channelState = ChannelState.Broken; + + Logger.Debug("FAILED Authenticating connection {0}. Server said {1}", LogSource.Channel, UniqueId, ex.ResponseText); + + throw new ChannelAuthenticationException(ex.ResponseText, ex); + } + } + + public override void Dispose() + { + } + } +} diff --git a/Code/Channels/Pop3/Properties/AssemblyInfo.cs b/Code/Channels/Pop3/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6ba2e47 --- /dev/null +++ b/Code/Channels/Pop3/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2.Channels.Pop3")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2.Channels.Pop3")] +[assembly: AssemblyCopyright("Copyright Tabdeelee © 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("732178c0-d68f-49a3-bb0e-3d221dccb6cf")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Code/Channels/Smtp/Inbox2.Channels.Smtp.csproj b/Code/Channels/Smtp/Inbox2.Channels.Smtp.csproj new file mode 100644 index 0000000..03fed9a --- /dev/null +++ b/Code/Channels/Smtp/Inbox2.Channels.Smtp.csproj @@ -0,0 +1,159 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {D977B2FC-E1BE-410E-8544-8B7263AB44C6} + Library + Properties + Inbox2.Channels.Smtp + Inbox2.Channels.Smtp + v3.5 + 512 + + + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\..\Stable Assemblies\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + + + + + + + + {7AB36CCF-5FFD-4780-A54E-A102ECA028B5} + LumiSoft.Net + + + {43B96CD2-D7DA-4286-A209-EE9585EF6927} + Inbox2.Platform.Channels + + + {FB90E43A-0E32-41D5-A7AB-83EA0D936E5E} + Inbox2.Platform.Framework + + + {B9CE1540-1D68-43B2-83DB-47EC21D158A6} + Inbox2.Platform.Interfaces + + + + + + 3.5 + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + \ No newline at end of file diff --git a/Code/Channels/Smtp/Properties/AssemblyInfo.cs b/Code/Channels/Smtp/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..44459eb --- /dev/null +++ b/Code/Channels/Smtp/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2.Channels.Smtp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2.Channels.Smtp")] +[assembly: AssemblyCopyright("Copyright © Tabdeelee 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3dedd518-2d00-4138-bb00-ad573536e263")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Code/Channels/Smtp/SmtpClientChannel.cs b/Code/Channels/Smtp/SmtpClientChannel.cs new file mode 100644 index 0000000..b2547c0 --- /dev/null +++ b/Code/Channels/Smtp/SmtpClientChannel.cs @@ -0,0 +1,227 @@ +using System; +using System.IO; +using System.Net.Mail; +using System.Net.Mime; +using System.Text; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Exceptions; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Framework.Interop; +using LumiSoft.Net.Mail; +using LumiSoft.Net.MIME; +using LumiSoft.Net.SMTP.Client; + +namespace Inbox2.Channels.Smtp +{ + public class SmtpClientChannel : IClientOutputChannel + { + public string Hostname { get; set; } + + public int Port { get; set; } + + public bool IsSecured { get; set; } + + public bool IsEnabled + { + get { return true; } + set { } + } + + public int MaxConcurrentConnections { get; set; } + + public IChannelCredentialsProvider CredentialsProvider { get; set; } + + public string Protocol + { + get { return "SMTP"; } + } + + public void Send(ChannelMessage message) + { + var creds = CredentialsProvider.GetCredentials().ToNetworkCredential(); + + Mail_Message msg = new Mail_Message(); + + msg.MimeVersion = "1.0"; + msg.MessageID = MIME_Utils.CreateMessageID(); + msg.Subject = message.Context; + msg.From = message.From.ToMailBoxList(); + msg.ReplyTo = message.ReturnTo == null ? + message.From.ToAddressList() : message.ReturnTo.ToAddressList(); + + if (String.IsNullOrEmpty(message.InReplyTo) == false) + msg.InReplyTo = message.InReplyTo; + + msg.To = new Mail_t_AddressList(); + foreach (var address in message.To) + msg.To.Add(address.ToMailBox()); + + msg.Cc = new Mail_t_AddressList(); + foreach (var address in message.CC) + msg.Cc.Add(address.ToMailBox()); + + //--- multipart/mixed ------------------------------------------------------------------------------------------------- + MIME_h_ContentType contentType_multipartMixed = new MIME_h_ContentType(MIME_MediaTypes.Multipart.mixed); + contentType_multipartMixed.Param_Boundary = Guid.NewGuid().ToString().Replace('-', '.'); + MIME_b_MultipartMixed multipartMixed = new MIME_b_MultipartMixed(contentType_multipartMixed); + msg.Body = multipartMixed; + + //--- multipart/alternative ----------------------------------------------------------------------------------------- + MIME_Entity entity_multipartAlternative = new MIME_Entity(); + MIME_h_ContentType contentType_multipartAlternative = new MIME_h_ContentType(MIME_MediaTypes.Multipart.alternative); + contentType_multipartAlternative.Param_Boundary = Guid.NewGuid().ToString().Replace('-', '.'); + MIME_b_MultipartAlternative multipartAlternative = new MIME_b_MultipartAlternative(contentType_multipartAlternative); + entity_multipartAlternative.Body = multipartAlternative; + multipartMixed.BodyParts.Add(entity_multipartAlternative); + + //--- text/plain ---------------------------------------------------------------------------------------------------- + MIME_Entity entity_text_plain = new MIME_Entity(); + MIME_b_Text text_plain = new MIME_b_Text(MIME_MediaTypes.Text.plain); + entity_text_plain.Body = text_plain; + // Add text body if there is any + if (message.BodyText != null && message.BodyText.Length > 0) + { + var bodyText = message.BodyText.ReadString(); + + // Make sure there is a newline at the end of our text, otherwise it will screw up + // our multipart data format + if (!bodyText.EndsWith(Environment.NewLine)) + bodyText = bodyText + Environment.NewLine; + + text_plain.SetText(MIME_TransferEncodings.SevenBit, Encoding.UTF8, bodyText); + } + + multipartAlternative.BodyParts.Add(entity_text_plain); + + //--- text/html ------------------------------------------------------------------------------------------------------ + MIME_Entity entity_text_html = new MIME_Entity(); + MIME_b_Text text_html = new MIME_b_Text(MIME_MediaTypes.Text.html); + entity_text_html.Body = text_html; + if (message.BodyHtml != null && message.BodyHtml.Length > 0) + { + var bodyHtml = message.BodyHtml.ReadString(); + + // Make sure there is a newline at the end of our text, otherwise it will screw up + // our multipart data format + if (!bodyHtml.EndsWith(Environment.NewLine)) + bodyHtml = bodyHtml + Environment.NewLine; + + text_html.SetText(MIME_TransferEncodings.SevenBit, Encoding.UTF8, bodyHtml); + } + + multipartAlternative.BodyParts.Add(entity_text_html); + + foreach (var channelAttachment in message.Attachments) + { + MIME_b_Application attachmentBody = new MIME_b_Application(MIME_MediaTypes.Application.octet_stream); + MIME_Entity attachment = new MIME_Entity(); + attachment.Body = attachmentBody; + + // Has to happen before the following lines of code + multipartMixed.BodyParts.Add(attachment); + + attachment.ContentType = new MIME_h_ContentType(MimeHelper.GetMimeType(channelAttachment.Filename)); + attachment.ContentType.Param_Name = channelAttachment.Filename; + + MIME_h_ContentDisposition contentDisposition = new MIME_h_ContentDisposition(DispositionTypeNames.Attachment); + contentDisposition.Param_FileName = channelAttachment.Filename; + + attachment.ContentDisposition = contentDisposition; + attachment.ContentTransferEncoding = TransferEncoding.Base64.ToString(); + + attachmentBody.SetData(channelAttachment.ContentStream, MIME_TransferEncodings.Base64); + } + + // Inject headers + if (!String.IsNullOrEmpty(message.MessageIdentifier)) + msg.Header.Add(new MIME_h_Unstructured("x-i2mp-messageid", message.MessageIdentifier)); + + //if (!String.IsNullOrEmpty(message.Metadata.i2mpFlow)) + // msg.Header.Add(new MIME_h_Unstructured("x-i2mp-flow", message.Metadata.i2mpFlow)); + + //if (!String.IsNullOrEmpty(message.Metadata.i2mpReference)) + // mailMessage.Headers.Add("X-i2mp-ref", message.Metadata.i2mpReference); + + //if (!String.IsNullOrEmpty(message.Metadata.i2mpSequence)) + // mailMessage.Headers.Add("X-i2mp-seq", message.Metadata.i2mpSequence); + + //if (!String.IsNullOrEmpty(message.Metadata.i2mpRelation)) + // mailMessage.Headers.Add("X-i2mp-rel", message.Metadata.i2mpRelation); + + //if (!String.IsNullOrEmpty(message.Metadata.i2mpRelationId)) + // mailMessage.Headers.Add("X-i2mp-rel-id", message.Metadata.i2mpRelationId); + + + // Send message + try + { + SMTP_Client client = new SMTP_Client(); + + if ("/Settings/Channels/LoggerEnabled".AsKey(false)) + client.Logger = new LumiSoft.Net.Log.Logger(); + + // todo push this logic into the smtp client implementation itself + if (Hostname == "smtp.live.com") + { + // Hack for hotmail, first do a connect with no secured channel, + // then a STARTTLS + client.Connect(Hostname, Port, false); + client.StartTLS(); + } + else + { + client.Connect(Hostname, Port, IsSecured); + } + + client.Authenticate(creds.UserName, creds.Password); + + using (MemoryStream ms = new MemoryStream()) + { + client.MailFrom(msg.From[0].Address, -1); + + msg.ToStream(ms, + new MIME_Encoding_EncodedWord(MIME_EncodedWordEncoding.Q, Encoding.UTF8), Encoding.UTF8); + + // Reset stream + ms.Seek(0, SeekOrigin.Begin); + + foreach (var address in message.To) + client.RcptTo(address.Address); + + foreach (var address in message.CC) + client.RcptTo(address.Address); + + foreach (var address in message.BCC) + client.RcptTo(address.Address); + + try + { + client.SendMessage(ms); + } + finally + { + client.Dispose(); + } + } + } + catch(SmtpFailedRecipientsException e) + { + throw new ChannelFunctionalException(e.Message, e) { DoNotRetry = true }; + } + catch (SmtpException e) + { + throw new ChannelFunctionalException(e.Message, e); + } + catch (Exception e) + { + throw new ChannelFunctionalException(e.Message, e); + } + } + + public void Dispose() + { + + } + } +} diff --git a/Code/Channels/Smtp/SourceAddressExtensions.cs b/Code/Channels/Smtp/SourceAddressExtensions.cs new file mode 100644 index 0000000..e9b8b13 --- /dev/null +++ b/Code/Channels/Smtp/SourceAddressExtensions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Channels.Entities; +using LumiSoft.Net.Mail; + +namespace Inbox2.Channels.Smtp +{ + public static class SourceAddressExtensions + { + public static Mail_t_MailboxList ToMailBoxList(this SourceAddress address) + { + return new Mail_t_MailboxList { address.ToMailBox() }; + } + + public static Mail_t_AddressList ToAddressList(this SourceAddress address) + { + return new Mail_t_AddressList { address.ToMailBox() }; + } + + public static Mail_t_Mailbox ToMailBox(this SourceAddress address) + { + return new Mail_t_Mailbox(address.DisplayName, address.Address); + } + } +} diff --git a/Code/Channels/Twitter/ChannelHelper.cs b/Code/Channels/Twitter/ChannelHelper.cs new file mode 100644 index 0000000..bd957c6 --- /dev/null +++ b/Code/Channels/Twitter/ChannelHelper.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.ServiceModel; +using System.ServiceModel.Channels; +using System.ServiceModel.Description; +using System.Text; +using Inbox2.Platform.Channels; + +namespace Inbox2.Channels.Twitter +{ + static class ChannelHelper + { + public const string ConsumerKey = "IoP4hAoBrVYsEBpL5R1g"; + public const string ConsumerSecret = "k44MoU6qb1UEOE1d2p7sROblE50sCwQfa9ug0lthC8g"; + + public static string Token + { + get { return ChannelContext.Current.ClientContext.GetSetting("/Channels/Twitter/AuthToken") as string; } + } + + public static string TokenSecret + { + get { return ChannelContext.Current.ClientContext.GetSetting("/Channels/Twitter/AuthSecret") as string; } + } + } +} \ No newline at end of file diff --git a/Code/Channels/Twitter/Inbox2.Channels.Twitter.csproj b/Code/Channels/Twitter/Inbox2.Channels.Twitter.csproj new file mode 100644 index 0000000..fbc08e6 --- /dev/null +++ b/Code/Channels/Twitter/Inbox2.Channels.Twitter.csproj @@ -0,0 +1,210 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {968A7025-B578-40BA-8FE1-5119746DDB24} + Library + Properties + Inbox2.Channels.Twitter + Inbox2.Channels.Twitter + v3.5 + 512 + OnOutputUpdated + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\..\Stable Assemblies\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + ..\..\..\ThirdParty\TweetSharp\Hammock.ClientProfile.dll + + + False + ..\..\Stable Assemblies\Inbox2.Platform.Logging.dll + + + + False + ..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + 3.5 + + + 3.0 + + + 3.0 + + + 3.5 + + + + 3.5 + + + 3.5 + + + + + ..\..\..\ThirdParty\TweetSharp\TweetSharp.dll + + + + + + + + + + + + + + {43B96CD2-D7DA-4286-A209-EE9585EF6927} + Inbox2.Platform.Channels + + + {FB90E43A-0E32-41D5-A7AB-83EA0D936E5E} + Inbox2.Platform.Framework + + + {B9CE1540-1D68-43B2-83DB-47EC21D158A6} + Inbox2.Platform.Interfaces + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Code/Channels/Twitter/Properties/AssemblyInfo.cs b/Code/Channels/Twitter/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..bee87ff --- /dev/null +++ b/Code/Channels/Twitter/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2.Channels.Twitter")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2.Channels.Twitter")] +[assembly: AssemblyCopyright("Copyright © Tabdeelee 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7e564a5a-6c20-4887-bfe6-9e4635500bd4")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Code/Channels/Twitter/Resources/icon-10.png b/Code/Channels/Twitter/Resources/icon-10.png new file mode 100644 index 0000000..ecf6c51 Binary files /dev/null and b/Code/Channels/Twitter/Resources/icon-10.png differ diff --git a/Code/Channels/Twitter/Resources/icon-13.png b/Code/Channels/Twitter/Resources/icon-13.png new file mode 100644 index 0000000..bb4ef6e Binary files /dev/null and b/Code/Channels/Twitter/Resources/icon-13.png differ diff --git a/Code/Channels/Twitter/Resources/icon-64.png b/Code/Channels/Twitter/Resources/icon-64.png new file mode 100644 index 0000000..1a841ad Binary files /dev/null and b/Code/Channels/Twitter/Resources/icon-64.png differ diff --git a/Code/Channels/Twitter/TwitterClientChannel.cs b/Code/Channels/Twitter/TwitterClientChannel.cs new file mode 100644 index 0000000..4828ffb --- /dev/null +++ b/Code/Channels/Twitter/TwitterClientChannel.cs @@ -0,0 +1,299 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Web; +using System.Xml.Linq; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Framework.OAuth; +using TweetSharp; + +namespace Inbox2.Channels.Twitter +{ + public class TwitterClientChannel : IClientInputChannel, IClientOutputChannel, IClientContactsChannel, IClientStatusUpdatesChannel + { + #region Properties + + public IChannelCredentialsProvider CredentialsProvider { get; set; } + + public string Hostname + { + get { return "http://twitter.com"; } + set { } + } + + public int Port + { + get { return 80; } + set { } + } + + public bool IsSecured + { + get { return false; } + set { } + } + + public int MaxConcurrentConnections + { + get { return 2; } + set { } + } + + public bool IsEnabled { get; set; } + + public string Protocol + { + get { return "Twitter API"; } + } + + public string SourceAdress + { + get { return CredentialsProvider.GetCredentials().Claim; } + } + + public string AuthMessage { get; private set; } + + #endregion + + public ConnectResult Connect() + { + return ConnectResult.Success; + } + + public IEnumerable GetFolders() + { + yield return new ChannelFolder("inbox", "inbox", ChannelFolderType.Inbox); + } + + public void SelectFolder(ChannelFolder folder) + { + } + + public IEnumerable GetHeaders() + { + return GetDirectMessages(); + } + + public IEnumerable GetMessage(ChannelMessageHeader header) + { + ChannelMessage message = new ChannelMessage(); + message.MessageNumber = header.MessageNumber; + message.MessageIdentifier = header.MessageIdentifier; + message.From = header.From; + message.Context = header.Context; + message.BodyText = header.Body.ToStream(); + message.DateReceived = header.DateReceived; + message.IsRead = true; + + yield return message; + } + + public IEnumerable GetDirectMessages() + { + var service = new TwitterService(ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + var result = service.ListDirectMessagesReceived().Union(service.ListDirectMessagesSent()); + + foreach (var dm in result) + { + yield return new ChannelMessageHeader + { + MessageIdentifier = dm.Id.ToString(), + MessageNumber = dm.Id.ToString(), + Context = String.Format("DM from {0}", dm.Sender.Name), + From = new SourceAddress(dm.Sender.Id.ToString(), dm.Sender.Name), + Body = dm.TextAsHtml, + DateReceived = dm.CreatedDate.ToLocalTime() + }; + + } + } + + public ChannelSocialProfile GetProfile() + { + var service = new TwitterService(ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + var result = service.GetUserProfile(); + + return new ChannelSocialProfile + { + Id = result.Id.ToString(), + FullName = result.Name, + AvatarUrl = result.ProfileImageUrl + }; + } + + public IEnumerable GetContacts() + { + var service = new TwitterService(ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + var result = service.ListFriends(); + + foreach (var user in result) + { + var contact = new ChannelContact { IsSoft = true }; + + contact.Profile.ChannelProfileKey = user.Id.ToString(); + contact.Person.Name = user.Name; + contact.Profile.ScreenName = user.ScreenName; + contact.Profile.SourceAddress = new SourceAddress(user.Id.ToString(), user.Name); + contact.Profile.ProfileType = ProfileType.Social; + contact.Profile.Url = user.Url; + contact.Profile.Title = user.Description; + contact.Profile.Location = user.Location; + contact.Profile.ChannelAvatar = new ChannelAvatar(); + contact.Profile.ChannelAvatar.Url = user.ProfileImageUrl; + + yield return contact; + } + } + + IClientContactsChannel IClientContactsChannel.Clone() + { + return new TwitterClientChannel + { + Hostname = Hostname, + Port = Port, + IsSecured = IsSecured, + MaxConcurrentConnections = MaxConcurrentConnections, + CredentialsProvider = CredentialsProvider + }; + } + + public void Send(ChannelMessage message) + { + var service = new TwitterService(ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + + foreach (var singleToName in message.To) + { + service.SendDirectMessage(Int32.Parse(singleToName.Address), message.BodyText.ReadString()); + } + } + + public IEnumerable GetMentions(int pageSize) + { + var service = new TwitterService(ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + var result = service.ListTweetsMentioningMe(); + + foreach (var tweet in result) + { + yield return new ChannelStatusUpdate + { + ChannelStatusKey = tweet.Id.ToString(), + Status = tweet.Text, + From = new SourceAddress( + tweet.User.ScreenName, + tweet.User.Name, + tweet.User.ProfileImageUrl.Replace("_normal.jpg", "_mini.jpg")), + DatePosted = tweet.CreatedDate + }; + } + } + + public IEnumerable GetUpdates(int pageSize) + { + var service = new TwitterService(ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + var result = service.ListTweetsOnFriendsTimeline(); + + foreach (var tweet in result) + { + yield return new ChannelStatusUpdate + { + ChannelStatusKey = tweet.Id.ToString(), + Status = tweet.Text, + From = new SourceAddress( + tweet.User.ScreenName, + tweet.User.Name, + tweet.User.ProfileImageUrl.Replace("_normal.jpg", "_mini.jpg")), + DatePosted = tweet.CreatedDate + }; + } + } + + public IEnumerable GetUserUpdates(string username, int count) + { + var service = new TwitterService(ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + var result = service.ListTweetsOnSpecifiedUserTimeline(Int32.Parse(username)); + + foreach (var tweet in result) + { + yield return new ChannelStatusUpdate + { + ChannelStatusKey = tweet.Id.ToString(), + Status = tweet.Text, + From = new SourceAddress( + tweet.User.ScreenName, + tweet.User.Name, + tweet.User.ProfileImageUrl.Replace("_normal.jpg", "_mini.jpg")), + DatePosted = tweet.CreatedDate + }; + } + } + + public IEnumerable GetUpdates(string keyword, int pageSize) + { + var service = new TwitterService(ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + var result = service.Search(keyword, pageSize); + + foreach (var tweet in result.Statuses) + { + yield return new ChannelStatusUpdate + { + ChannelStatusKey = tweet.Id.ToString(), + Status = tweet.Text, + From = new SourceAddress( + tweet.Author.ScreenName, + tweet.Author.ScreenName, + tweet.Author.ProfileImageUrl.Replace("_normal.jpg", "_mini.jpg")), + DatePosted = tweet.CreatedDate + }; + } + } + + public void UpdateMyStatus(ChannelStatusUpdate update) + { + var service = new TwitterService(ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + + if (!String.IsNullOrEmpty(update.InReplyTo)) + service.SendTweet(update.Status, Int64.Parse(update.InReplyTo)); + else + service.SendTweet(update.Status); + } + + IClientStatusUpdatesChannel IClientStatusUpdatesChannel.Clone() + { + return new TwitterClientChannel + { + Hostname = Hostname, + Port = Port, + IsSecured = IsSecured, + MaxConcurrentConnections = MaxConcurrentConnections, + CredentialsProvider = CredentialsProvider + }; + } + + public bool Disconnect() + { + return true; + } + + public IClientInputChannel Clone() + { + TwitterClientChannel channel = new TwitterClientChannel(); + channel.Hostname = Hostname; + channel.Port = Port; + channel.IsSecured = IsSecured; + channel.MaxConcurrentConnections = MaxConcurrentConnections; + channel.CredentialsProvider = CredentialsProvider; + + return channel; + } + + public void Dispose() + { + + } + } +} diff --git a/Code/Channels/Twitter/TwitterConfiguration.cs b/Code/Channels/Twitter/TwitterConfiguration.cs new file mode 100644 index 0000000..aede230 --- /dev/null +++ b/Code/Channels/Twitter/TwitterConfiguration.cs @@ -0,0 +1,72 @@ +using System; +using System.ComponentModel.Composition; +using System.Xml.Serialization; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Interfaces.Enumerations; + +namespace Inbox2.Channels.Twitter +{ + [Serializable] + [Export(typeof(ChannelConfiguration))] + public class TwitterConfiguration : ChannelConfiguration + { + public TwitterConfiguration() + { + InnerInputChannel = new Channel { Type = typeof(TwitterClientChannel) }; + InnerOutputChannel = new Channel { Type = typeof(TwitterClientChannel) }; + InnerContactsChannel = new Channel { Type = typeof(TwitterClientChannel) }; + InnerStatusUpdatesChannel = new Channel { Type = typeof(TwitterClientChannel) }; + } + + public override DisplayStyle DisplayStyle + { + get { return DisplayStyle.Redirect; } + } + + public override string DisplayName + { + get { return "Twitter"; } + } + + public override ChannelCharasteristics Charasteristics + { + get + { + var charasteristics = base.Charasteristics; + + charasteristics.SupportsEmail = false; + charasteristics.SupportsHtml = false; + charasteristics.SupportsPublicMessage = true; + charasteristics.SupportsSubject = false; + charasteristics.SupportsStatusUpdates = true; + charasteristics.CanSendFiles = false; + charasteristics.SupportsReadStates = false; + charasteristics.SupportsStatusUpdateMentions = true; + charasteristics.SupportsStatusUpdatesSearch = true; + charasteristics.SupportsStatusUpdatesReply = true; + charasteristics.SupportsProfiles = true; + charasteristics.MaxBodyChars = 140; + + return charasteristics; + } + } + + public override IWebRedirectBuilder RedirectBuilder + { + get { return new TwitterRedirectBuilder(); } + } + + public override ChannelProfileInfoBuilder ProfileInfoBuilder + { + get { return new TwitterProfileInfoBuilder(); } + } + + public override ChannelConfiguration Clone() + { + return this.DeepCopy(new XmlSerializer(typeof(TwitterConfiguration))); + } + } +} diff --git a/Code/Channels/Twitter/TwitterProfileInfoBuilder.cs b/Code/Channels/Twitter/TwitterProfileInfoBuilder.cs new file mode 100644 index 0000000..9d8c817 --- /dev/null +++ b/Code/Channels/Twitter/TwitterProfileInfoBuilder.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Entities; + +namespace Inbox2.Channels.Twitter +{ + public class TwitterProfileInfoBuilder : ChannelProfileInfoBuilder + { + public override string StreamUrl + { + get { return "http://twitter.com/home"; } + } + + public override string BuildServiceProfileUrl(SourceAddress address) + { + return String.Format("http://www.twitter.com/{0}", address.Address); + } + + public override string BuildServiceProfileUrl(ChannelProfile profile) + { + return String.Format("http://www.twitter.com/{0}", profile.ScreenName); + } + } +} diff --git a/Code/Channels/Twitter/TwitterRedirectBuilder.cs b/Code/Channels/Twitter/TwitterRedirectBuilder.cs new file mode 100644 index 0000000..7c8f971 --- /dev/null +++ b/Code/Channels/Twitter/TwitterRedirectBuilder.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Channels.Text; +using Inbox2.Platform.Framework; + +namespace Inbox2.Channels.Twitter +{ + public class TwitterRedirectBuilder : IWebRedirectBuilder + { + private string username; + + public string Token { get; set; } + + public string TokenSecret { get; set; } + + public string SuccessUri + { + get { return "http://jump.inbox2.com/channels/twitter"; } + } + + public TwitterRedirectBuilder() + { + Token = SafeSession.Current["/Channels/Twitter/Redirect/Token"] as string; + TokenSecret = SafeSession.Current["/Channels/Twitter/Redirect/TokenSecret"] as string; + } + + public Uri BuildRedirectUri() + { + var result = TwitterWebRequest.PerformRequest(new Uri("http://api.twitter.com/oauth/request_token"), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret); + var parts = NameValueParser.GetCollection(result, "&"); + + Token = parts["oauth_token"]; + TokenSecret = parts["oauth_token_secret"]; + + // Save data in session for re-materialization + SafeSession.Current["/Channels/Twitter/Redirect/Token"] = Token; + SafeSession.Current["/Channels/Twitter/Redirect/TokenSecret"] = TokenSecret; + + return new Uri("https://api.twitter.com/oauth/authorize?oauth_token=" + Token); + } + + public string ParseVerifier(string returnValue) + { + return NameValueParser.GetCollection(new Uri(returnValue).Query, "&")["oauth_verifier"]; + } + + public bool ValidateReturnValue(string verifier) + { + // 2. Exchange auth.token for access.token + var result = TwitterWebRequest.PerformRequest(new Uri("https://api.twitter.com/oauth/access_token?callback_token=" + verifier), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, Token, TokenSecret, verifier); + + var parts = NameValueParser.GetCollection(result, "&"); + + if (ChannelContext.Current == null) + throw new ArgumentNullException("ChannelContext.Current"); + + // Remove token from session + SafeSession.Current.Remove("/Channels/Twitter/Redirect/Token"); + SafeSession.Current.Remove("/Channels/Twitter/Redirect/TokenSecret"); + + // 7. Save auth keys + ChannelContext.Current.ClientContext.SaveSetting("/Channels/Twitter/AuthToken", parts["oauth_token"]); + ChannelContext.Current.ClientContext.SaveSetting("/Channels/Twitter/AuthSecret", parts["oauth_token_secret"]); + + Token = parts["oauth_token"]; + TokenSecret = parts["oauth_token_secret"]; + + username = parts["screen_name"]; + + return true; + } + + public string GetUsername() + { + return username; + } + } +} diff --git a/Code/Channels/Twitter/TwitterWebRequest.cs b/Code/Channels/Twitter/TwitterWebRequest.cs new file mode 100644 index 0000000..712d55d --- /dev/null +++ b/Code/Channels/Twitter/TwitterWebRequest.cs @@ -0,0 +1,158 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using System.Web; +using System.Xml.Linq; +using Inbox2.Platform.Channels.Extensions; +using Inbox2.Platform.Channels.Text; +using Inbox2.Platform.Framework.OAuth; + +namespace Inbox2.Channels.Twitter +{ + public class TwitterWebRequest + { + public static string Put(Uri sourceUri, string data, string consumerKey, string consumerSecret, string token, string tokenSecret) + { + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sourceUri); + request.Method = "PUT"; + //request.ContentType = "application/x-www-form-urlencoded"; + request.UserAgent = "inbox2"; + string authParams = BuildOAuthParams(sourceUri, consumerKey, consumerSecret, token, tokenSecret, null, "PUT"); + request.Headers.Add("Authorization", authParams); + + byte[] bytes = Encoding.UTF8.GetBytes(data); + request.ContentLength = bytes.Length; + + // Write post data to request stream + using (Stream requestStream = request.GetRequestStream()) + requestStream.Write(bytes, 0, bytes.Length); + + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + using (var responseStream = response.GetResponseStream()) + return responseStream.ReadString(); + } + + public static string PerformRequest(Uri sourceUri, string consumerKey, string consumerSecret) + { + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sourceUri); + request.Method = "POST"; + request.ContentType = "application/x-www-form-urlencoded"; + request.UserAgent = "inbox2"; + string authParams = BuildOAuthParams(sourceUri, consumerKey, consumerSecret, null, null, null); + request.Headers.Add("Authorization", authParams); + + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + using (var responseStream = response.GetResponseStream()) + return responseStream.ReadString(); + } + + public static string PerformRequest(Uri sourceUri, string consumerKey, string consumerSecret, string token, string tokenSecret, string verifier) + { + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sourceUri); + request.Method = "POST"; + request.ContentType = "application/x-www-form-urlencoded"; + request.UserAgent = "inbox2"; + string authParams = BuildOAuthParams(sourceUri, consumerKey, consumerSecret, token, tokenSecret, verifier); + request.Headers.Add("Authorization", authParams); + + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + using (var responseStream = response.GetResponseStream()) + return responseStream.ReadString(); + } + + public static XDocument PerformRequest(Uri sourceUri, string consumerKey, string consumerSecret, string token, string tokenSecret, byte[] bytes) + { + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sourceUri); + request.Method = "POST"; + request.ContentType = "application/x-www-form-urlencoded"; + request.UserAgent = "inbox2"; + request.Headers.Add("Authorization", BuildOAuthParams(sourceUri, consumerKey, consumerSecret, token, tokenSecret, null)); + + request.ServicePoint.Expect100Continue = false; + request.ContentLength = bytes.Length; + + // Write post data to request stream + using (Stream requestStream = request.GetRequestStream()) + requestStream.Write(bytes, 0, bytes.Length); + + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + using (var responseStream = response.GetResponseStream()) + return XDocument.Parse(responseStream.ReadString()); + } + + public static XDocument PerformRequest(Uri sourceUri, string consumerKey, string consumerSecret, string token, string tokenSecret) + { + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sourceUri); + request.Method = "GET"; + request.UserAgent = "inbox2"; + string authParams = BuildOAuthParams(sourceUri, consumerKey, consumerSecret, token, tokenSecret, null, "GET"); + request.Headers.Add("Authorization", authParams); + + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + string responseString; + using (var responseStream = response.GetResponseStream()) + responseString = responseStream.ReadString(); + + return XDocument.Parse(responseString); + } + + static string BuildOAuthParams(Uri source, string consumerKey, string consumerSecret, string token, string tokenSecret, string verifier) + { + return BuildOAuthParams(source, consumerKey, consumerSecret, token, tokenSecret, verifier, "POST"); + } + + static string BuildOAuthParams(Uri source, string consumerKey, string consumerSecret, string token, string tokenSecret, string verifier, string httpMethod) + { + OAuthBase oauth = new OAuthBase(); + + string timeStamp = OAuthBase.GenerateTimeStamp(); + string nonce = OAuthBase.GenerateNonce(); + + // Calling source.Query returns an urlencoded string, but we don't want that since we will use + // oauth.UrlEncode ourselves + var query = HttpUtility.UrlDecode(source.Query.Contains("?") ? source.Query.Remove(0, 1) : source.Query); + var parameters = NameValueParser.GetCollection(query, "&"); + + parameters.Add("oauth_nonce", nonce); + parameters.Add("oauth_signature_method", "HMAC-SHA1"); + + parameters.Add("oauth_timestamp", timeStamp); + parameters.Add("oauth_consumer_key", consumerKey); + + if (!String.IsNullOrEmpty(token)) + parameters.Add("oauth_token", token); + + if (!String.IsNullOrEmpty(verifier)) + parameters.Add("oauth_verifier", verifier); + + parameters.Add("oauth_version", "1.0"); + + StringBuilder requestBuilder = new StringBuilder(); + + string signature = oauth.GenerateSignature(source, parameters, consumerKey, consumerSecret, token, tokenSecret, httpMethod, timeStamp, nonce, OAuthBase.SignatureTypes.HMACSHA1); + + parameters.Add("oauth_signature", signature); + + requestBuilder.Append("OAuth "); + + foreach (string key in parameters) + { + requestBuilder.Append(key); + requestBuilder.Append("="); + requestBuilder.Append(@"""" + OAuthBase.UrlEncode(parameters[key]) + @""""); + + requestBuilder.Append(", "); + } + + return requestBuilder.ToString(); + } + } +} diff --git a/Code/Channels/Yahoo/Inbox2.Channels.Yahoo.csproj b/Code/Channels/Yahoo/Inbox2.Channels.Yahoo.csproj new file mode 100644 index 0000000..3ff59f2 --- /dev/null +++ b/Code/Channels/Yahoo/Inbox2.Channels.Yahoo.csproj @@ -0,0 +1,187 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {65A80A15-DE5B-4A48-9710-05535C803560} + Library + Properties + Inbox2.Channels.Yahoo + Inbox2.Channels.Yahoo + v3.5 + 512 + OnOutputUpdated + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\..\Stable Assemblies\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + + False + ..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + {43B96CD2-D7DA-4286-A209-EE9585EF6927} + Inbox2.Platform.Channels + + + {FB90E43A-0E32-41D5-A7AB-83EA0D936E5E} + Inbox2.Platform.Framework + + + {B9CE1540-1D68-43B2-83DB-47EC21D158A6} + Inbox2.Platform.Interfaces + + + {528A7823-5CED-4E31-ABDF-E1F6F821FCFD} + Inbox2.Channels.Imap2 + + + {60AE3B61-131B-4CC9-B49C-0892E701ACF0} + Inbox2.Channels.Pop3 + + + {D977B2FC-E1BE-410E-8544-8B7263AB44C6} + Inbox2.Channels.Smtp + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Code/Channels/Yahoo/Properties/AssemblyInfo.cs b/Code/Channels/Yahoo/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d1dbf94 --- /dev/null +++ b/Code/Channels/Yahoo/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2.Channels.Yahoo")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2.Channels.Yahoo")] +[assembly: AssemblyCopyright("Copyright Tabdeelee © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7c19a807-c46e-4212-8a20-0c0266b7d191")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Code/Channels/Yahoo/Resources/icon-10.png b/Code/Channels/Yahoo/Resources/icon-10.png new file mode 100644 index 0000000..b3beae5 Binary files /dev/null and b/Code/Channels/Yahoo/Resources/icon-10.png differ diff --git a/Code/Channels/Yahoo/Resources/icon-13.png b/Code/Channels/Yahoo/Resources/icon-13.png new file mode 100644 index 0000000..779db97 Binary files /dev/null and b/Code/Channels/Yahoo/Resources/icon-13.png differ diff --git a/Code/Channels/Yahoo/Resources/icon-64.png b/Code/Channels/Yahoo/Resources/icon-64.png new file mode 100644 index 0000000..3dfa7da Binary files /dev/null and b/Code/Channels/Yahoo/Resources/icon-64.png differ diff --git a/Code/Channels/Yahoo/YahooConfiguration.cs b/Code/Channels/Yahoo/YahooConfiguration.cs new file mode 100644 index 0000000..a22751b --- /dev/null +++ b/Code/Channels/Yahoo/YahooConfiguration.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Linq; +using System.Text; +using System.Xml.Serialization; +using Inbox2.Channels.Imap2; +using Inbox2.Channels.Pop3; +using Inbox2.Channels.Smtp; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Framework.Extensions; + +namespace Inbox2.Channels.Yahoo +{ + [Serializable] + [Export(typeof(ChannelConfiguration))] + public class YahooConfiguration : ChannelConfiguration + { + public YahooConfiguration() + { + InnerInputChannel = new Channel { Type = typeof(Imap2ClientChannel), Hostname = "imap-ssl.mail.yahoo.com", Port = 993, IsSecured = true, MaxConcurrentConnections = 1 }; + InnerOutputChannel = new Channel { Type = typeof(SmtpClientChannel), Hostname = "smtp.mail.yahoo.com", Port = 465, IsSecured = true, MaxConcurrentConnections = 1 }; + } + + public override string DisplayName + { + get { return "Yahoo"; } + } + + public override string DefaultDomain + { + get { return "yahoo.com"; } + } + + public override int PreferredSortOrder + { + get { return 20; } + } + + public override ChannelCharasteristics Charasteristics + { + get + { + var charasteristics = base.Charasteristics; + + charasteristics.SupportsReadStates = false; + charasteristics.CanCustomize = true; + + return charasteristics; + } + } + + public override ChannelConfiguration Clone() + { + return this.DeepCopy(new XmlSerializer(typeof(YahooConfiguration))); + } + } +} diff --git a/Code/Channels/Yammer/ChannelHelper.cs b/Code/Channels/Yammer/ChannelHelper.cs new file mode 100644 index 0000000..3cd4de7 --- /dev/null +++ b/Code/Channels/Yammer/ChannelHelper.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Channels; + +namespace Inbox2.Channels.Yammer +{ + public static class ChannelHelper + { + public const string ConsumerKey = "IR9NNT4JOxODau1wHzySgA"; + public const string ConsumerSecret = "VwkIF3L6ZAVtt7jTDFQbfrfcwDdTgBHa0xN32qeI"; + + public static string Token + { + get { return ChannelContext.Current.ClientContext.GetSetting("/Channels/Yammer/AuthToken") as string; } + } + + public static string TokenSecret + { + get { return ChannelContext.Current.ClientContext.GetSetting("/Channels/Yammer/AuthSecret") as string; } + } + } +} \ No newline at end of file diff --git a/Code/Channels/Yammer/Inbox2.Channels.Yammer.csproj b/Code/Channels/Yammer/Inbox2.Channels.Yammer.csproj new file mode 100644 index 0000000..84146c5 --- /dev/null +++ b/Code/Channels/Yammer/Inbox2.Channels.Yammer.csproj @@ -0,0 +1,142 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {26AEA1C4-FD4D-4E46-A0C6-E3363C24AF8B} + Library + Properties + Inbox2.Channels.Yammer + Inbox2.Channels.Yammer + v3.5 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\..\Stable Assemblies\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + False + ..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + 3.5 + + + 3.0 + + + 3.5 + + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + {43B96CD2-D7DA-4286-A209-EE9585EF6927} + Inbox2.Platform.Channels + + + {FB90E43A-0E32-41D5-A7AB-83EA0D936E5E} + Inbox2.Platform.Framework + + + {B9CE1540-1D68-43B2-83DB-47EC21D158A6} + Inbox2.Platform.Interfaces + + + {6AE2A2AF-9B61-45B0-A375-666C5225A5B4} + Inbox2.Platform.Logging + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + \ No newline at end of file diff --git a/Code/Channels/Yammer/Properties/AssemblyInfo.cs b/Code/Channels/Yammer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9d232a5 --- /dev/null +++ b/Code/Channels/Yammer/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2.Channels.Yammer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2.Channels.Yammer")] +[assembly: AssemblyCopyright("Copyright © Tabdeelee 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("69c3119b-e1f7-4b0b-aa76-b0a4840a030a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Code/Channels/Yammer/Resources/icon-10.png b/Code/Channels/Yammer/Resources/icon-10.png new file mode 100644 index 0000000..ecb10de Binary files /dev/null and b/Code/Channels/Yammer/Resources/icon-10.png differ diff --git a/Code/Channels/Yammer/Resources/icon-13.png b/Code/Channels/Yammer/Resources/icon-13.png new file mode 100644 index 0000000..29422c2 Binary files /dev/null and b/Code/Channels/Yammer/Resources/icon-13.png differ diff --git a/Code/Channels/Yammer/Resources/icon-64.png b/Code/Channels/Yammer/Resources/icon-64.png new file mode 100644 index 0000000..46848db Binary files /dev/null and b/Code/Channels/Yammer/Resources/icon-64.png differ diff --git a/Code/Channels/Yammer/YammerClientChannel.cs b/Code/Channels/Yammer/YammerClientChannel.cs new file mode 100644 index 0000000..b20aa15 --- /dev/null +++ b/Code/Channels/Yammer/YammerClientChannel.cs @@ -0,0 +1,300 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Framework.OAuth; +using Inbox2.Platform.Interfaces.Enumerations; + +namespace Inbox2.Channels.Yammer +{ + public class YammerClientChannel : IClientInputChannel, IClientContactsChannel, IClientStatusUpdatesChannel + { + #region Properties + + public IChannelCredentialsProvider CredentialsProvider { get; set; } + + public string Hostname + { + get { return "http://twitter.com"; } + set { } + } + + public int Port + { + get { return 80; } + set { } + } + + public bool IsSecured + { + get { return false; } + set { } + } + + public int MaxConcurrentConnections + { + get { return 2; } + set { } + } + + public bool IsEnabled { get; set; } + + public string Protocol + { + get { return "Yammer API"; } + } + + public string SourceAdress + { + get { return CredentialsProvider.GetCredentials().Claim; } + } + + public string AuthMessage { get; private set; } + + #endregion + + public ConnectResult Connect() + { + return ConnectResult.Success; + } + + public IEnumerable GetFolders() + { + yield return new ChannelFolder("inbox", "inbox", ChannelFolderType.Inbox); + } + + public void SelectFolder(ChannelFolder folder) + { + } + + public IEnumerable GetHeaders() + { + yield break; + } + + public IEnumerable GetMessage(ChannelMessageHeader header) + { + yield break; + } + + public IEnumerable GetContacts() + { + foreach (var ycontact in GetYammerContacts()) + { + var contact = new ChannelContact(); + contact.Person.Name = ycontact.FullName; + + contact.Profile.ChannelProfileKey = ycontact.Id; + contact.Profile.ProfileType = ProfileType.Social; + contact.Profile.ScreenName = ycontact.ScreenName; + contact.Profile.Url = ycontact.Url; + contact.Profile.Location = ycontact.Location; + contact.Profile.Title = ycontact.Title; + contact.Profile.SourceAddress = new SourceAddress(ycontact.ScreenName, ycontact.FullName); + + contact.Profile.ChannelAvatar = new ChannelAvatar(); + contact.Profile.ChannelAvatar.Url = ycontact.AvatarUrl; + + yield return contact; + } + } + + IClientContactsChannel IClientContactsChannel.Clone() + { + return new YammerClientChannel + { + Hostname = Hostname, + Port = Port, + IsSecured = IsSecured, + MaxConcurrentConnections = MaxConcurrentConnections, + CredentialsProvider = CredentialsProvider + }; + } + + IEnumerable GetYammerContacts() + { + int page = 1; + + while (true) + { + var result = YammerWebRequest.PerformRequest(new Uri("https://www.yammer.com/api/v1/users.xml?page=" + page), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + + if (result.Element("response").Elements().Count() == 0) + yield break; + + foreach (var response in result.Elements("response").Elements("response")) + yield return ParseYammerContact(response); + + page++; + } + } + + public ChannelSocialProfile GetProfile() + { + var result = YammerWebRequest.PerformRequest(new Uri("https://www.yammer.com/api/v1/users/current.xml"), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + + var contact = ParseYammerContact(result.Element("response")); + + return new ChannelSocialProfile + { + Id = contact.Id, + FullName = contact.FullName, + AvatarUrl = contact.AvatarUrl + }; + } + + public IEnumerable GetMentions(int pageSize) + { + yield break; + } + + public IEnumerable GetUpdates(int pageSize) + { + var contacts = GetYammerContacts(); + var result = YammerWebRequest.PerformRequest(new Uri("https://www.yammer.com/api/v1/messages.xml"), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + + var dict = new Dictionary>(); + + foreach (var element in result.Element("response").Elements("messages").Elements("message")) + { + var update = new ChannelStatusUpdate(); + var contact = contacts.First(c => c.Id == element.Element("sender-id").Value); + + update.ChannelStatusKey = element.Element("id").Value; + update.From = new SourceAddress(contact.Id, contact.FullName, contact.AvatarUrl); + update.Status = element.Element("body").Element("plain").Value; + update.DatePosted = DateTime.Parse(element.Element("created-at").Value); + + foreach (var attachmentElement in element.Descendants("attachment")) + { + var attachment = new ChannelStatusUpdateAttachment(); + var type = attachmentElement.Element("type").Value; + + attachment.PreviewAltText = attachmentElement.Element("name").Value; + attachment.TargetUrl = attachmentElement.Element("web-url").Value; + + if (type == "image") + { + attachment.MediaType = StatusAttachmentTypes.Photo; + attachment.PreviewImageUrl = attachmentElement.Element("image").Element("thumbnail-url").Value; + } + else + { + attachment.MediaType = StatusAttachmentTypes.Document; + } + + update.Attachments.Add(attachment); + } + + var threadid = element.Element("thread-id").Value; + + if (!dict.ContainsKey(threadid)) + dict.Add(threadid, new List()); + + dict[threadid].Add(update); + } + + var updates = new List(); + + foreach (var value in dict.Values) + { + var sortedList = value.OrderBy(c => c.DatePosted).ToList(); + var first = sortedList.First(); + + first.Children.AddRange(sortedList.Skip(1)); + + updates.Add(first); + } + + return updates.OrderByDescending(s => s.SortDate); + } + + public IEnumerable GetUserUpdates(string username, int pageSize) + { + const string url = "https://www.yammer.com/api/v1/messages/from_user/{0}.xml"; + var result = YammerWebRequest.PerformRequest(new Uri(String.Format(url, username)), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret); + + foreach (var element in result.Element("response").Elements("messages").Elements("message")) + { + var update = new ChannelStatusUpdate(); + + update.ChannelStatusKey = element.Element("id").Value; + update.From = new SourceAddress(element.Element("sender-id").Value, username); + update.Status = element.Element("body").Element("plain").Value; + update.DatePosted = DateTime.Parse(element.Element("created-at").Value); + + yield return update; + } + } + + public IEnumerable GetUpdates(string keyword, int pageSize) + { + yield break; + } + + public void UpdateMyStatus(ChannelStatusUpdate update) + { + var p = new Dictionary { {"body", update.Status} }; + + if (!String.IsNullOrEmpty(update.InReplyTo)) + p.Add("replied_to_id", update.InReplyTo); + + YammerWebRequest.PerformRequest(new Uri("https://www.yammer.com/api/v1/messages/"), ChannelHelper.ConsumerKey, + ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret, p); + } + + IClientStatusUpdatesChannel IClientStatusUpdatesChannel.Clone() + { + return new YammerClientChannel + { + Hostname = Hostname, + Port = Port, + IsSecured = IsSecured, + MaxConcurrentConnections = MaxConcurrentConnections, + CredentialsProvider = CredentialsProvider + }; + } + + public bool Disconnect() + { + return true; + } + + public IClientInputChannel Clone() + { + YammerClientChannel channel = new YammerClientChannel(); + channel.Hostname = Hostname; + channel.Port = Port; + channel.IsSecured = IsSecured; + channel.MaxConcurrentConnections = MaxConcurrentConnections; + channel.CredentialsProvider = CredentialsProvider; + + return channel; + } + + YammerContact ParseYammerContact(XElement response) + { + YammerContact contact = new YammerContact(); + contact.Id = response.Element("id").Value; + contact.ScreenName = response.Element("name").Value; + contact.FullName = response.Element("full-name").Value; + contact.Url = response.Element("web-url").Value; + contact.Location = response.Element("location").Value; + contact.Title = response.Element("job-title").Value; + contact.AvatarUrl = response.Element("mugshot-url").Value; + + return contact; + } + + public void Dispose() + { + + } + } +} diff --git a/Code/Channels/Yammer/YammerConfiguration.cs b/Code/Channels/Yammer/YammerConfiguration.cs new file mode 100644 index 0000000..a54d66a --- /dev/null +++ b/Code/Channels/Yammer/YammerConfiguration.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Linq; +using System.Text; +using System.Xml.Serialization; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Interfaces.Enumerations; + +namespace Inbox2.Channels.Yammer +{ + [Serializable] + [Export(typeof(ChannelConfiguration))] + public class YammerConfiguration : ChannelConfiguration + { + public YammerConfiguration() + { + InnerInputChannel = new Channel { Type = typeof(YammerClientChannel) }; + InnerContactsChannel = new Channel { Type = typeof(YammerClientChannel) }; + InnerStatusUpdatesChannel = new Channel { Type = typeof(YammerClientChannel) }; + } + + public override DisplayStyle DisplayStyle + { + get { return DisplayStyle.RedirectWithPin; } + } + + public override string DisplayName + { + get { return "Yammer"; } + } + + public override IWebRedirectBuilder RedirectBuilder + { + get { return new YammerRedirectBuilder(); } + } + + public override Platform.Channels.ChannelProfileInfoBuilder ProfileInfoBuilder + { + get { return new YammerProfileInfoBuilder(); } + } + + public override ChannelCharasteristics Charasteristics + { + get + { + return new ChannelCharasteristics + { + SupportsPrivateMessage = false, + SupportsStatusUpdates = true, + SupportsProfiles = true, + SupportsStatusUpdatesReply = true, + MaxBodyChars = -1 + }; + } + } + + public override ChannelConfiguration Clone() + { + return this.DeepCopy(new XmlSerializer(typeof(YammerConfiguration))); + } + } +} diff --git a/Code/Channels/Yammer/YammerContact.cs b/Code/Channels/Yammer/YammerContact.cs new file mode 100644 index 0000000..9451e36 --- /dev/null +++ b/Code/Channels/Yammer/YammerContact.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Channels.Yammer +{ + public class YammerContact + { + public string Id { get; set; } + + public string ScreenName { get; set; } + + public string FullName { get; set; } + + public string AvatarUrl { get; set; } + + public string Url { get; set; } + + public string Title { get; set; } + + public string Location { get; set; } + } +} diff --git a/Code/Channels/Yammer/YammerProfileInfoBuilder.cs b/Code/Channels/Yammer/YammerProfileInfoBuilder.cs new file mode 100644 index 0000000..9c55ac7 --- /dev/null +++ b/Code/Channels/Yammer/YammerProfileInfoBuilder.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Entities; + +namespace Inbox2.Channels.Yammer +{ + public class YammerProfileInfoBuilder : ChannelProfileInfoBuilder + { + public override string StreamUrl + { + get { return "http://www.yammer.com/home"; } + } + + public override string BuildServiceProfileUrl(SourceAddress address) + { + return String.Format("https://www.yammer.com/users/{0}", address.Address); + } + + public override string BuildServiceProfileUrl(ChannelProfile profile) + { + return String.Format("https://www.yammer.com/users/{0}", profile.SourceAddress.Address); + } + } +} diff --git a/Code/Channels/Yammer/YammerRedirectBuilder.cs b/Code/Channels/Yammer/YammerRedirectBuilder.cs new file mode 100644 index 0000000..d4c97c6 --- /dev/null +++ b/Code/Channels/Yammer/YammerRedirectBuilder.cs @@ -0,0 +1,81 @@ +using System; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Channels.Text; +using Inbox2.Platform.Framework; +using Inbox2.Platform.Framework.OAuth; + +namespace Inbox2.Channels.Yammer +{ + public class YammerRedirectBuilder : IWebRedirectBuilder + { + public string Token { get; set; } + + public string TokenSecret { get; set; } + + public string SuccessUri + { + get { return "oauth/authorized?consumer_token="; } + } + + public YammerRedirectBuilder() + { + Token = SafeSession.Current["/Channels/Yammer/Redirect/Token"] as string; + TokenSecret = SafeSession.Current["/Channels/Yammer/Redirect/TokenSecret"] as string; + } + + public Uri BuildRedirectUri() + { + // 1. Get Auth Token + var result = YammerWebRequest.PerformRequest(new Uri("https://www.yammer.com/oauth/request_token"), ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret); + var parts = NameValueParser.GetCollection(result, "&"); + + Token = parts["oauth_token"]; + TokenSecret = parts["oauth_token_secret"]; + + // Save data in session for re-materialization + SafeSession.Current["/Channels/Yammer/Redirect/Token"] = Token; + SafeSession.Current["/Channels/Yammer/Redirect/TokenSecret"] = TokenSecret; + + return new Uri("https://www.yammer.com/oauth/authorize?oauth_token=" + Token); + } + + public string ParseVerifier(string returnValue) + { + return NameValueParser.GetCollection(new Uri(returnValue).Query, "&")["oauth_verifier"]; + } + + public bool ValidateReturnValue(string verifier) + { + // 2. Exchange auth.token for access.token + var result = YammerWebRequest.PerformRequest(new Uri("https://www.yammer.com/oauth/access_token?callback_token=" + verifier), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, Token, TokenSecret, verifier); + + var parts = NameValueParser.GetCollection(result, "&"); + + if (ChannelContext.Current == null) + throw new ArgumentNullException("ChannelContext.Current"); + + // Remove token from session + SafeSession.Current.Remove("/Channels/Yammer/Redirect/Token"); + SafeSession.Current.Remove("/Channels/Yammer/Redirect/TokenSecret"); + + // 7. Save auth keys + ChannelContext.Current.ClientContext.SaveSetting("/Channels/Yammer/AuthToken", parts["oauth_token"]); + ChannelContext.Current.ClientContext.SaveSetting("/Channels/Yammer/AuthSecret", parts["oauth_token_secret"]); + + Token = parts["oauth_token"]; + TokenSecret = parts["oauth_token_secret"]; + + return true; + } + + public string GetUsername() + { + var result = YammerWebRequest.PerformRequest(new Uri("https://www.yammer.com/api/v1/users/current.xml"), + ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, Token, TokenSecret); + + return result.Element("response").Element("name").Value; + } + } +} diff --git a/Code/Channels/Yammer/YammerWebRequest.cs b/Code/Channels/Yammer/YammerWebRequest.cs new file mode 100644 index 0000000..1c4cf99 --- /dev/null +++ b/Code/Channels/Yammer/YammerWebRequest.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Web; +using System.Xml.Linq; +using Inbox2.Platform.Channels.Extensions; +using Inbox2.Platform.Framework.OAuth; + +namespace Inbox2.Channels.Yammer +{ + public static class YammerWebRequest + { + public static string PerformRequest(Uri sourceUri, string consumerKey, string consumerSecret) + { + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sourceUri); + request.Method = "POST"; + request.ContentType = "application/x-www-form-urlencoded"; + request.UserAgent = "inbox2"; + request.Headers.Add("Authorization", BuildOAuthParams(consumerKey, consumerSecret, null, null, null)); + + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + using (var responseStream = response.GetResponseStream()) + return responseStream.ReadString(); + } + + public static string PerformRequest(Uri sourceUri, string consumerKey, string consumerSecret, string token, string tokenSecret, string verifier) + { + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sourceUri); + request.Method = "POST"; + request.ContentType = "application/x-www-form-urlencoded"; + request.UserAgent = "inbox2"; + request.Headers.Add("Authorization", BuildOAuthParams(consumerKey, consumerSecret, token, tokenSecret, verifier)); + + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + using (var responseStream = response.GetResponseStream()) + return responseStream.ReadString(); + } + + public static XDocument PerformRequest(Uri sourceUri, string consumerKey, string consumerSecret, string token, string tokenSecret) + { + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sourceUri); + request.Method = "GET"; + request.UserAgent = "inbox2"; + request.Headers.Add("Authorization", BuildOAuthParams(consumerKey, consumerSecret, token, tokenSecret, null)); + + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + using (var responseStream = response.GetResponseStream()) + return XDocument.Parse(responseStream.ReadString()); + } + + public static XDocument PerformRequest(Uri sourceUri, string consumerKey, string consumerSecret, string token, string tokenSecret, Dictionary parameters) + { + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sourceUri); + request.Method = "POST"; + request.ContentType = "application/x-www-form-urlencoded"; + request.UserAgent = "inbox2"; + request.Headers.Add("Authorization", BuildOAuthParams(consumerKey, consumerSecret, token, tokenSecret, null)); + + StringBuilder data = new StringBuilder(); + foreach (var parameter in parameters) + { + if (data.Length > 0) + data.Append("&"); + + data.AppendFormat("{0}={1}", parameter.Key, HttpUtility.UrlEncode(parameter.Value.ToString())); + } + + byte[] bytes = Encoding.UTF8.GetBytes(data.ToString()); + request.ContentLength = bytes.Length; + + // Write post data to request stream + using (Stream requestStream = request.GetRequestStream()) + requestStream.Write(bytes, 0, bytes.Length); + + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + using (var responseStream = response.GetResponseStream()) + return XDocument.Parse(responseStream.ReadString()); + } + + static string BuildOAuthParams(string consumerKey, string consumerSecret, string token, string tokenSecret, string verifier) + { + string timeStamp = OAuthBase.GenerateTimeStamp(); + string nonce = OAuthBase.GenerateNonce(); + + StringBuilder sb = new StringBuilder(); + + sb.Append(@"OAuth realm="", "); + sb.AppendFormat(@"oauth_consumer_key=""{0}"", ", consumerKey); + + if (token != null) + sb.AppendFormat(@"oauth_token=""{0}"", ", token); + + sb.AppendFormat(@"oauth_signature_method=""PLAINTEXT"", "); + sb.AppendFormat(@"oauth_signature=""{0}%26{1}"", ", consumerSecret, tokenSecret); + sb.AppendFormat(@"oauth_timestamp=""{0}"", ", timeStamp); + sb.AppendFormat(@"oauth_nonce=""{0}"", ", nonce); + + if (verifier != null) + sb.AppendFormat(@"oauth_verifier=""{0}"", ", verifier); + + sb.AppendFormat(@"oauth_version=""1.0"", "); + + return sb.ToString(); + } + } +} diff --git a/Code/Client/AssemblyInfo.cs b/Code/Client/AssemblyInfo.cs new file mode 100644 index 0000000..d67ae90 --- /dev/null +++ b/Code/Client/AssemblyInfo.cs @@ -0,0 +1,41 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Inbox2")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Tabdeelee")] +[assembly: AssemblyProduct("Inbox2")] +[assembly: AssemblyCopyright("Copyright © Tabdeelee 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.5.0.1")] +[assembly: AssemblyFileVersion("0.5.0.1")] \ No newline at end of file diff --git a/Code/Client/Inbox2/App.config b/Code/Client/Inbox2/App.config new file mode 100644 index 0000000..0d44a85 --- /dev/null +++ b/Code/Client/Inbox2/App.config @@ -0,0 +1,36 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Code/Client/Inbox2/App.xaml b/Code/Client/Inbox2/App.xaml new file mode 100644 index 0000000..d9d5139 --- /dev/null +++ b/Code/Client/Inbox2/App.xaml @@ -0,0 +1,7 @@ + + + + diff --git a/Code/Client/Inbox2/App.xaml.cs b/Code/Client/Inbox2/App.xaml.cs new file mode 100644 index 0000000..e341c3e --- /dev/null +++ b/Code/Client/Inbox2/App.xaml.cs @@ -0,0 +1,272 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Net; +using System.Reflection; +using System.Text; +using System.Threading; +using System.Windows; +using System.Windows.Media.Animation; +using System.Windows.Threading; +using Inbox2.Core; +using Inbox2.Core.Configuration; +using Inbox2.Core.Threading.Handlers; +using Inbox2.Framework; +using Inbox2.Framework.Localization; +using Inbox2.Framework.Security; +using Inbox2.Framework.Stats; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Logging; +using Microsoft.Win32; +using MessageBox = System.Windows.MessageBox; + +namespace Inbox2 +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + readonly string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; + readonly Stopwatch stopwatch = new Stopwatch(); + + bool isShuttingDown; + bool startupSuccess; + + protected override void OnStartup(StartupEventArgs e) + { + base.OnStartup(e); + + // Fix for external startup environements (for instance when clicking on mailto links from IE) + Directory.SetCurrentDirectory(path); + + AppDomain.CurrentDomain.UnhandledException += GlobalExceptionHandler; + Current.DispatcherUnhandledException += GlobalWPFExceptionHandler; + + // Increase maximum concurrent HttpWebRequest connections + ServicePointManager.DefaultConnectionLimit = 100; + + if (CheckForUpgrade()) + { + // first check if we need elevated permissions + new Process { StartInfo = new ProcessStartInfo(Path.Combine(path, "Inbox2Upgrade.exe")) + { Arguments = "upgrade", UseShellExecute = true, Verb = "runas" } }.Start(); + + // Shutdown current application + Current.Shutdown(); + } + else + { + LoadTheme("/Settings/Application/Theme".AsKey("DarkSide")); + + // Run startup code + ThreadPool.QueueUserWorkItem(delegate { Core.Startup.PyBinding(); }); + + Core.Startup.Logging("log4net.config"); + Core.Startup.TypeConverters(); + Core.Startup.DataSources(); + Core.Startup.Search(); + Core.Startup.CorePlugins(); + Core.Startup.AppPlugins(); + Core.Startup.Plumbing(); + Core.Startup.Channels(); + Core.Startup.Commands(); + Core.Startup.KeyboardHooks(); + Core.Startup.LoadStats(); + + MessagesHandler.Init(); + DocumentsHandler.Init(); + ContactsHandler.Init(); + UserStatusHandler.Init(); + + // Can also help in ssl debugging with Fiddler2 + if (SettingsManager.ClientSettings.AppConfiguration.IgnoreSslCertificateIssues) + ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; + + OverrideDependencyProperties(); + + var window = new MainWindow(); + window.Show(); + + stopwatch.Start(); + + startupSuccess = true; + } + } + + internal void OverrideDependencyProperties() + { + Timeline.DesiredFrameRateProperty.OverrideMetadata(typeof(Timeline), new FrameworkPropertyMetadata { DefaultValue = 20 }); + } + + internal void Activate() + { + if (!MainWindow.IsVisible) + MainWindow.Show(); + + if (MainWindow.WindowState == WindowState.Minimized) + MainWindow.WindowState = WindowState.Normal; + + MainWindow.Activate(); + MainWindow.Focus(); + } + + /// + /// Checks if there is a file called upgrade.rar and extracts the contents, skipping the + /// Inbox2.exe and Inbox2.Core.Unmanaged.dll assemblies. + /// + /// After the upgrade process finishes, we delete the upgrade.rar file. + /// + bool CheckForUpgrade() + { + RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\Inbox2\\Upgrade", true); + + try + { + if (key != null) + { + var filename = key.GetValue("filename") as string; + + if (!String.IsNullOrEmpty(filename)) + { + // Check if upgrade version matches current version + var version = key.GetValue("version") as string; + + if (!String.IsNullOrEmpty(version)) + { + if (new Version(version) != GetType().Assembly.GetName().Version) + { + // Looks like we have a orphaned update archive, remove from registry + key.SetValue("version", GetType().Assembly.GetName().Version.ToString()); + key.DeleteValue("filename"); + + return false; + } + } + + StringBuilder sb = new StringBuilder(); + sb.AppendLine(Strings.Inbox2DetectedAnUpgrade); + + if (!Security.IsAdmin()) + { + sb.AppendLine(); + sb.AppendLine(Strings.NonAdminAccount); + } + + return MessageBox.Show(sb.ToString(), "Inbox2 upgrade available", + MessageBoxButton.YesNo, MessageBoxImage.Information, MessageBoxResult.Yes) + == MessageBoxResult.Yes; + } + } + + return false; + } + finally + { + if (key != null) + key.Close(); + } + } + + void LoadTheme(string themename) + { + Resources.MergedDictionaries.Add(LoadComponent(new Uri("/Inbox2.UI.Resources;component/ResourceConverters.xaml", UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/SharedDictionary.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/Button.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/Border.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/CheckBox.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/ComboBox.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/Grid.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/Label.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/ListBox.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/ProgressBar.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/RadioButton.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/ScrollBar.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/ScrollViewer.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/Slider.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/TextBlock.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/TextBox.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/ToggleButton.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/TabControl.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/ToolTip.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/ListView.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/Menu.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/Dialog.xaml", themename), UriKind.Relative)) as ResourceDictionary); + Resources.MergedDictionaries.Add(LoadComponent(new Uri(String.Format("/Inbox2.UI.Themes.{0};component/themes/Expander.xaml", themename), UriKind.Relative)) as ResourceDictionary); + } + + /// + /// Raises the event. + /// + /// An that contains the event data. + protected override void OnExit(ExitEventArgs e) + { + if (startupSuccess) + { + isShuttingDown = true; + + stopwatch.Stop(); + + ClientStats.LogEventWithTime("/Application/LastRunTime", new TimeSpan(stopwatch.ElapsedTicks).TotalSeconds); + + new Shutdown().Run(); + } + + base.OnExit(e); + } + + #region Event handlers + + protected void GlobalExceptionHandler(object sender, UnhandledExceptionEventArgs e) + { + Logger.Fatal("A unhandled exception has occured. Exception = {0}", LogSource.UI, (Exception)e.ExceptionObject); + + // Log error synchronously since we are probably crashing + UnhandledExceptionWindow.LogError((Exception)e.ExceptionObject); + + ShowErrorDialog((Exception)e.ExceptionObject); + } + + protected void GlobalWPFExceptionHandler(object sender, DispatcherUnhandledExceptionEventArgs e) + { + var ex = e.Exception; + + if (ex is ReflectionTypeLoadException) + { + var rtl = ((ReflectionTypeLoadException) ex); + + if (rtl.LoaderExceptions.Length > 0) + ex = rtl.LoaderExceptions[0]; + } + + Logger.Fatal("A unhandled Dispatcher exception has occured. Exception = {0}", LogSource.UI, ex); + + e.Handled = true; + + ThreadPool.QueueUserWorkItem(state => UnhandledExceptionWindow.LogError(e.Exception)); + + ShowErrorDialog(e.Exception); + } + + /// + /// Shows the error dialog. + /// + /// The e. + void ShowErrorDialog(Exception e) + { + if (isShuttingDown || ClientState.StartupSuccess == false) + return; + + if (Dispatcher.CheckAccess()) + { + new UnhandledExceptionWindow(e) { Owner = Current.MainWindow }.ShowDialog(); + } + else + { + Dispatcher.Invoke(DispatcherPriority.Normal, (Action)(() => ShowErrorDialog(e))); + } + } + + #endregion + } +} diff --git a/Code/Client/Inbox2/AppManager.cs b/Code/Client/Inbox2/AppManager.cs new file mode 100644 index 0000000..5f8d19e --- /dev/null +++ b/Code/Client/Inbox2/AppManager.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Framework; +using Inbox2.Framework.Interfaces.Enumerations; +using Microsoft.VisualBasic.ApplicationServices; + +namespace Inbox2 +{ + public class ApplicationManager : WindowsFormsApplicationBase + { + [STAThread] + public static void Main(string[] args) + { + ApplicationManager manager = new ApplicationManager(); + manager.Run(args); + } + + private App _instance; + + public ApplicationManager() + { + IsSingleInstance = true; + } + + protected override bool OnStartup(StartupEventArgs args) + { + //this is the first time + _instance = new App(); + _instance.Run(); + + return false; + } + + protected override void OnStartupNextInstance(StartupNextInstanceEventArgs args) + { + //each other initialization + base.OnStartupNextInstance(args); + + _instance.Activate(); + + var cmdline = String.Concat("Inbox2.exe ", String.Join(" ", args.CommandLine.ToArray())); + var commandline = CommandLine.Parse(cmdline); + + // Publish event if we have been activated by a system mailto call + if (!String.IsNullOrEmpty(commandline.Mailto)) + EventBroker.Publish(AppEvents.New, commandline.Mailto); + } + } +} diff --git a/Code/Client/Inbox2/Core/ClientContext.cs b/Code/Client/Inbox2/Core/ClientContext.cs new file mode 100644 index 0000000..39f804e --- /dev/null +++ b/Code/Client/Inbox2/Core/ClientContext.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using Inbox2.Core.Configuration; +using Inbox2.Platform.Interfaces; + +namespace Inbox2.Core +{ + [Export(typeof(IClientContext))] + public class ClientContext : IClientContext + { + public string DisplayName + { + get { return SettingsManager.ClientSettings.AppConfiguration.Fullname; } + } + + public bool HasSetting(string key) + { + return SettingsManager.ClientSettings.ContextSettings.ContainsKey(key); + } + + public object GetSetting(string key) + { + if (!SettingsManager.ClientSettings.ContextSettings.ContainsKey(key)) + return String.Empty; + + return SettingsManager.ClientSettings.ContextSettings[key]; + } + + public object GetSettingFrom(string filename) + { + return SettingsManager.Read(filename); + } + + public IEnumerable GetSettingsFor(string keyPrefix) + { + foreach (var pair in SettingsManager.ClientSettings.ContextSettings) + { + if (pair.Key.StartsWith(keyPrefix)) + yield return pair.Value; + } + } + + public void SaveSetting(string key, object value) + { + if (SettingsManager.ClientSettings.ContextSettings.ContainsKey(key)) + SettingsManager.ClientSettings.ContextSettings.Remove(key); + + SettingsManager.ClientSettings.ContextSettings.Add(key, value); + SettingsManager.Save(); + } + + public void SaveSettingTo(string filename, object value) + { + SettingsManager.Save(filename, value); + } + + public void DeleteSetting(string key) + { + SettingsManager.ClientSettings.ContextSettings.Remove(key); + SettingsManager.Save(); + } + } +} diff --git a/Code/Client/Inbox2/Core/Configuration/AppConfiguration.cs b/Code/Client/Inbox2/Core/Configuration/AppConfiguration.cs new file mode 100644 index 0000000..3440bef --- /dev/null +++ b/Code/Client/Inbox2/Core/Configuration/AppConfiguration.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Platform.Framework.Extensions; + +namespace Inbox2.Core.Configuration +{ + public class AppConfiguration + { + public string ClientId { get; set; } + + public bool IsChannelSetupFinished { get; set; } + + public string AuthToken { get; set; } + public string AvatarUrl { get; set; } + public string Username { get; set; } + public string Fullname { get; set; } + + public bool IsJustRegistered { get; set; } + public bool IsFirstStatusUpdate { get; set; } + public bool ShowBanner { get; set; } + + public int SurveysDone { get; set; } + public DateTime? DateSurveyDone { get; set; } + public DateTime? DateSurveySnoozed { get; set; } + + public bool IsStatsDisabled { get; set; } + public bool IsDefaultMailClientCheckEnabled { get; set; } + + public bool IgnoreSslCertificateIssues { get; set; } + + public bool IsLoadingAllMessages { get; set; } + + public bool RollUpConversations { get; set; } + + public string DefaultView { get; set; } + + public PreviewPaneLocation PreviewPaneLocation { get; set; } + public bool ShowProfileBalloons { get; set; } + public bool ShowStreamColumn { get; set; } + public bool ShowProductivityColumn { get; set; } + public bool ShowLabelsColumn { get; set; } + + public string Signature { get; set; } + public string ConfigHash { get; set; } + + public bool MarkReadWhenViewing { get; set; } + public int? MarkReadWhenViewingAfter { get; set; } + + public bool ShowNotificationsPopup { get; set; } + public int ShowNotificationsPopupFor { get; set; } + public bool PlayNotificationsSound { get; set; } + + public bool MinimizeToTray { get; set; } + + public DateTime LastSyncDate { get;set; } + + public ReceiveConfiguration ReceiveConfiguration { get; set; } + + public AppConfiguration() + { + ClientId = Guid.NewGuid().GetHash(12); + IsJustRegistered = true; + IsDefaultMailClientCheckEnabled = true; + RollUpConversations = true; + ShowProfileBalloons = true; + ShowStreamColumn = true; + PreviewPaneLocation = PreviewPaneLocation.Hidden; + ReceiveConfiguration = new ReceiveConfiguration(); + MarkReadWhenViewing = true; + MarkReadWhenViewingAfter = 3; + ShowNotificationsPopup = true; + ShowNotificationsPopupFor = 5; + PlayNotificationsSound = true; + IsFirstStatusUpdate = true; + ShowLabelsColumn = true; + DefaultView = "Single line view"; + } + } +} diff --git a/Code/Client/Inbox2/Core/Configuration/Channels/ChannelLoadHelper.cs b/Code/Client/Inbox2/Core/Configuration/Channels/ChannelLoadHelper.cs new file mode 100644 index 0000000..5088f6e --- /dev/null +++ b/Code/Client/Inbox2/Core/Configuration/Channels/ChannelLoadHelper.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.ComponentModel.Composition.Hosting; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Framework; + +namespace Inbox2.Core.Configuration.Channels +{ + public class ChannelLoadHelper + { + [ImportMany] + public List AvailableChannels { get; set; } + + public ChannelLoadHelper() + { + using (new CodeTimer("Startup/LoadChannels")) + { + // Build MEF catalog of channels + var catalog = new DirectoryCatalog(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "*.channels.*.dll"); + var container = new CompositionContainer(catalog); + + container.ComposeParts(this); + + // Do a reverse sort + AvailableChannels.Sort(new Comparison( + (left, right) => right.PreferredSortOrder.CompareTo(left.PreferredSortOrder))); + } + } + } +} diff --git a/Code/Client/Inbox2/Core/Configuration/Client.cs b/Code/Client/Inbox2/Core/Configuration/Client.cs new file mode 100644 index 0000000..4c64ae8 --- /dev/null +++ b/Code/Client/Inbox2/Core/Configuration/Client.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Core.Configuration +{ + class ClientInfo + { + } +} diff --git a/Code/Client/Inbox2/Core/Configuration/ClientSettings.cs b/Code/Client/Inbox2/Core/Configuration/ClientSettings.cs new file mode 100644 index 0000000..306eaa6 --- /dev/null +++ b/Code/Client/Inbox2/Core/Configuration/ClientSettings.cs @@ -0,0 +1,177 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Windows; +using System.Xml.Serialization; +using Inbox2.Platform.Logging; + +namespace Inbox2.Core.Configuration +{ + public class ClientSettings + { + protected SerializableDictionary settings; + + public object this[string s] + { + get + { + if (settings.ContainsKey(s)) + return settings[s]; + + return null; + } + set { settings[s] = value; } + } + + public ClientSettings() + { + // todo better way of generating/storing key + // Default encryption key + SerializableDictionary.EncryptionKey = "letmein"; + + settings = new SerializableDictionary(); + + Load(); + } + + internal void Load() + { + if (!File.Exists(DebugKeys.DefaultDataDirectory + "\\Settings.xml")) + { + settings = new SerializableDictionary(); + return; + } + + try + { + using (FileStream fs = new FileStream(DebugKeys.DefaultDataDirectory + "\\Settings.xml", FileMode.OpenOrCreate)) + { + XmlSerializer ser = new XmlSerializer(typeof(SerializableDictionary)); + settings = (SerializableDictionary)ser.Deserialize(fs); + } + } + catch (Exception ex) + { + Logger.Error("An error has occured while deserializing the settings, resetting settings. Exception = {0}", LogSource.Configuration, ex); + + settings = new SerializableDictionary(); + } + } + + internal void Save() + { + try + { + using (FileStream fs = new FileStream(DebugKeys.DefaultDataDirectory + "\\Settings.xml", FileMode.Create)) + { + XmlSerializer ser = new XmlSerializer(typeof(SerializableDictionary)); + ser.Serialize(fs, settings); + } + } + catch (Exception ex) + { + Logger.Error("An error has occured while deserializing the settings, resetting settings. Exception = {0}", LogSource.Configuration, ex); + } + } + + public void Reset() + { + if (File.Exists(DebugKeys.DefaultDataDirectory + "\\Settings.xml")) + { + File.Delete(DebugKeys.DefaultDataDirectory + "\\Settings.xml"); + } + } + + public Version Version + { + get + { + if (this["Version"] != null) + { + return new Version(this["Version"].ToString()); + } + return new Version(1, 0); + } + set + { + this["Version"] = value.ToString(); + } + } + + public Rect Location + { + get + { + if (this["Location"] != null) + { + return ((Rect)this["Location"]); + } + return Rect.Empty; + } + set + { + this["Location"] = value; + } + } + + public WindowState WindowState + { + get + { + if (this["WindowState"] != null) + { + return (WindowState)this["WindowState"]; + } + return WindowState.Normal; + } + set + { + this["WindowState"] = value; + } + } + + public AppConfiguration AppConfiguration + { + get + { + if (this["AppConfiguration"] != null) + { + return (AppConfiguration)this["AppConfiguration"]; + } + + var auth = new AppConfiguration(); + + this["AppConfiguration"] = auth; + + return auth; + } + set + { + this["AppConfiguration"] = value; + } + } + + public SerializableDictionary ContextSettings + { + get + { + if (this["ContextSettings"] != null) + { + return (SerializableDictionary)this["ContextSettings"]; + } + + var settings = new SerializableDictionary(); + + this["ContextSettings"] = settings; + + return settings; + } + set + { + this["ContextSettings"] = value; + } + } + } +} diff --git a/Code/Client/Inbox2/Core/Configuration/CloudApi.cs b/Code/Client/Inbox2/Core/Configuration/CloudApi.cs new file mode 100644 index 0000000..014b950 --- /dev/null +++ b/Code/Client/Inbox2/Core/Configuration/CloudApi.cs @@ -0,0 +1,33 @@ +using System; +using Inbox2.Framework; + +namespace Inbox2.Core.Configuration +{ + public static class CloudApi + { + public static string ApiBaseUrl + { + get + { + return String.Format("http://api{0}.inbox2.com/", + String.IsNullOrEmpty(CommandLine.Current.Environment) ? String.Empty : "." + CommandLine.Current.Environment); + } + } + + public static string ApplicationKey + { + get + { + return "ZABhADQAMgA4AGQAYQAyAA=="; + } + } + + public static string AccessToken + { + get + { + return SettingsManager.ClientSettings.AppConfiguration.AuthToken; + } + } + } +} diff --git a/Code/Client/Inbox2/Core/Configuration/DebugKeys.cs b/Code/Client/Inbox2/Core/Configuration/DebugKeys.cs new file mode 100644 index 0000000..382960f --- /dev/null +++ b/Code/Client/Inbox2/Core/Configuration/DebugKeys.cs @@ -0,0 +1,78 @@ +using System; +using System.IO; +using System.Linq; +using Inbox2.Framework; +using Inbox2.Platform.Framework.Extensions; + +namespace Inbox2.Core.Configuration +{ + public static class DebugKeys + { + private static string _dataDir; + + public static string DefaultDataDirectory + { + get + { + if (String.IsNullOrEmpty(_dataDir)) + { + // If the data switch is present, use that + if (!String.IsNullOrEmpty(CommandLine.Current.DataDir)) + { + if (CommandLine.Current.DataDir.IndexOfAny(Path.GetInvalidPathChars()) == -1) + _dataDir = CommandLine.Current.DataDir; + } + else + { + var appPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; + + // Check for data folder in the current application directory + if (Directory.Exists(Path.Combine(appPath, "data"))) + _dataDir = Path.Combine(appPath, "data"); + else + // Default behavior: use application data + _dataDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Inbox2"); + } + } + + return _dataDir; + } + } + + public static int DefaultNrOfProcessors + { + get + { + return "/Inbox2/Client/Debug/DefaultNrOfProcessors".AsKey(10); + } + } + + public static int DefaultPageSize + { + get + { + return "/Inbox2/Client/Debug/DefaultPageSize".AsKey(50); + } + } + + public static string[] DisabledPlugins + { + get + { + var setting = "/Settings/Plugins/Disabled".AsKey(String.Empty); + + return setting.Split(new[] {","}, StringSplitOptions.RemoveEmptyEntries) + .Select(s => s.Trim()) + .ToArray(); + } + } + + public static int HttpListenerPort + { + get + { + return "/Settings/Application/HttpListenerPort".AsKey(62101); + } + } + } +} diff --git a/Code/Client/Inbox2/Core/Configuration/Inbox2.Core.Configuration.csproj b/Code/Client/Inbox2/Core/Configuration/Inbox2.Core.Configuration.csproj new file mode 100644 index 0000000..9abff60 --- /dev/null +++ b/Code/Client/Inbox2/Core/Configuration/Inbox2.Core.Configuration.csproj @@ -0,0 +1,206 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {2E870F3B-1BBB-44B0-B534-4A1D1CCB17C8} + Library + Properties + Inbox2.Core.Configuration + Inbox2.Core.Configuration + v3.5 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + False + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Channels.dll + + + False + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Framework.dll + + + + False + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Logging.dll + + + 3.0 + + + 3.0 + + + + + + 3.5 + + + 3.0 + + + 3.5 + + + 3.5 + + + + + 3.0 + + + + + AssemblyInfo.cs + + + + + + + + + + + + + + + + {CFEC0A6E-AFAE-4FC1-8F07-B1B0F97B4162} + Inbox2.Framework.Extensions + + + {B6402BD1-3B14-4ED8-A0A2-11665AEC6D3F} + Inbox2.Framework + + + {8E52D082-3EF7-4A0A-961C-E63C8D4B1947} + Inbox2.Framework.Interfaces + + + {0A5281EA-0E45-448A-9828-A7E96DA1B530} + Inbox2.Framework.Utils + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Configuration/PreChannels.cs b/Code/Client/Inbox2/Core/Configuration/PreChannels.cs new file mode 100644 index 0000000..d51e0fc --- /dev/null +++ b/Code/Client/Inbox2/Core/Configuration/PreChannels.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml.Serialization; + +namespace Inbox2.Core.Configuration +{ + [XmlRoot("channels")] + public class PreChannels + { + private static object _SyncLock = new object(); + private static List _Channels; + + public static List GetChannels() + { + if (!File.Exists("c:\\PreChannels.xml")) + return null; + + if (_Channels == null) + { + lock (_SyncLock) + { + using (FileStream fs = + new FileStream("c:\\PreChannels.xml", FileMode.Open, FileAccess.Read)) + { + XmlSerializer ser = new XmlSerializer(typeof (PreChannels)); + PreChannels result = (PreChannels) ser.Deserialize(fs); + + _Channels = result.Channels; + } + } + } + + return _Channels; + } + + + [XmlElement("channel")] + public List Channels { get; set; } + } + + + public class PreChannel + { + [XmlAttribute("name")] + public string Name { get; set; } + + [XmlAttribute("hostname")] + public string Hostname { get; set; } + + [XmlAttribute("username")] + public string Username { get; set; } + + [XmlAttribute("password")] + public string Password { get; set; } + } +} diff --git a/Code/Client/Inbox2/Core/Configuration/ReceiveConfiguration.cs b/Code/Client/Inbox2/Core/Configuration/ReceiveConfiguration.cs new file mode 100644 index 0000000..7e5db3b --- /dev/null +++ b/Code/Client/Inbox2/Core/Configuration/ReceiveConfiguration.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Core.Configuration +{ + public class ReceiveConfiguration + { + public short ReceiveInterval { get; set; } + + public short SyncStatusUpdatesInterval { get; set; } + + public short SyncSearchStreamInterval { get; set; } + + public short SyncContactsInterval { get; set; } + + public ReceiveConfiguration() + { + ReceiveInterval = 5; + SyncStatusUpdatesInterval = 5; + SyncSearchStreamInterval = 5; + SyncContactsInterval = 60; + } + } +} diff --git a/Code/Client/Inbox2/Core/Configuration/SerializableDictionary.cs b/Code/Client/Inbox2/Core/Configuration/SerializableDictionary.cs new file mode 100644 index 0000000..968cc4c --- /dev/null +++ b/Code/Client/Inbox2/Core/Configuration/SerializableDictionary.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; +using Inbox2.Framework.Utils.Text; + +namespace Inbox2.Core.Configuration +{ + public class SerializableDictionary : Dictionary, IXmlSerializable + { + public static string EncryptionKey { get; set; } + + protected bool encrypt; + + public XmlSchema GetSchema() + { + return null; + } + + public void ReadXml(XmlReader reader) + { + reader.Read(); + + encrypt = bool.Parse(reader.GetAttribute("encrypt")); + reader.ReadStartElement("dictionary"); + + while (reader.NodeType != XmlNodeType.EndElement) + { + reader.ReadStartElement("item"); + string key = reader.ReadElementString("key"); + + string value = encrypt ? Crypto.Decrypt(reader.ReadElementString("value"), EncryptionKey) + : reader.ReadElementString("value"); + + object instance = null; + + using (MemoryStream ms = new MemoryStream()) + using (StreamWriter sw = new StreamWriter(ms)) + { + sw.Write(value); + sw.Flush(); + + ms.Seek(0, SeekOrigin.Begin); + + NetDataContractSerializer ser = new NetDataContractSerializer(); + instance = ser.Deserialize(ms); + } + + Debug.Assert(instance != null, "Deserialization of item failed"); + + reader.ReadEndElement(); + reader.MoveToContent(); + + Add(key, instance); + } + reader.ReadEndElement(); + } + + public void WriteXml(XmlWriter writer) + { + writer.WriteStartElement("dictionary"); + writer.WriteAttributeString("encrypt", encrypt.ToString()); + + foreach (string key in Keys) + { + object value = this[key]; + writer.WriteStartElement("item"); + writer.WriteElementString("key", key); + + using (MemoryStream ms = new MemoryStream()) + using (StreamReader sr = new StreamReader(ms)) + { + NetDataContractSerializer ser = new NetDataContractSerializer(); + ser.Serialize(ms, value); + + ms.Seek(0, SeekOrigin.Begin); + + writer.WriteElementString("value", encrypt ? Crypto.Encrypt(sr.ReadToEnd(), EncryptionKey) : sr.ReadToEnd()); + } + + writer.WriteEndElement(); + } + writer.WriteEndElement(); + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Configuration/SettingsManager.cs b/Code/Client/Inbox2/Core/Configuration/SettingsManager.cs new file mode 100644 index 0000000..56ad21b --- /dev/null +++ b/Code/Client/Inbox2/Core/Configuration/SettingsManager.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using Inbox2.Framework; + +namespace Inbox2.Core.Configuration +{ + public static class SettingsManager + { + private static ClientSettings _ClientSettings; + + public static ClientSettings ClientSettings + { + get + { + if (_ClientSettings == null) + { + using (new JoeCulture()) + { + _ClientSettings = new ClientSettings(); + _ClientSettings.Load(); + } + } + + return _ClientSettings; + } + } + + public static void Save() + { + using (new JoeCulture()) + _ClientSettings.Save(); + } + + public static T SettingOrDefault(string key, T defaultValue) + { + var obj = ClientState.Current.Context.GetSetting(key); + + if (obj == null) + return defaultValue; + + if (!(obj is T)) + return defaultValue; + + return (T)obj; + } + + public static object Read(string filename) + { + using (new JoeCulture()) + { + string path = Path.Combine(DebugKeys.DefaultDataDirectory, filename); + + if (!File.Exists(path)) + return null; + + using (var stream = File.OpenRead(path)) + { + NetDataContractSerializer ser = new NetDataContractSerializer(); + return ser.Deserialize(stream); + } + } + } + + public static void Save(string filename, object value) + { + using (new JoeCulture()) + { + string path = Path.Combine(DebugKeys.DefaultDataDirectory, filename); + + using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write)) + { + NetDataContractSerializer ser = new NetDataContractSerializer(); + ser.Serialize(fs, value); + } + } + } + } +} diff --git a/Code/Client/Inbox2/Core/Configuration/WindowSettings.cs b/Code/Client/Inbox2/Core/Configuration/WindowSettings.cs new file mode 100644 index 0000000..33a970a --- /dev/null +++ b/Code/Client/Inbox2/Core/Configuration/WindowSettings.cs @@ -0,0 +1,107 @@ +using System; +using System.ComponentModel; +using System.Windows; + +namespace Inbox2.Core.Configuration +{ + /// + /// Persists a Window's Size, Location and WindowState to UserScopeSettings + /// + public class WindowSettings + { + /// + /// Register the "Save" attached property and the "OnSaveInvalidated" callback + /// + public static readonly DependencyProperty SaveProperty + = DependencyProperty.RegisterAttached("Save", typeof(bool), typeof(WindowSettings), + new FrameworkPropertyMetadata(new PropertyChangedCallback(OnSaveInvalidated))); + + public static void SetSave(DependencyObject dependencyObject, bool enabled) + { + dependencyObject.SetValue(SaveProperty, enabled); + } + + private readonly Window window; + + public WindowSettings(Window window) + { + this.window = window; + } + + /// + /// Called when Save is changed on an object. + /// + private static void OnSaveInvalidated(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) + { + Window window = dependencyObject as Window; + if (window != null) + { + if ((bool)e.NewValue) + { + WindowSettings settings = new WindowSettings(window); + settings.Attach(); + } + } + } + + /// + /// Load the Window Size Location and State from the settings object + /// + protected virtual void LoadWindowState() + { + if (this.Settings.Location != Rect.Empty) + { + this.window.Left = this.Settings.Location.Left; + this.window.Top = this.Settings.Location.Top; + this.window.Width = this.Settings.Location.Width; + this.window.Height = this.Settings.Location.Height; + } + else + { + this.window.WindowStartupLocation = WindowStartupLocation.CenterScreen; + } + + this.window.WindowState = this.Settings.WindowState; + } + + + /// + /// Save the Window Size, Location and State to the settings object + /// + protected virtual void SaveWindowState() + { + this.Settings.WindowState = this.window.WindowState; + this.Settings.Location = this.window.RestoreBounds; + this.Settings.Save(); + } + + private void Attach() + { + if (this.window != null) + { + this.window.Closing += new CancelEventHandler(window_Closing); + this.window.Initialized += new EventHandler(window_Initialized); + } + } + + private void window_Initialized(object sender, EventArgs e) + { + LoadWindowState(); + } + + private void window_Closing(object sender, CancelEventArgs e) + { + SaveWindowState(); + } + + [Browsable(false)] + public ClientSettings Settings + { + get + { + return SettingsManager.ClientSettings; + } + } + } + +} diff --git a/Code/Client/Inbox2/Core/DataAccess/DatabaseUtil.cs b/Code/Client/Inbox2/Core/DataAccess/DatabaseUtil.cs new file mode 100644 index 0000000..cd66306 --- /dev/null +++ b/Code/Client/Inbox2/Core/DataAccess/DatabaseUtil.cs @@ -0,0 +1,21 @@ +using System.Data.SQLite; +using System.IO; +using Inbox2.Core.Configuration; + +namespace Inbox2.Core.DataAccess +{ + public static class DatabaseUtil + { + public static void InitializeDataStore() + { + // Touch the database to create the file + if (File.Exists(DebugKeys.DefaultDataDirectory + "\\Inbox2.db3") == false) + { + using (SQLiteConnection connection = new SQLiteConnection("Data Source=" + DebugKeys.DefaultDataDirectory + "\\Inbox2.db3")) + { + connection.Open(); + } + } + } + } +} diff --git a/Code/Client/Inbox2/Core/DataAccess/Inbox2.Core.DataAccess - x64.csproj b/Code/Client/Inbox2/Core/DataAccess/Inbox2.Core.DataAccess - x64.csproj new file mode 100644 index 0000000..f73110f --- /dev/null +++ b/Code/Client/Inbox2/Core/DataAccess/Inbox2.Core.DataAccess - x64.csproj @@ -0,0 +1,206 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {FE0490D8-BD4A-493F-89A6-30399A69DD3F} + Library + Properties + Inbox2.Core.DataAccess + Inbox2.Core.DataAccess + v3.5 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + False + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Channels.dll + + + False + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Framework.dll + + + 3.0 + + + + False + ..\..\..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + + 3.5 + + + False + ..\..\..\..\..\ThirdParty\Sqlite\x64\System.Data.SQLite.DLL + + + 3.5 + + + 3.5 + + + + + 3.0 + + + + + AssemblyInfo.cs + + + + + + + + + + + + {CFEC0A6E-AFAE-4FC1-8F07-B1B0F97B4162} + Inbox2.Framework.Extensions + + + {B6402BD1-3B14-4ED8-A0A2-11665AEC6D3F} + Inbox2.Framework + + + {8E52D082-3EF7-4A0A-961C-E63C8D4B1947} + Inbox2.Framework.Interfaces + + + {C20E7E84-728A-4891-B99B-D6DD4029FFF4} + Inbox2.Framework.Persistance + + + {2E870F3B-1BBB-44B0-B534-4A1D1CCB17C8} + Inbox2.Core.Configuration + + + {0C52A195-004F-456B-AAB8-9C9A2BFA7291} + Inbox2.Core.Streams + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/DataAccess/Inbox2.Core.DataAccess.csproj b/Code/Client/Inbox2/Core/DataAccess/Inbox2.Core.DataAccess.csproj new file mode 100644 index 0000000..9f3bfcd --- /dev/null +++ b/Code/Client/Inbox2/Core/DataAccess/Inbox2.Core.DataAccess.csproj @@ -0,0 +1,184 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {0782FB55-3C4D-4E45-8D4C-2516756750C5} + Library + Properties + Inbox2.Core.DataAccess + Inbox2.Core.DataAccess + v3.5 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Channels.dll + + + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Framework.dll + + + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Interfaces.dll + + + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Logging.dll + + + 3.0 + + + + False + ..\..\..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + + 3.5 + + + False + ..\..\..\..\..\ThirdParty\Sqlite\x86\System.Data.SQLite.DLL + + + 3.5 + + + 3.5 + + + + + 3.0 + + + + + AssemblyInfo.cs + + + + + + + + + + + + {CFEC0A6E-AFAE-4FC1-8F07-B1B0F97B4162} + Inbox2.Framework.Extensions + + + {B6402BD1-3B14-4ED8-A0A2-11665AEC6D3F} + Inbox2.Framework + + + {8E52D082-3EF7-4A0A-961C-E63C8D4B1947} + Inbox2.Framework.Interfaces + + + {C20E7E84-728A-4891-B99B-D6DD4029FFF4} + Inbox2.Framework.Persistance + + + {2E870F3B-1BBB-44B0-B534-4A1D1CCB17C8} + Inbox2.Core.Configuration + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/DataAccess/Migrate.cs b/Code/Client/Inbox2/Core/DataAccess/Migrate.cs new file mode 100644 index 0000000..7e6ce0c --- /dev/null +++ b/Code/Client/Inbox2/Core/DataAccess/Migrate.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Core.DataAccess.Reflection; +using Inbox2.Framework; + +namespace Inbox2.Core.DataAccess +{ + public static class Migrate + { + public static void Up(Type targetType) + { + var map = Reflector.BuildMapFromType(targetType); + + if (TableExists(map.TableName)) + return; + + StringBuilder sql = new StringBuilder(); + sql.AppendFormat("CREATE TABLE \"{0}\"{1}", map.TableName, Environment.NewLine); + sql.AppendLine("("); + + sql.AppendFormat("\t\"{0}\" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, {1}", + map.PrimaryKey.ColumName, Environment.NewLine); + + for (int i = 0; i < map.Columns.Count; i++) + { + var token = map.Columns[i]; + + string dbType = "TEXT"; + + if (token.SourceType == typeof (Int16) + || token.SourceType == typeof (Int32) + || token.SourceType == typeof (Int64)) + { + dbType = "INTEGER"; + } + + sql.AppendFormat("\t\"{0}\" {1}{2}{3}", + token.ColumName, + dbType, + i < map.Columns.Count -1 ? "," : "", // Skip comma for last column + Environment.NewLine); + } + + // Remove last comma + sql.AppendLine(")"); + + // Execute creation script for table + ClientState.Current.DataService.ExecuteNonQuery(sql.ToString()); + } + + static bool TableExists(string tableName) + { + string sql = String.Format("select count(*) from sqlite_master where name='{0}'", tableName); + + return ClientState.Current.DataService.ExecuteScalar(sql) > 0; + } + } +} diff --git a/Code/Client/Inbox2/Core/DataAccess/Query/QueryGenerator.cs b/Code/Client/Inbox2/Core/DataAccess/Query/QueryGenerator.cs new file mode 100644 index 0000000..22d90b5 --- /dev/null +++ b/Code/Client/Inbox2/Core/DataAccess/Query/QueryGenerator.cs @@ -0,0 +1,253 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data.SQLite; +using System.Linq; +using System.Text; +using Inbox2.Core.DataAccess.Reflection; +using Inbox2.Framework; +using Inbox2.Framework.Extensions; +using Inbox2.Platform.Channels.Extensions; + +namespace Inbox2.Core.DataAccess.Query +{ + public class QueryGenerator + { + private TableMap map; + + internal TableMap Map + { + get { return map; } + } + + public SQLiteCommand GetSelectCommand() + { + map = Reflector.BuildMapFrom(); + + StringBuilder sb = new StringBuilder(); + + sb.AppendFormat("select * from {0}", map.TableName); + + return new SQLiteCommand(sb.ToString()); + } + + public SQLiteCommand GetSelectCommand(string key) + { + map = Reflector.BuildMapFrom(); + + StringBuilder sb = new StringBuilder(); + + sb.AppendFormat("select * from {0} where [{1}]=@{1}", map.TableName, map.PrimaryKey.ColumName); + + return new SQLiteCommand(sb.ToString()); + } + + public SQLiteCommand GetSelectCommand(List properties) + { + map = Reflector.BuildMapFrom(); + + StringBuilder sb = new StringBuilder(); + + sb.AppendFormat("select * from {0} ", map.TableName); + sb.AppendFormat(" where "); + + for (int i = 0; i < properties.Count; i++) + { + var property = properties[i]; + + if (i > 0) + sb.Append(" and "); + + sb.AppendFormat("[{0}]=@{0}", property.Name); + } + + var command = new SQLiteCommand(sb.ToString()); + + // Add values to command + foreach (var property in properties) + command.Parameters.AddWithValue("@" + property.Name, property.Value); + + return command; + } + + public SQLiteCommand GetInsertCommand(T instance) + { + map = Reflector.BuildMapFromInstance(instance); + + StringBuilder sb = new StringBuilder(); + + sb.AppendFormat("insert into [{0}] ", map.TableName); + sb.Append("("); + + // Build columns part + AppendColumnsForInsert(sb); + + sb.Append(") values ("); + + // Build values part + AppendValuesForInsert(sb); + + sb.Append("); SELECT last_insert_rowid()"); + + SQLiteCommand command = BuildCommand(sb); + + // Copy parameters to command + CopyColumnValuesToCommand(command); + + return command; + } + + public SQLiteCommand GetUpdateCommand(T instance, params string[] columns) + { + map = Reflector.BuildMapFromInstance(instance); + + StringBuilder sb = new StringBuilder(); + + sb.AppendFormat("update [{0}] set ", map.TableName); + + // Build columns/values part + AppendColumnsForUpdate(sb, columns); + + sb.AppendFormat(" where [{0}]=@{0}", map.PrimaryKey.ColumName); + + SQLiteCommand command = BuildCommand(sb); + + // Copy parameters to command + CopyColumnValuesToCommand(command); + + command.Parameters.AddWithValue("@" + map.PrimaryKey.ColumName, map.PrimaryKey.Value); + + return command; + } + + public SQLiteCommand GetDeleteCommand(T instance) + { + map = Reflector.BuildMapFromInstance(instance); + + StringBuilder sb = new StringBuilder(); + + sb.AppendFormat("delete from [{0}] ", map.TableName); + sb.AppendFormat(" where [{0}]=@{0}", map.PrimaryKey.ColumName); + + SQLiteCommand command = BuildCommand(sb); + + // Copy parameters to command + CopyColumnValuesToCommand(command); + + command.Parameters.AddWithValue("@" + map.PrimaryKey.ColumName, map.PrimaryKey.Value); + + return command; + } + + public SQLiteCommand GetDeleteCommand(List properties) + { + map = Reflector.BuildMapFrom(); + + StringBuilder sb = new StringBuilder(); + + sb.AppendFormat("delete from {0} ", map.TableName); + sb.AppendFormat(" where "); + + for (int i = 0; i < properties.Count; i++) + { + var property = properties[i]; + + if (i > 0) + sb.Append(" and "); + + sb.AppendFormat("[{0}]=@{0}", property.Name); + } + + var command = new SQLiteCommand(sb.ToString()); + + // Add values to command + foreach (var property in properties) + command.Parameters.AddWithValue("@" + property.Name, property.Value); + + return command; + } + + void AppendColumnsForInsert(StringBuilder sb) + { + for (int i = 0; i < map.Columns.Count; i++) + { + PropertyToken token = map.Columns[i]; + + sb.AppendFormat("[{0}]", token.ColumName); + + if (i < map.Columns.Count - 1) + sb.Append(", "); + } + } + + void AppendColumnsForUpdate(StringBuilder sb, params string[] columns) + { + if (columns.Length > 0) + { + for (int i = 0; i < columns.Length; i++) + { + sb.AppendFormat("[{0}]=@{0}", columns[i]); + + if (i < columns.Length - 1) + sb.Append(", "); + } + } + else + { + for (int i = 0; i < map.Columns.Count; i++) + { + PropertyToken token = map.Columns[i]; + + sb.AppendFormat("[{0}]=@{0}", token.ColumName); + + if (i < map.Columns.Count - 1) + sb.Append(", "); + } + } + } + + void AppendValuesForInsert(StringBuilder sb) + { + for (int i = 0; i < map.Columns.Count; i++) + { + PropertyToken token = map.Columns[i]; + + sb.AppendFormat("@{0}", token.ColumName); + + if (i < map.Columns.Count - 1) + sb.Append(", "); + } + } + + void CopyColumnValuesToCommand(SQLiteCommand command) + { + using (new JoeCulture()) + { + foreach (var token in map.Columns) + { + TypeConverter conv = TypeDescriptor.GetConverter(token.SourceType); + + + // The default DateTime converter does not save the seonds, this causes + // problems with the threading feature when two messages are sent/received + // in the same minute (which is quite likely to happen). + string valueStr = token.Value is DateTime + ? ((DateTime) token.Value).ToString() + : token.Value == null ? String.Empty : conv.ConvertToString(token.Value); + + command.Parameters.AddWithValue("@" + token.ColumName, valueStr); + } + } + } + + SQLiteCommand BuildCommand(StringBuilder sb) + { + SQLiteCommand command = new SQLiteCommand(sb.ToString()); + + foreach (var token in map.Columns) + command.Parameters.AddWithValue(token.ColumName, token.Value); + + return command; + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/DataAccess/Reflection/PropertyToken.cs b/Code/Client/Inbox2/Core/DataAccess/Reflection/PropertyToken.cs new file mode 100644 index 0000000..1833b78 --- /dev/null +++ b/Code/Client/Inbox2/Core/DataAccess/Reflection/PropertyToken.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Core.DataAccess.Reflection +{ + class PropertyToken + { + public string ColumName { get; private set; } + + public object Value { get; private set; } + + public Type SourceType { get; private set; } + + public PropertyToken(string columName, object value, Type sourceType) + { + ColumName = columName; + Value = value; + SourceType = sourceType; + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/DataAccess/Reflection/Reflector.cs b/Code/Client/Inbox2/Core/DataAccess/Reflection/Reflector.cs new file mode 100644 index 0000000..d9fdf22 --- /dev/null +++ b/Code/Client/Inbox2/Core/DataAccess/Reflection/Reflector.cs @@ -0,0 +1,125 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Inbox2.Framework.Persistance; +using Inbox2.Platform.Channels.Attributes; + +namespace Inbox2.Core.DataAccess.Reflection +{ + static class Reflector + { + public static TableMap BuildMapFrom() + { + return BuildMapFromType(typeof(T)); + } + + public static TableMap BuildMapFromType(Type type) + { + return BuildMapFromInstance(type, null); + } + + public static TableMap BuildMapFromInstance(T instance) + { + return BuildMapFromInstance(instance.GetType(), instance); + } + + public static TableMap BuildMapFromInstance(Type type, object instance) + { + PersistableClassAttribute persistableClassAttribute = GetAttributeFrom(type); + + if (persistableClassAttribute == null) + throw new ApplicationException("Instance was not marked with the Persistable attribute!"); + + // Make sure a valid name is specified for the table name + if (String.IsNullOrEmpty(persistableClassAttribute.TableName)) + persistableClassAttribute.TableName = type.Name + "s"; + + // Find PK property + var primaryKeyFields = GetPropertiesForAttribute(type).ToList(); + + if (primaryKeyFields.Count == 0) + throw new ApplicationException("Instance did not have a property marked with the PrimaryKey attribute!"); + + if (primaryKeyFields.Count > 1) + throw new ApplicationException("Instance has more then one property marked with the PrimaryKey attribute!"); + + // Todo: make sure the PK is nullable + + PrimaryKeyAttribute primaryKeyAttribute = GetAttributeFrom(primaryKeyFields[0]); + + // Make sure a valid name is specified for the primary key + if (String.IsNullOrEmpty(primaryKeyAttribute.FieldName)) + primaryKeyAttribute.FieldName = primaryKeyFields[0].Name; + + object value = instance == null ? null : primaryKeyFields[0].GetValue(instance, null); + + PropertyToken primaryKeyToken = new PropertyToken(primaryKeyAttribute.FieldName, value, primaryKeyFields[0].PropertyType); + + // Get columns to persist + var columns = new List(); + var columnProperties = GetPropertiesForAttribute(type).ToList(); + + foreach (var columnProperty in columnProperties) + { + object columnValue = instance == null ? null : columnProperty.GetValue(instance, null); + + columns.Add(new PropertyToken(columnProperty.Name, columnValue, columnProperty.PropertyType)); + } + + return new TableMap { TableName = persistableClassAttribute.TableName, PrimaryKey = primaryKeyToken, Columns = columns }; + } + + public static void SetPropertyValue(object instance, PropertyToken token, object newValue) + { + PropertyInfo property = instance.GetType().GetProperty(token.ColumName, BindingFlags.Instance | BindingFlags.Public); + + if (property == null) + throw new ApplicationException(String.Format("Property {0} was not found on object {1}", token.ColumName, instance)); + + property.SetValue(instance, newValue, null); + } + + static A GetAttributeFrom(Type type) where A : Attribute + { + var attributes = type.GetCustomAttributes(typeof(A), true); + + if (attributes != null && attributes.Length > 0) + { + return (A)attributes.First(); + } + + return default(A); + } + + static A GetAttributeFrom(PropertyInfo instance) where A : Attribute + { + var attributes = instance.GetCustomAttributes(typeof(A), true); + + if (attributes != null && attributes.Length > 0) + { + return (A)attributes.First(); + } + + return default(A); + } + + static IEnumerable GetPropertiesForAttribute(Type type) where A : Attribute + { + var properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public); + + if (properties != null && properties.Length > 0) + { + foreach (var property in properties) + { + var attributes = property.GetCustomAttributes(typeof (A), true); + + if (attributes != null && attributes.Length > 0) + { + yield return property; + } + } + } + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/DataAccess/Reflection/TableMap.cs b/Code/Client/Inbox2/Core/DataAccess/Reflection/TableMap.cs new file mode 100644 index 0000000..e88a99e --- /dev/null +++ b/Code/Client/Inbox2/Core/DataAccess/Reflection/TableMap.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Core.DataAccess.Reflection +{ + class TableMap + { + public string TableName { get; set; } + + public PropertyToken PrimaryKey { get; set; } + + public List Columns { get; set; } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/DataAccess/SQLiteDataService.cs b/Code/Client/Inbox2/Core/DataAccess/SQLiteDataService.cs new file mode 100644 index 0000000..bbd3158 --- /dev/null +++ b/Code/Client/Inbox2/Core/DataAccess/SQLiteDataService.cs @@ -0,0 +1,458 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.Composition; +using System.Data; +using System.Data.SQLite; +using System.Linq; +using Inbox2.Core.Configuration; +using Inbox2.Core.DataAccess.Query; +using Inbox2.Core.DataAccess.Reflection; +using Inbox2.Framework; +using Inbox2.Framework.Persistance; +using Inbox2.Platform.Channels.Extensions; +using ObjectExtensions=Inbox2.Platform.Framework.Extensions.ObjectExtensions; + +namespace Inbox2.Core.DataAccess +{ + [Export(typeof(IDataService))] + public class SQLiteDataService : IDataService + { + public T SelectByKey(long key) where T : new() + { + QueryGenerator generator = new QueryGenerator(); + + using (SQLiteConnection connection = CreateConnection()) + { + SQLiteCommand command = generator.GetSelectCommand(key.ToString()); + + command.Parameters.AddWithValue("@" + generator.Map.PrimaryKey.ColumName, key); + command.Connection = connection; + + using (SQLiteDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + T instance = new T(); + + using (new JoeCulture()) + ObjectExtensions.CreateFrom(instance, reader); + + return instance; + } + } + } + + return default(T); + } + + public T SelectBy(object queryObject) where T : new() + { + QueryGenerator generator = new QueryGenerator(); + + using (SQLiteConnection connection = CreateConnection()) + { + var properties = queryObject.GetProperties().ToList(); + + SQLiteCommand command = generator.GetSelectCommand(properties); + + command.Connection = connection; + + using (SQLiteDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + T instance = new T(); + + using (new JoeCulture()) + ObjectExtensions.CreateFrom(instance, reader); + + return instance; + } + } + } + + return default(T); + } + + public T SelectBy(string query) where T : new() + { + var command = CreateCommand(); + + command.CommandText = query; + + using (SQLiteConnection connection = CreateConnection()) + { + command.Connection = connection; + + using (SQLiteDataReader reader = (SQLiteDataReader)command.ExecuteReader()) + { + while (reader.Read()) + { + T instance = new T(); + + using (new JoeCulture()) + ObjectExtensions.CreateFrom(instance, reader); + + return instance; + } + } + } + + return default(T); + } + + public T SelectBy(IDbCommand command) where T : new() + { + using (SQLiteConnection connection = CreateConnection()) + { + command.Connection = connection; + + using (SQLiteDataReader reader = (SQLiteDataReader)command.ExecuteReader()) + { + while (reader.Read()) + { + T instance = new T(); + + using (new JoeCulture()) + ObjectExtensions.CreateFrom(instance, reader); + + return instance; + } + } + } + + return default(T); + } + + public IEnumerable SelectAllBy(object queryObject) where T : new() + { + QueryGenerator generator = new QueryGenerator(); + + using (SQLiteConnection connection = CreateConnection()) + { + var properties = queryObject.GetProperties().ToList(); + + SQLiteCommand command = generator.GetSelectCommand(properties); + + command.Connection = connection; + + using (SQLiteDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + T instance = new T(); + + using (new JoeCulture()) + ObjectExtensions.CreateFrom(instance, reader); + + yield return instance; + } + } + } + } + + public IEnumerable SelectAllBy(IDbCommand command) where T : new() + { + using (SQLiteConnection connection = CreateConnection()) + { + command.Connection = connection; + + using (SQLiteDataReader reader = (SQLiteDataReader)command.ExecuteReader()) + { + while (reader.Read()) + { + T instance = new T(); + + using (new JoeCulture()) + ObjectExtensions.CreateFrom(instance, reader); + + yield return instance; + } + } + } + } + + /// + /// Selects all items from the table associated with T. + /// + /// + /// + public IEnumerable SelectAll() where T : new() + { + QueryGenerator generator = new QueryGenerator(); + + using (SQLiteConnection connection = CreateConnection()) + { + SQLiteCommand command = generator.GetSelectCommand(); + + command.Connection = connection; + + using (SQLiteDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + T instance = new T(); + + using (new JoeCulture()) + ObjectExtensions.CreateFrom(instance, reader); + + yield return instance; + } + } + } + } + + public IEnumerable SelectAll(IDbCommand command) where T : new() + { + using (SQLiteConnection connection = CreateConnection()) + { + command.Connection = connection; + + using (SQLiteDataReader reader = ((SQLiteCommand) command).ExecuteReader()) + { + while (reader.Read()) + { + T instance = new T(); + + using (new JoeCulture()) + ObjectExtensions.CreateFrom(instance, reader); + + yield return instance; + } + } + } + } + + public IEnumerable SelectAll(string query) where T : new() + { + using (SQLiteConnection connection = CreateConnection()) + { + SQLiteCommand command = new SQLiteCommand(query); + + command.Connection = connection; + + using (SQLiteDataReader reader = command.ExecuteReader()) + { + while (reader.Read()) + { + T instance = new T(); + + using (new JoeCulture()) + ObjectExtensions.CreateFrom(instance, reader); + + yield return instance; + } + } + } + } + + /// + /// Saves the specified instance. + /// + /// + /// The instance. + public void Save(T instance) + { + if (instance is IDataServiceHooks) + (instance as IDataServiceHooks).BeforeSave(); + + QueryGenerator generator = new QueryGenerator(); + + using (SQLiteConnection connection = CreateConnection()) + { + SQLiteCommand command = generator.GetInsertCommand(instance); + + command.Connection = connection; + + object id = command.ExecuteScalar(); + + // Set the new id on the primary key + Reflector.SetPropertyValue(instance, generator.Map.PrimaryKey, id); + } + + if (instance is IDataServiceHooks) + (instance as IDataServiceHooks).AfterSave(); + } + + /// + /// Updates the specified instance. + /// + /// + /// The instance. + public void Update(T instance) + { + if (instance is IDataServiceHooks) + (instance as IDataServiceHooks).BeforeUpdate(); + + QueryGenerator generator = new QueryGenerator(); + + SQLiteCommand command = generator.GetUpdateCommand(instance); + + ExecuteNonQuery(command); + + if (instance is IDataServiceHooks) + (instance as IDataServiceHooks).AfterUpdate(); + } + + /// + /// Deletes the specified instance. + /// + /// + /// The instance. + public void Delete(T instance) + { + if (instance is IDataServiceHooks) + (instance as IDataServiceHooks).BeforeDelete(); + + QueryGenerator generator = new QueryGenerator(); + + SQLiteCommand command = generator.GetDeleteCommand(instance); + + ExecuteNonQuery(command); + + if (instance is IDataServiceHooks) + (instance as IDataServiceHooks).AfterDelete(); + } + + /// + /// Deletes all the rows of the specified type with the specified where clause. + /// + /// + /// The query object. + public void Delete(object queryObject) + { + QueryGenerator generator = new QueryGenerator(); + + var properties = queryObject.GetProperties().ToList(); + + SQLiteCommand command = generator.GetDeleteCommand(properties); + + ExecuteNonQuery(command); + } + + /// + /// Executes the given command and returns the scalar value casted to type T. + /// + /// + /// The command. + /// + public T ExecuteScalar(IDbCommand command) where T : new() + { + using (SQLiteConnection connection = CreateConnection()) + { + command.Connection = connection; + + var value = command.ExecuteScalar(); + + TypeConverter conv = TypeDescriptor.GetConverter(typeof(T)); + + return (T)conv.ConvertFromString(value.ToString()); + } + } + + /// + /// Executes the given query and returns the scalar value casted to type T. + /// + /// + /// The query. + /// + public T ExecuteScalar(string query) where T : new() + { + return ExecuteScalar(new SQLiteCommand(query)); + } + + /// + /// Crreates the command. + /// + /// + public IDbCommand CreateCommand() + { + return new SQLiteCommand(); + } + + /// + /// Creates the parameter. + /// + /// + public IDataParameter CreateParameter() + { + return new SQLiteParameter(); + } + + /// + /// Creates the parameter with the given name and value. + /// + /// The name. + /// The value. + /// + public IDataParameter CreateParameter(string name, object value) + { + return new SQLiteParameter { ParameterName = name, Value = value }; + } + + /// + /// Executes the query and returns a IDataReader instance. + /// + /// The command. + /// + public IDataReader ExecuteReader(IDbCommand command) + { + SQLiteConnection connection = CreateConnection(); + + command.Connection = connection; + + return command.ExecuteReader(CommandBehavior.CloseConnection); + } + + /// + /// Executes the query and returns a IDataReader instance. + /// + /// + /// + public IDataReader ExecuteReader(string query) + { + var command = CreateCommand(); + + command.CommandText = query; + + return ExecuteReader(command); + } + + /// + /// Executes the given command. + /// + /// The command. + public void ExecuteNonQuery(IDbCommand command) + { + using (SQLiteConnection connection = CreateConnection()) + { + command.Connection = connection; + + command.ExecuteNonQuery(); + } + } + + /// + /// Executes the given query. + /// + /// The query. + public void ExecuteNonQuery(string query) + { + ExecuteNonQuery(new SQLiteCommand(query)); + } + + /// + /// Clones the existing connection on the UI thread. + /// + /// + SQLiteConnection CreateConnection() + { + var connection = new SQLiteConnection("Data Source=" + DebugKeys.DefaultDataDirectory + "\\Inbox2.db3"); + + connection.Open(); + + return connection; + } + } +} diff --git a/Code/Client/Inbox2/Core/Inbox2.Core - x64.csproj b/Code/Client/Inbox2/Core/Inbox2.Core - x64.csproj new file mode 100644 index 0000000..21b67db --- /dev/null +++ b/Code/Client/Inbox2/Core/Inbox2.Core - x64.csproj @@ -0,0 +1,255 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {7854FDB4-4D94-4C43-995A-4C1564E338E1} + Library + Properties + Inbox2.Core + Inbox2.Core + v3.5 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + ..\..\..\Stable Assemblies\Inbox2.Platform.Channels.dll + + + ..\..\..\Stable Assemblies\Inbox2.Platform.Framework.dll + + + ..\..\..\Stable Assemblies\Inbox2.Platform.Interfaces.dll + + + ..\..\..\Stable Assemblies\Inbox2.Platform.Logging.dll + + + + False + ..\..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + + 3.5 + + + + 3.5 + + + 3.5 + + + + + 3.0 + + + + + AssemblyInfo.cs + + + + + + + + + {CFEC0A6E-AFAE-4FC1-8F07-B1B0F97B4162} + Inbox2.Framework.Extensions + + + {B6402BD1-3B14-4ED8-A0A2-11665AEC6D3F} + Inbox2.Framework + + + {8E52D082-3EF7-4A0A-961C-E63C8D4B1947} + Inbox2.Framework.Interfaces + + + {7F48ED3E-C647-472C-9FAE-827F7F9BCCAC} + Inbox2.Framework.Interop + + + {C20E7E84-728A-4891-B99B-D6DD4029FFF4} + Inbox2.Framework.Persistance + + + {EF22C92A-3F62-4420-BF6B-B6F6D8CFCF40} + Inbox2.Framework.Plugins + + + {428793DE-2946-4FB0-B8B8-E372084A58E7} + Inbox2.Framework.Threading + + + {2654801F-269C-4D48-A200-E37D23AFF668} + Inbox2.Framework.UI + + + {0A5281EA-0E45-448A-9828-A7E96DA1B530} + Inbox2.Framework.Utils + + + {9B222C61-ECAD-46C0-A3DD-66E0590F9B50} + Inbox2.Framework.VirtualMailBox + + + {865E052C-9F6E-4A11-A537-E60482BEB3A5} + Inbox2.UI + + + {D6A33D90-EC04-4446-AF87-695A59E321C7} + Inbox2.UI.Launcher + + + {2E870F3B-1BBB-44B0-B534-4A1D1CCB17C8} + Inbox2.Core.Configuration + + + {FE0490D8-BD4A-493F-89A6-30399A69DD3F} + Inbox2.Core.DataAccess - x64 + + + {FA932CDB-F6E8-448D-AF20-8E338D6D26CF} + Inbox2.Core.Search + + + {45BDF5C8-D45D-4CAA-A2F5-E233B16D18F4} + Inbox2.Core.Storage + + + {0C52A195-004F-456B-AAB8-9C9A2BFA7291} + Inbox2.Core.Streams + + + {61EF019B-7EFF-4383-ABFF-17C053A7DB50} + Inbox2.Core.Threading + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + Awesomium.dll + PreserveNewest + + + + + \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Inbox2.Core.csproj b/Code/Client/Inbox2/Core/Inbox2.Core.csproj new file mode 100644 index 0000000..0bdd8d0 --- /dev/null +++ b/Code/Client/Inbox2/Core/Inbox2.Core.csproj @@ -0,0 +1,279 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {25681AD3-5D29-4BFB-A897-690A8042B4C1} + Library + Properties + Inbox2.Core + Inbox2.Core + v3.5 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + OnOutputUpdated + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x86\Debug\ + TRACE;DEBUG + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + ..\..\..\Stable Assemblies\Inbox2.Platform.Channels.dll + + + ..\..\..\Stable Assemblies\Inbox2.Platform.Framework.dll + + + ..\..\..\Stable Assemblies\Inbox2.Platform.Interfaces.dll + + + ..\..\..\Stable Assemblies\Inbox2.Platform.Logging.dll + + + False + ..\..\..\..\ThirdParty\log4net-1.2.10\log4net.dll + + + + + + ..\..\..\..\ThirdParty\PyBinding\PyBinding.dll + + + + False + ..\..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + + 3.5 + + + + 3.5 + + + 3.5 + + + + + 3.0 + + + + + AssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + UpgradeWindow.xaml + + + + + {CFEC0A6E-AFAE-4FC1-8F07-B1B0F97B4162} + Inbox2.Framework.Extensions + + + {B6402BD1-3B14-4ED8-A0A2-11665AEC6D3F} + Inbox2.Framework + + + {8E52D082-3EF7-4A0A-961C-E63C8D4B1947} + Inbox2.Framework.Interfaces + + + {7F48ED3E-C647-472C-9FAE-827F7F9BCCAC} + Inbox2.Framework.Interop + + + {C20E7E84-728A-4891-B99B-D6DD4029FFF4} + Inbox2.Framework.Persistance + + + {EF22C92A-3F62-4420-BF6B-B6F6D8CFCF40} + Inbox2.Framework.Plugins + + + {428793DE-2946-4FB0-B8B8-E372084A58E7} + Inbox2.Framework.Threading + + + {2654801F-269C-4D48-A200-E37D23AFF668} + Inbox2.Framework.UI + + + {0A5281EA-0E45-448A-9828-A7E96DA1B530} + Inbox2.Framework.Utils + + + {9B222C61-ECAD-46C0-A3DD-66E0590F9B50} + Inbox2.Framework.VirtualMailBox + + + {D5D637E1-8F2F-4EBF-913B-BC9AED09843B} + Inbox2.Plugins.Contacts + + + {BC784E2D-B8F8-4ACE-9CD0-223EDDEFC526} + Inbox2.Plugins.Conversations + + + {E12372AB-81A8-468D-A50A-23C9901617AF} + Inbox2.Plugins.Documents + + + {865E052C-9F6E-4A11-A537-E60482BEB3A5} + Inbox2.UI + + + {D6A33D90-EC04-4446-AF87-695A59E321C7} + Inbox2.UI.Launcher + + + {2E870F3B-1BBB-44B0-B534-4A1D1CCB17C8} + Inbox2.Core.Configuration + + + {0782FB55-3C4D-4E45-8D4C-2516756750C5} + Inbox2.Core.DataAccess + + + {FA932CDB-F6E8-448D-AF20-8E338D6D26CF} + Inbox2.Core.Search + + + {45BDF5C8-D45D-4CAA-A2F5-E233B16D18F4} + Inbox2.Core.Storage + + + {61EF019B-7EFF-4383-ABFF-17C053A7DB50} + Inbox2.Core.Threading + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + MSBuild:Compile + Designer + + + + + + + + + + + + + \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/LauncherCommands/AddToFavsCommand.cs b/Code/Client/Inbox2/Core/LauncherCommands/AddToFavsCommand.cs new file mode 100644 index 0000000..1ca2593 --- /dev/null +++ b/Code/Client/Inbox2/Core/LauncherCommands/AddToFavsCommand.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; +using System.Linq; +using System.Text; +using Inbox2.Framework; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.Plugins; +using Inbox2.Platform.Interfaces.Enumerations; + +namespace Inbox2.Core.LauncherCommands +{ + [Export(typeof(LauncherCommand))] + public class AddToFavsCommand : LauncherCommand + { + public AddToFavsCommand() : base("Add to favs") + { + } + + public override void Execute(string query) + { + LauncherState.Current.Channel.AddForLater( + LauncherState.Current.SelectedUris[0].ToString(), NoteTypes.Url); + } + + public override bool CanExecute(string query) + { + return LauncherState.Current.HasSelectedUris; + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/LauncherCommands/AnnotateThisFile.cs b/Code/Client/Inbox2/Core/LauncherCommands/AnnotateThisFile.cs new file mode 100644 index 0000000..325dfd3 --- /dev/null +++ b/Code/Client/Inbox2/Core/LauncherCommands/AnnotateThisFile.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; +using System.Linq; +using System.Text; +using Inbox2.Framework; +using Inbox2.Framework.Plugins; + +namespace Inbox2.Core.LauncherCommands +{ + [Export(typeof(LauncherCommand))] + public class AnnotateThisFile : LauncherCommand + { + public AnnotateThisFile() : base("Annotate this file") + { + } + + public override void Execute(string query) + { + + } + + public override bool CanExecute(string query) + { + return LauncherState.Current.HasSelectedFiles; + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/LauncherCommands/FindAPersonCommand.cs b/Code/Client/Inbox2/Core/LauncherCommands/FindAPersonCommand.cs new file mode 100644 index 0000000..846436e --- /dev/null +++ b/Code/Client/Inbox2/Core/LauncherCommands/FindAPersonCommand.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; +using System.Linq; +using System.Text; +using Inbox2.Framework; +using Inbox2.Framework.Plugins; + +namespace Inbox2.Core.LauncherCommands +{ + [Export(typeof(LauncherCommand))] + public class FindAPersonCommand : LauncherCommand + { + const string CommandText = "View the person {0}"; + + public FindAPersonCommand() : base(CommandText) + { + } + + public override void Execute(string query) + { + LauncherState.Current.Channel.Search(query); + } + + public override void UpdateDescription(string query) + { + Description = String.Format(CommandText, query); + } + + public override bool CanExecute(string query) + { + return LauncherState.Current.HasSelectedAddresses; + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/LauncherCommands/Inbox2.Core.LauncherCommands.csproj b/Code/Client/Inbox2/Core/LauncherCommands/Inbox2.Core.LauncherCommands.csproj new file mode 100644 index 0000000..9dd44a0 --- /dev/null +++ b/Code/Client/Inbox2/Core/LauncherCommands/Inbox2.Core.LauncherCommands.csproj @@ -0,0 +1,203 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {01D5F164-0F7C-450B-9B6D-DEDB74662975} + Library + Properties + Inbox2.Core.LauncherCommands + Inbox2.Core.LauncherCommands + v3.5 + 512 + OnOutputUpdated + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Channels.dll + + + False + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Framework.dll + + + False + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Interfaces.dll + + + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Logging.dll + + + + False + ..\..\..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + 3.5 + + + 3.5 + + + 3.5 + + + + + 3.0 + + + + + AssemblyInfo.cs + + + + + + + + + + + + + + + {CFEC0A6E-AFAE-4FC1-8F07-B1B0F97B4162} + Inbox2.Framework.Extensions + + + {B6402BD1-3B14-4ED8-A0A2-11665AEC6D3F} + Inbox2.Framework + + + {8E52D082-3EF7-4A0A-961C-E63C8D4B1947} + Inbox2.Framework.Interfaces + + + {EF22C92A-3F62-4420-BF6B-B6F6D8CFCF40} + Inbox2.Framework.Plugins + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + + copy "$(TargetDir)*.*" "..\..\..\..\..\..\..\Client\Inbox2\$(OutDir)" + + \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/LauncherCommands/MakeANoteCommand.cs b/Code/Client/Inbox2/Core/LauncherCommands/MakeANoteCommand.cs new file mode 100644 index 0000000..1da745d --- /dev/null +++ b/Code/Client/Inbox2/Core/LauncherCommands/MakeANoteCommand.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; +using System.Linq; +using System.Text; +using Inbox2.Framework; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.Plugins; +using Inbox2.Platform.Interfaces.Enumerations; + +namespace Inbox2.Core.LauncherCommands +{ + [Export(typeof(LauncherCommand))] + public class MakeANoteCommand : LauncherCommand + { + public MakeANoteCommand() : base("Make a note") + { + } + + public override void Execute(string query) + { + LauncherState.Current.Channel.AddForLater(query, NoteTypes.Note); + } + + public override bool CanExecute(string query) + { + return !String.IsNullOrEmpty(query); + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/LauncherCommands/PutThisFileInMyDocuments.cs b/Code/Client/Inbox2/Core/LauncherCommands/PutThisFileInMyDocuments.cs new file mode 100644 index 0000000..3b9a4da --- /dev/null +++ b/Code/Client/Inbox2/Core/LauncherCommands/PutThisFileInMyDocuments.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; +using System.Linq; +using System.Text; +using Inbox2.Framework; +using Inbox2.Framework.Plugins; + +namespace Inbox2.Core.LauncherCommands +{ + [Export(typeof(LauncherCommand))] + public class PutThisFileInMyDocuments : LauncherCommand + { + public PutThisFileInMyDocuments() : base("Put this file in my docs") + { + } + + public override void Execute(string query) + { + var filenames = LauncherState.Current.SelectedFiles.Select(f => f.FullName); + + LauncherState.Current.Channel.AddDocuments(filenames.ToArray()); + } + + public override bool CanExecute(string query) + { + return LauncherState.Current.HasSelectedFiles; + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/LauncherCommands/SearchForCommand.cs b/Code/Client/Inbox2/Core/LauncherCommands/SearchForCommand.cs new file mode 100644 index 0000000..14c0fa5 --- /dev/null +++ b/Code/Client/Inbox2/Core/LauncherCommands/SearchForCommand.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; +using System.Linq; +using System.Text; +using Inbox2.Framework; +using Inbox2.Framework.Plugins; + +namespace Inbox2.Core.LauncherCommands +{ + [Export(typeof(LauncherCommand))] + public class SearchForCommand : LauncherCommand + { + const string CommandText = "Search for {0}..."; + + public SearchForCommand() : base(CommandText) + { + } + + public override void Execute(string query) + { + LauncherState.Current.Channel.Search(query); + } + + public override void UpdateDescription(string query) + { + Description = String.Format(CommandText, query); + } + + public override bool CanExecute(string query) + { + return true; + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/LauncherCommands/SendAMessageToCommand.cs b/Code/Client/Inbox2/Core/LauncherCommands/SendAMessageToCommand.cs new file mode 100644 index 0000000..47b27bd --- /dev/null +++ b/Code/Client/Inbox2/Core/LauncherCommands/SendAMessageToCommand.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; +using System.Linq; +using System.Text; +using Inbox2.Framework; +using Inbox2.Framework.Extensions; +using Inbox2.Framework.Plugins; + +namespace Inbox2.Core.LauncherCommands +{ + [Export(typeof(LauncherCommand))] + public class SendAMessageToCommand : LauncherCommand + { + private const string CommandText = "Send a message to {0}..."; + + public SendAMessageToCommand() : base(CommandText) + { + } + + public override void Execute(string query) + { + LauncherState.Current.Channel.SendMessage(String.Empty, String.Empty, + LauncherState.Current.SelectedAddresses); + } + + public override void UpdateDescription(string query) + { + Description = String.Format(CommandText, LauncherState.Current.SelectedAddresses.ToHumanFriendlyString()); + } + + public override bool CanExecute(string query) + { + return LauncherState.Current.HasSelectedAddresses; + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/LauncherCommands/SendThisFileToCommand.cs b/Code/Client/Inbox2/Core/LauncherCommands/SendThisFileToCommand.cs new file mode 100644 index 0000000..815fe77 --- /dev/null +++ b/Code/Client/Inbox2/Core/LauncherCommands/SendThisFileToCommand.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; +using System.Linq; +using System.Text; +using Inbox2.Framework; +using Inbox2.Framework.Extensions; +using Inbox2.Framework.Plugins; + +namespace Inbox2.Core.LauncherCommands +{ + [Export(typeof(LauncherCommand))] + public class SendThisFileToCommand : LauncherCommand + { + const string CommandText = "Send this file to {0}"; + + public SendThisFileToCommand() : base(CommandText) + { + } + + public override void Execute(string query) + { + var filenames = LauncherState.Current.SelectedFiles.Select(f => f.FullName); + + LauncherState.Current.Channel.SendDocuments( + filenames.ToArray(), + LauncherState.Current.SelectedAddresses); + } + + public override void UpdateDescription(string query) + { + Description = String.Format(CommandText, + LauncherState.Current.SelectedAddresses.ToHumanFriendlyString()); + } + + public override bool CanExecute(string query) + { + return LauncherState.Current.HasSelectedFiles + && LauncherState.Current.HasSelectedAddresses; + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/LauncherCommands/SendUrlToCommand.cs b/Code/Client/Inbox2/Core/LauncherCommands/SendUrlToCommand.cs new file mode 100644 index 0000000..44a25cf --- /dev/null +++ b/Code/Client/Inbox2/Core/LauncherCommands/SendUrlToCommand.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Linq; +using System.Text; +using Inbox2.Framework; +using Inbox2.Framework.Extensions; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.Plugins; +using Inbox2.Platform.Interfaces.Enumerations; + +namespace Inbox2.Core.LauncherCommands +{ + [Export(typeof(LauncherCommand))] + public class SendUrlToCommand : LauncherCommand + { + private const string CommandText = "Send url to {0}"; + + public SendUrlToCommand() : base(CommandText) + { + } + + public override void UpdateDescription(string query) + { + Description = String.Format(CommandText, + LauncherState.Current.SelectedAddresses.ToHumanFriendlyString()); + } + + public override void Execute(string query) + { + LauncherState.Current.Channel.SendForLater( + LauncherState.Current.SelectedUris[0].ToString(), + NoteTypes.Url, + LauncherState.Current.SelectedAddresses); + } + + public override bool CanExecute(string query) + { + return LauncherState.Current.HasSelectedUris + && LauncherState.Current.HasSelectedAddresses; + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/LauncherCommands/TagThisFile.cs b/Code/Client/Inbox2/Core/LauncherCommands/TagThisFile.cs new file mode 100644 index 0000000..90c8a26 --- /dev/null +++ b/Code/Client/Inbox2/Core/LauncherCommands/TagThisFile.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; +using System.Linq; +using System.Text; +using Inbox2.Framework; +using Inbox2.Framework.Plugins; + +namespace Inbox2.Core.LauncherCommands +{ + [Export(typeof(LauncherCommand))] + public class TagThisFile : LauncherCommand + { + const string CommandText = "Tag this file {0}"; + + public TagThisFile() : base(CommandText) + { + } + + public override void Execute(string query) + { + + } + + public override void UpdateDescription(string query) + { + Description = String.Format(CommandText, query); + } + + public override bool CanExecute(string query) + { + return LauncherState.Current.HasSelectedFiles; + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Search/Inbox2.Core.Search.csproj b/Code/Client/Inbox2/Core/Search/Inbox2.Core.Search.csproj new file mode 100644 index 0000000..014c16c --- /dev/null +++ b/Code/Client/Inbox2/Core/Search/Inbox2.Core.Search.csproj @@ -0,0 +1,198 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {FA932CDB-F6E8-448D-AF20-8E338D6D26CF} + Library + Properties + Inbox2.Core.Search + Inbox2.Core.Search + v3.5 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + False + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Channels.dll + + + + + False + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Logging.dll + + + False + ..\..\..\..\..\ThirdParty\Lucene.NET\Lucene.Net.dll + + + False + ..\..\..\..\..\ThirdParty\Lucene.NET\Snowball.Net.dll + + + + False + ..\..\..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + AssemblyInfo.cs + + + + + + + + + + + + + {B6402BD1-3B14-4ED8-A0A2-11665AEC6D3F} + Inbox2.Framework + + + {8E52D082-3EF7-4A0A-961C-E63C8D4B1947} + Inbox2.Framework.Interfaces + + + {C20E7E84-728A-4891-B99B-D6DD4029FFF4} + Inbox2.Framework.Persistance + + + {2E870F3B-1BBB-44B0-B534-4A1D1CCB17C8} + Inbox2.Core.Configuration + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Search/IndexHelper.cs b/Code/Client/Inbox2/Core/Search/IndexHelper.cs new file mode 100644 index 0000000..c4f6ffb --- /dev/null +++ b/Code/Client/Inbox2/Core/Search/IndexHelper.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; + +namespace Inbox2.Core.Search +{ + static class IndexHelper + { + public static Dictionary GetWordsCount(string source) + { + var words = new Dictionary(); + + foreach (var word in GetWords(source)) + { + if (!words.ContainsKey(word)) + words.Add(word, 0); + + words[word]++; + } + + return words; + } + + static IEnumerable GetWords(string source) + { + MatchCollection mc = Regex.Matches(source, @"\b[A-Za-z]+\b", RegexOptions.None); + + foreach (Match ma in mc) + yield return ma.Value.ToLower(); + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Search/Indexer/Clustering.cs b/Code/Client/Inbox2/Core/Search/Indexer/Clustering.cs new file mode 100644 index 0000000..938d31a --- /dev/null +++ b/Code/Client/Inbox2/Core/Search/Indexer/Clustering.cs @@ -0,0 +1,157 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using m = System.Math; + +namespace Inbox2.Core.Search.Indexer +{ + static class Clustering + { + public static double Pearson(IEnumerable v1, IEnumerable v2) + { + var sum1 = v1.Sum(); + var sum2 = v2.Sum(); + + // Sum of the squares + var sum1Sq = v1.Sum(v => m.Pow(v, 2)); + var sum2Sq = v2.Sum(v => m.Pow(v, 2)); + + // Sum of the products + var l1 = v1.ToArray(); + var l2 = v2.ToArray(); + + if (l1.Length != l2.Length) + throw new ApplicationException("Input data should contain the equal number of items"); + + long pSum = Enumerable.Range(0, l1.Length) + .Select(i => l1[i] * l2[i]) + .Sum(); + + // Calculate r (Pearson score) + var num = pSum - (sum1 * sum2 / l1.Length); + var den = + m.Sqrt((sum1Sq - m.Pow(sum1, 2)/l1.Length)*(sum2Sq - m.Pow(sum2, 2)/l2.Length)); + + if (den == 0) + return 0; + + return 1.0 - num /den; + } + + public static BiCluster HCluster(IEnumerable words) + { + var wordsList = words.ToArray(); + var distances = new Dictionary(); + int currentClustId = -1; + + List clust = new List(wordsList.Length); + + for (int i = 0; i < wordsList.Length; i++) + clust.Add(new BiCluster(wordsList[i].Entities.Values, i, 0.0)); + + while (clust.Count > 1) + { + Pair lowestpair = new Pair(0, 1); + + var closest = Pearson(clust[0].Vector, clust[1].Vector); + + // loop through every pair looking for the smallest distance + for (int i = 0; i < clust.Count; i++) + { + for (int j = i + 1; j < clust.Count; j++) + { + // distances is the cache of distance calculations + if (!distances.ContainsKey(new Pair(clust[i].Id, clust[j].Id))) + { + // Calculate the pearson value + var val = Pearson(clust[i].Vector, clust[j].Vector); + + distances.Add(new Pair(clust[i].Id, clust[j].Id), val); + } + + double d = distances[new Pair(clust[i].Id, clust[j].Id)]; + + if (d < closest) + { + closest = d; + lowestpair = new Pair(i, j); + } + } + } + + // calculate the average of the two clusters + List mergevec = new List(); + long[] vectorArray = clust[0].Vector.ToArray(); + for (int i = 0; i < vectorArray.Length; i++) + { + long[] leftVectorArray = clust[lowestpair.Left].Vector.ToArray(); + long[] rightVectorArray = clust[lowestpair.Right].Vector.ToArray(); + + mergevec.Add((leftVectorArray[i] + rightVectorArray[i]) / 2); + } + + //create the new cluster + BiCluster newCluster = new BiCluster(mergevec, currentClustId, closest, clust[lowestpair.Left], clust[lowestpair.Right]); + + //cluster ids that weren't in the original set are negative + currentClustId--; + clust.Remove(clust[lowestpair.Left]); + clust.Remove(clust[lowestpair.Right]); + clust.Add(newCluster); + + } + return clust[0]; + } + + public class BiCluster + { + public IEnumerable Vector { get; private set; } + public int Id { get; private set; } + public double Distance { get; private set; } + public BiCluster Left { get; private set; } + public BiCluster Right { get; private set; } + + public BiCluster(IEnumerable vector, int id, double distance) + { + Vector = vector; + Id = id; + Distance = distance; + } + + public BiCluster(IEnumerable vector, int id, double distance, BiCluster left, BiCluster right) + { + Vector = vector; + Id = id; + Distance = distance; + Left = left; + Right = right; + } + } + + class Pair + { + public int Left { get; set; } + + public int Right { get; set; } + + public Pair(int left, int right) + { + Left = left; + Right = right; + } + + public override int GetHashCode() + { + return String.Format("{0}{1}", Left, Right).GetHashCode(); + } + + public override bool Equals(object obj) + { + Pair other = (Pair) obj; + + return String.Format("{0}{1}", Left, Right) + .Equals(String.Format("{0}{1}", other.Left, other.Right)); + } + } + } +} diff --git a/Code/Client/Inbox2/Core/Search/Indexer/WordVector.cs b/Code/Client/Inbox2/Core/Search/Indexer/WordVector.cs new file mode 100644 index 0000000..c36b948 --- /dev/null +++ b/Code/Client/Inbox2/Core/Search/Indexer/WordVector.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Core.Search.Indexer +{ + class WordVector + { + private string word; + private long count; + private bool isDirty; + private Dictionary entities; + + public string Word + { + get { return word; } + } + + public long Count + { + get { return count; } + } + + public bool IsDirty + { + get { return isDirty; } + } + + public Dictionary Entities + { + get { return entities; } + } + + public WordVector(string word) + { + this.word = word; + this.entities = new Dictionary(); + } + + public void AddWordCount(string entityKey, int wordCount) + { + count += wordCount; + isDirty = true; + + if (entities.ContainsKey(entityKey)) + entities.Remove(entityKey); + + entities.Add(entityKey, wordCount); + } + } +} diff --git a/Code/Client/Inbox2/Core/Search/Reflection/PropertyToken.cs b/Code/Client/Inbox2/Core/Search/Reflection/PropertyToken.cs new file mode 100644 index 0000000..1097bc9 --- /dev/null +++ b/Code/Client/Inbox2/Core/Search/Reflection/PropertyToken.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Core.Search.Reflection +{ + class PropertyToken + { + public string Name { get; set; } + + public string Value { get; set; } + + public bool Tokenize { get; set; } + + public bool Store { get; set; } + } +} diff --git a/Code/Client/Inbox2/Core/Search/Reflection/Reflector.cs b/Code/Client/Inbox2/Core/Search/Reflection/Reflector.cs new file mode 100644 index 0000000..bbcefad --- /dev/null +++ b/Code/Client/Inbox2/Core/Search/Reflection/Reflector.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Reflection; +using System.Text; +using Inbox2.Framework.Interfaces; +using Inbox2.Framework.Persistance; +using Inbox2.Platform.Channels.Attributes; +using Inbox2.Platform.Logging; + +namespace Inbox2.Core.Search.Reflection +{ + static class Reflector + { + public static IEnumerable GetMappers(T source) + { + Type type = typeof(T); + + var attributes = type.GetCustomAttributes(typeof(ContentMapperAttribute), false); + + if (attributes != null && attributes.Length > 0) + { + foreach (ContentMapperAttribute attribute in attributes) + { + yield return (IContentMapper)Activator.CreateInstance(attribute.MapperType, source); + } + } + } + + public static string GetPrimaryKey() + { + var properties = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public); + + foreach (var property in properties) + { + var attributes = property.GetCustomAttributes(typeof(PrimaryKeyAttribute), true); + + if (attributes != null && attributes.Length > 0) + { + return property.Name; + } + } + + Logger.Error("Unable to determine primary key for entity {0}", LogSource.Search, typeof(T)); + + return null; + } + + public static PropertyInfo GetPrimaryKeyInstance() + { + var properties = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public); + + foreach (var property in properties) + { + var attributes = property.GetCustomAttributes(typeof(PrimaryKeyAttribute), true); + + if (attributes != null && attributes.Length > 0) + { + return property; + } + } + + Logger.Error("Unable to determine primary key for entity {0}", LogSource.Search, typeof(T)); + + return null; + } + + public static IEnumerable GetTokensFrom(T instance, params IContentMapper[] mappers) + { + var properties = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public); + + foreach (var property in properties) + { + var attributes = property.GetCustomAttributes(typeof(IndexAttribute), true); + + if (attributes != null && attributes.Length > 0) + { + IndexAttribute attr = (IndexAttribute)attributes[0]; + + object value = null; + + if (instance != null) + { + value = GetValue(instance, property, mappers); + } + + // Value can be converted using IContentMapper, so try to retrieve the correct type converter + var actualType = value == null ? property.PropertyType : value.GetType(); + + TypeConverter conv = TypeDescriptor.GetConverter(actualType); + + yield return new PropertyToken + { + Name = property.Name, + Store = attr.Store, + Tokenize = attr.Tokenize, + Value = conv.ConvertToString(value) + }; + } + } + } + + public static object GetValue(T instance, PropertyInfo property, IContentMapper[] mappers) + { + if (mappers.Length > 0) + { + foreach (var mapper in mappers) + { + if (mapper.PropertyName == property.Name) + return mapper.GetContent(); + } + } + + return property.GetValue(instance, null); + } + } +} diff --git a/Code/Client/Inbox2/Core/Search/Search.cs b/Code/Client/Inbox2/Core/Search/Search.cs new file mode 100644 index 0000000..42cd2a9 --- /dev/null +++ b/Code/Client/Inbox2/Core/Search/Search.cs @@ -0,0 +1,173 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; +using System.Linq; +using System.Threading; +using Inbox2.Core.Configuration; +using Inbox2.Core.Search.Reflection; +using Inbox2.Framework; +using Inbox2.Framework.Interfaces; +using Inbox2.Platform.Framework.Locking; +using Inbox2.Platform.Interfaces; +using Inbox2.Platform.Logging; +using Lucene.Net.Analysis; +using Lucene.Net.Analysis.Standard; +using Lucene.Net.Documents; +using Lucene.Net.Index; +using Lucene.Net.Search; + +namespace Inbox2.Core.Search +{ + [Export(typeof(ISearch))] + public class Search : ISearch, ISynchronizedObject + { + private readonly string path; + private readonly Analyzer analyzer; + private int? maxResults = null; + + public Search() + { + this.path = Path.Combine(DebugKeys.DefaultDataDirectory, "search"); + analyzer = new StandardAnalyzer(); + } + + /// + /// Stores the specified source. + /// + /// + /// The source. + public void Store(T source) + { + IContentMapper[] mappers = Reflector.GetMappers(source).ToArray(); + + var doc = SearchHelper.CreateDocument(source, mappers); + + if (doc.GetFieldsCount() == 0) + { + Logger.Debug("Document did not contain any fields, ignoring add", LogSource.Search); + + return; + } + + using (WriterLock) + { + // Add document to the index + IndexWriter writer = new IndexWriter(path, analyzer, false); + writer.AddDocument(doc); + writer.Close(); + } + } + + /// + /// Delete the given item from the search index. + /// + /// + /// + public void Delete(T source) + { + var pk = Reflector.GetPrimaryKeyInstance(); + + if (pk != null) + { + var value = pk.GetValue(source, null); + + using (WriterLock) + { + // Add document to the index + IndexReader reader = IndexReader.Open(path); + reader.DeleteDocuments(new Term(pk.Name, value.ToString())); + reader.Close(); + } + } + } + + public IEnumerable PerformSearch(string searchQuery) where T : new() + { + Query query = SearchHelper.BuildQuery(searchQuery, analyzer); + string primary = Reflector.GetPrimaryKey(); + + using (ReaderLock) + { + IndexSearcher searcher = new IndexSearcher(path); + + Hits hits = searcher.Search(query); + int count = hits.Length(); + + try + { + for (int i = 0; i < count; i++) + { + if (maxResults.HasValue && i > maxResults) + yield break; + + var doc = hits.Doc(i); + + Field primaryId = doc.GetField(primary); + + if (primaryId != null) + { + var value = primaryId.StringValue(); + + if (!String.IsNullOrEmpty(value)) + yield return Int64.Parse(primaryId.StringValue()); + } + } + } + finally + { + searcher.Close(); + } + } + } + + public IEnumerable PerformRelatedSearch(string searchQuery) + { + //var b = Clustering.HCluster(MemoryIndex.Current.Words.Values); + + yield break; + } + + #region Locking implementation + + protected ReaderWriterLockSlim _lock = new ReaderWriterLockSlim(); + + public void AcquireReaderLock() + { + _lock.EnterReadLock(); + } + + public void ReleaseReaderLock() + { + _lock.ExitReadLock(); + } + + public void AcquireWriterLock() + { + _lock.EnterWriteLock(); + } + + public void ReleaseWriterLock() + { + _lock.ExitWriteLock(); + } + + public static ReaderLock ReaderLock + { + get + { + return new ReaderLock(ClientState.Current.Search as ISynchronizedObject); + } + } + + public static WriterLock WriterLock + { + get + { + return new WriterLock(ClientState.Current.Search as ISynchronizedObject); + } + } + + #endregion + } +} diff --git a/Code/Client/Inbox2/Core/Search/SearchHelper.cs b/Code/Client/Inbox2/Core/Search/SearchHelper.cs new file mode 100644 index 0000000..bc8abc3 --- /dev/null +++ b/Code/Client/Inbox2/Core/Search/SearchHelper.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Inbox2.Core.Search.Reflection; +using Inbox2.Framework.Interfaces; +using Lucene.Net.Analysis; +using Lucene.Net.Documents; +using Lucene.Net.QueryParsers; +using Lucene.Net.Search; + +namespace Inbox2.Core.Search +{ + static class SearchHelper + { + /// + /// Creates a document from the given object by analyzing its decorated properties. + /// + /// + /// The instance. + /// + /// + public static Document CreateDocument(T instance, params IContentMapper[] mappers) + { + // Read properties to store + Document doc = new Document(); + + foreach (var token in Reflector.GetTokensFrom(instance, mappers)) + { + doc.Add( + new Field(token.Name, token.Value, + token.Store ? Field.Store.YES : Field.Store.NO, + token.Tokenize ? Field.Index.TOKENIZED : Field.Index.UN_TOKENIZED)); + } + + // Add type marker + doc.Add(new Field("Type", typeof(T).Name, Field.Store.YES, Field.Index.UN_TOKENIZED)); + + return doc; + } + + public static Query BuildQuery(string searchQuery, Analyzer analyzer) + { + var tokens = Reflector.GetTokensFrom(default(T)).ToList(); + + string[] fields = new string[tokens.Count + 1]; + string[] queries = new string[tokens.Count +1]; + BooleanClause.Occur[] occurs = new BooleanClause.Occur[tokens.Count + 1]; + + for (int i = 0; i < tokens.Count; i++) + { + var token = tokens[i]; + + queries[i] = token.Name; + fields[i] = searchQuery; + occurs[i] = BooleanClause.Occur.SHOULD; + } + + queries[tokens.Count] = "Type"; + fields[tokens.Count] = typeof(T).Name; + occurs[tokens.Count] = BooleanClause.Occur.SHOULD; + + return MultiFieldQueryParser.Parse(fields, queries, occurs, analyzer); + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Search/SearchUtil.cs b/Code/Client/Inbox2/Core/Search/SearchUtil.cs new file mode 100644 index 0000000..ab622b5 --- /dev/null +++ b/Code/Client/Inbox2/Core/Search/SearchUtil.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using Inbox2.Core.Configuration; +using Lucene.Net.Analysis.Standard; +using Lucene.Net.Index; + +namespace Inbox2.Core.Search +{ + public static class SearchUtil + { + public static void InitializeSearchStore() + { + string index = Path.Combine(DebugKeys.DefaultDataDirectory, "search"); + + if (IndexReader.IndexExists(index) == false) + { + IndexWriter writer = new IndexWriter(index, new StandardAnalyzer(), true); + + writer.Close(); + } + } + } +} diff --git a/Code/Client/Inbox2/Core/Shutdown.cs b/Code/Client/Inbox2/Core/Shutdown.cs new file mode 100644 index 0000000..999dc3c --- /dev/null +++ b/Code/Client/Inbox2/Core/Shutdown.cs @@ -0,0 +1,95 @@ +using System; +using System.IO; +using System.Text; +using Inbox2.Core.Configuration; +using Inbox2.Framework; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.Stats; +using Inbox2.Platform.Channels.Connections; +using Inbox2.Platform.Framework.Web; +using Inbox2.UI.Launcher; +using Newtonsoft.Json; + +namespace Inbox2.Core +{ + public class Shutdown + { + public void Run() + { + EventBroker.Publish(AppEvents.ShuttingDown); + + Stats(); + KeyboardHooks(); + SaveSettings(); + Connections(); + Databases(); + Storage(); + } + + /// + /// Gets or sets a value indicating whether this instance is shutting down. + /// + /// + /// true if this instance is shutting down; otherwise, false. + /// + public static bool IsShuttingDown { get; set; } + + public static void SaveSettings() + { + foreach (var plugin in PluginsManager.Current.Plugins) + { + if (plugin.State != null) + plugin.State.Shutdown(); + } + + SettingsManager.Save(); + } + + public static void Connections() + { + ConnectionPoolScavenger.Shutdown(); + } + + public static void Databases() + { + } + + public static void Storage() + { + ClientState.Current.Storage.Dispose(); + } + + public static void KeyboardHooks() + { + Keyboard.Shutdown(); + } + + public static void Stats() + { + var stats = ClientStats.Flush(); + + if (stats.Count > 0) + { + var sb = new StringBuilder(); + + using (var sw = new StringWriter(sb)) + { + // Create json representation of data + var ser = new JsonSerializer(); + ser.Serialize(sw, stats); + } + + SettingsManager.ClientSettings.ContextSettings["/Application/StoredStats"] = sb.ToString(); + } + } + + /// + /// Resets the data store. + /// + public static void ResetDataStore() + { + if (Directory.Exists(DebugKeys.DefaultDataDirectory) == false) + Directory.Delete(DebugKeys.DefaultDataDirectory, true); + } + } +} diff --git a/Code/Client/Inbox2/Core/Startup.cs b/Code/Client/Inbox2/Core/Startup.cs new file mode 100644 index 0000000..4cc2039 --- /dev/null +++ b/Code/Client/Inbox2/Core/Startup.cs @@ -0,0 +1,288 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.Composition; +using System.ComponentModel.Composition.Hosting; +using System.Deployment.Application; +using System.IO; +using System.Linq; +using System.Net.NetworkInformation; +using System.Reflection; +using Inbox2.Core.Configuration; +using Inbox2.Core.DataAccess; +using Inbox2.Core.Search; +using Inbox2.Core.Storage; +using Inbox2.Core.Threading; +using Inbox2.Core.Threading.Tasks; +using Inbox2.Framework; +using Inbox2.Framework.Deployment; +using Inbox2.Framework.Extensions.ComponentModel; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.Stats; +using Inbox2.Framework.VirtualMailBox; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Framework; +using Inbox2.Platform.Framework.CloudApi.Logging; +using Inbox2.Platform.Framework.ComponentModel; +using Inbox2.Platform.Framework.Web; +using Inbox2.Platform.Logging; +using Inbox2.UI; +using Newtonsoft.Json; +using PyBinding; +using DebugKeys=Inbox2.Core.Configuration.DebugKeys; +using Document = Inbox2.Framework.VirtualMailBox.Entities.Document; +using Message = Inbox2.Framework.VirtualMailBox.Entities.Message; +using Person = Inbox2.Framework.VirtualMailBox.Entities.Person; +using Profile = Inbox2.Framework.VirtualMailBox.Entities.Profile; + +namespace Inbox2.Core +{ + public class Startup + { + private static bool _isFirstRun; + + public static void PyBinding() + { + // All assemblies used by PyBinding should be added here + Assembly.LoadFrom(Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "Inbox2.Platform.Channels.dll")); + + // Loads the IronPython runtime + PythonEvaluator evaluator = new PythonEvaluator(); + } + + /// + /// Initializes logging. + /// + public static void Logging(string filename) + { + if (Directory.Exists(DebugKeys.DefaultDataDirectory) == false) + { + Directory.CreateDirectory(DebugKeys.DefaultDataDirectory); + _isFirstRun = true; + } + + string logpath = Path.Combine(DebugKeys.DefaultDataDirectory, "logs"); + + if (!Directory.Exists(logpath)) Directory.CreateDirectory(logpath); + + // Set the log path property which is used by our client logger + log4net.GlobalContext.Properties["LogPath"] = logpath; + + using (Stream log4netConfigStream = typeof(Logger).Assembly.GetManifestResourceStream("Inbox2.Platform.Logging." + filename)) + Logger.Initialize(new Log4NetLogger(log4netConfigStream)); + + Logger.Debug("__________________________", LogSource.Startup); + Logger.Debug("Inbox2 application startup", LogSource.Startup); + Logger.Debug("Version: " + Assembly.GetExecutingAssembly().GetName().Version, LogSource.Startup); + Logger.Debug("Data directory is {0}", LogSource.Startup, DebugKeys.DefaultDataDirectory); + } + + /// + /// Initializes the data sources. + /// + public static void DataSources() + { + DatabaseUtil.InitializeDataStore(); + + // Right now hardcoded to speed up startup + ClientState.Current.DataService = new SQLiteDataService(); + } + + /// + /// Initializes the search index. + /// + public static void Search() + { + SearchUtil.InitializeSearchStore(); + } + + /// + /// Initializes the application plugins. + /// + public static void CorePlugins() + { + using (new CodeTimer("Startup/CorePlugins")) + { + ClientState.Current.Storage = new OpenFileStorage(); + ClientState.Current.Search = new Search.Search(); + ClientState.Current.TaskQueue = new TaskQueue(); + ClientState.Current.Context = new ClientContext(); + ClientState.Current.UndoManager = new UndoManager(); + ClientState.Current.ViewController = new ViewController(); + } + } + + public static void AppPlugins() + { + using (new CodeTimer("Startup/AppPlugins")) + { + // Build MEF catalog of components + var catalog = new AggregateCatalog(); + + catalog.Catalogs.Add(new DirectoryCatalog(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "*commands*.dll")); + catalog.Catalogs.Add(new DirectoryCatalog(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "*.plugins.*.dll")); + + var container = new CompositionContainer(catalog); + + container.ComposeParts(PluginsManager.Current); + } + } + + /// + /// Initializes the commands. + /// + public static void Commands() + { + EventBroker.Subscribe(AppEvents.RequestSend, Tasks.Send); + + EventBroker.Subscribe(AppEvents.RequestReceive, Tasks.ReceivePrio); + EventBroker.Subscribe(AppEvents.RequestReceive, (int pageSize) => Tasks.ReceivePage(pageSize)); + EventBroker.Subscribe(AppEvents.RequestReceive, (ChannelInstance channel) => Tasks.Receive(channel)); + + EventBroker.Subscribe(AppEvents.RequestSync, Tasks.SyncPrio); + EventBroker.Subscribe(AppEvents.RequestSync, (ChannelInstance channel) => Tasks.Sync(channel)); + + EventBroker.Subscribe(AppEvents.RequestCommands, Tasks.Commands); + + NetworkChange.NetworkAvailabilityChanged += delegate + { + if (NetworkInterface.GetIsNetworkAvailable()) + { + Tasks.Send(); + Tasks.Commands(); + Tasks.Receive(); + } + }; + } + + /// + /// Initializes the database and stuff. + /// + public static void Plumbing() + { + var clientId = SettingsManager.ClientSettings.AppConfiguration.ClientId; + var baseUrl = String.Format("http://download{0}.inbox2.com/", + String.IsNullOrEmpty(CommandLine.Current.Environment) ? String.Empty : "." + CommandLine.Current.Environment); + + Migrate.Up(typeof(ChannelConfig)); + Migrate.Up(typeof(Conversation)); + Migrate.Up(typeof(Message)); + Migrate.Up(typeof(Document)); + Migrate.Up(typeof(DocumentVersion)); + Migrate.Up(typeof(Person)); + Migrate.Up(typeof(Profile)); + Migrate.Up(typeof(UserStatus)); + Migrate.Up(typeof(UserStatusAttachment)); + Migrate.Up(typeof(QueuedCommand)); + Migrate.Up(typeof(FeedItem)); + + var appVersion = Assembly.GetExecutingAssembly().GetName().Version; + var savedVersion = SettingsManager.ClientSettings.Version; + + Logger.Warn("Saved version {0}", LogSource.Startup, savedVersion); + + if (_isFirstRun || Environment.CommandLine.Contains("/firstrun")) + { + HttpServiceRequest.Post(baseUrl + "version/install", + String.Format("clientId={0}&version={1}", clientId, appVersion)); + } + + if (_isFirstRun == false && appVersion > savedVersion) + { + Logger.Debug("Upgrade detected, performing nescessary upgrade actions", LogSource.Startup); + + // Get all upgrades + UpgradeActionBase.Upgrades.AddRange(typeof(Startup) + .Assembly.GetTypes() + .Where(t => t.IsSubclassOf(typeof (UpgradeActionBase))) + .Select(t => (UpgradeActionBase) Activator.CreateInstance(t)) + .Where(i => i.TargetVersion > savedVersion) + .OrderBy(i => i.TargetVersion)); + + UpgradeActionBase.Upgrades.ForEach(i => i.Upgrade()); + + HttpServiceRequest.Post(baseUrl + "version/upgrade", + String.Format("clientId={0}&from={1}&to={2}", clientId, savedVersion, appVersion)); + } + + // Save current version + SettingsManager.ClientSettings.Version = appVersion; + } + + /// + /// Loads and initializes the channels. + /// + public static void Channels() + { + var channels = ClientState.Current.DataService.SelectAll(); + + foreach (var channel in channels) + ChannelsManager.Add(ChannelFactory.Create(channel)); + } + + /// + /// Initializes the type converters. + /// + public static void TypeConverters() + { + TypeDescriptor.AddAttributes(typeof(SourceAddress), + new TypeConverterAttribute(typeof(SourceAddressConverter))); + + TypeDescriptor.AddAttributes(typeof(SourceAddressCollection), + new TypeConverterAttribute(typeof(SourceAddressCollectionConverter))); + + TypeDescriptor.AddAttributes(typeof(Stream), + new TypeConverterAttribute(typeof(StreamConverter))); + } + + /// + /// Gets the app version. + /// + /// + public static Version GetAppVersion() + { + //Get the version of the currently executing Assembly + Version currentVersion = Assembly.GetExecutingAssembly().GetName().Version; + + //Check to see if we are ClickOnce Deployed + if (ApplicationDeployment.IsNetworkDeployed) + currentVersion = ApplicationDeployment.CurrentDeployment.CurrentVersion; + + return currentVersion; + } + + /// + /// Initializes the keyboard hooks. + /// + public static void KeyboardHooks() + { + //Keyboard.Initialize(); + } + + public static void LoadStats() + { + // Check if we have a saved logs + if (SettingsManager.ClientSettings.ContextSettings.ContainsKey("/Application/StoredStats")) + { + var storedlogs = SettingsManager.ClientSettings.ContextSettings["/Application/StoredStats"]; + + if (storedlogs != null) + { + // Deserialize logs + using (var sr = new StringReader((string) storedlogs)) + { + var ser = new JsonSerializer(); + var logs = (List)ser.Deserialize(sr, typeof(List)); + + ClientStats.ReEnqueue(logs); + + SettingsManager.ClientSettings.ContextSettings.Remove("/Application/StoredStats"); + SettingsManager.Save(); + } + } + } + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Storage/Inbox2.Core.Storage.csproj b/Code/Client/Inbox2/Core/Storage/Inbox2.Core.Storage.csproj new file mode 100644 index 0000000..0f5b62d --- /dev/null +++ b/Code/Client/Inbox2/Core/Storage/Inbox2.Core.Storage.csproj @@ -0,0 +1,188 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {45BDF5C8-D45D-4CAA-A2F5-E233B16D18F4} + Library + Properties + Inbox2.Core.Storage + Inbox2.Core.Storage + v3.5 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + False + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Framework.dll + + + False + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Interfaces.dll + + + False + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Logging.dll + + + + False + ..\..\..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + 3.5 + + + 3.5 + + + 3.5 + + + + + 3.0 + + + + + AssemblyInfo.cs + + + + + + {CFEC0A6E-AFAE-4FC1-8F07-B1B0F97B4162} + Inbox2.Framework.Extensions + + + {B6402BD1-3B14-4ED8-A0A2-11665AEC6D3F} + Inbox2.Framework + + + {8E52D082-3EF7-4A0A-961C-E63C8D4B1947} + Inbox2.Framework.Interfaces + + + {2E870F3B-1BBB-44B0-B534-4A1D1CCB17C8} + Inbox2.Core.Configuration + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Storage/OpenFileStorage.cs b/Code/Client/Inbox2/Core/Storage/OpenFileStorage.cs new file mode 100644 index 0000000..5f88309 --- /dev/null +++ b/Code/Client/Inbox2/Core/Storage/OpenFileStorage.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; +using System.Linq; +using System.Text; +using Inbox2.Core.Configuration; +using Inbox2.Framework.Interfaces; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Logging; + +namespace Inbox2.Core.Storage +{ + [Export(typeof(IFileStorage))] + public class OpenFileStorage : IFileStorage + { + protected string DataDirectory = Path.Combine(DebugKeys.DefaultDataDirectory, "fs"); + + public OpenFileStorage() + { + DirectoryInfo dir = new DirectoryInfo(DataDirectory); + + if (!dir.Exists) + dir.Create(); + } + + public Stream Read(string ns, string filename) + { + #region Input validation + + if (String.IsNullOrEmpty(ns)) + { + Logger.Error("Namespace parameter was null or empty.", LogSource.Storage); + + return null; + } + + if (String.IsNullOrEmpty(filename)) + { + Logger.Error("Filename parameter was null or empty.", LogSource.Storage); + + return null; + } + + #endregion + + try + { + FileInfo file = new FileInfo(ResolvePhysicalFilename(ns, filename)); + + if (file.Exists == false) + { + Logger.Error("Requested file was not found. Namespace = {0}, Filename = {1}", LogSource.Storage, ns, filename); + + return null; + } + + return new FileStream(ResolvePhysicalFilename(ns, filename), FileMode.Open, FileAccess.Read, FileShare.Read); + } + catch (Exception e) + { + Logger.Error("An error has occured during a read operation. Namespace = {0}, Filename = {1}, Exception = {2}", LogSource.Storage, ns, filename, e); + + return null; + } + } + + public bool Write(string ns, string filename, Stream dataStream) + { + #region Input validation + + if (String.IsNullOrEmpty(ns)) + { + Logger.Error("Namespace parameter was null or empty.", LogSource.Storage); + + return false; + } + + if (String.IsNullOrEmpty(filename)) + { + Logger.Error("Filename parameter was null or empty.", LogSource.Storage); + + return false; + } + + if (dataStream == null) + { + Logger.Error("DataStream parameter was null or empty.", LogSource.Storage); + + return false; + } + + #endregion + + try + { + using (FileStream fs = new FileStream(ResolvePhysicalFilename(ns, filename), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.ReadWrite)) + { + dataStream.CopyTo(fs); + } + } + catch (Exception e) + { + Logger.Error("An error has occured during a write operation. Namespace = {0}, Filename = {1}, Exception = {2}", LogSource.Storage, ns, filename, e); + + return false; + } + + return true; + } + + public bool Delete(string ns, string filename) + { + FileInfo file = new FileInfo(ResolvePhysicalFilename(ns, filename)); + + if (file.Exists) + { + file.Delete(); + + return true; + } + + return false; + } + + public string ResolvePhysicalFilename(string ns, string filename) + { + var basePath = Path.Combine(DataDirectory, ns); + + if (!Directory.Exists(basePath)) + Directory.CreateDirectory(basePath); + + return Path.Combine(basePath, filename); + } + + public void Dispose() + { + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Commands/CommandFactory.cs b/Code/Client/Inbox2/Core/Threading/Commands/CommandFactory.cs new file mode 100644 index 0000000..bca3e5b --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Commands/CommandFactory.cs @@ -0,0 +1,78 @@ +using System; +using System.Linq; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.Threading; +using Inbox2.Framework.VirtualMailBox; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Framework.CloudApi.Enumerations; + +namespace Inbox2.Core.Threading.Commands +{ + public static class CommandFactory + { + public static CommandBase CreateCommand(QueuedCommand command) + { + switch (command.CommandType) + { + case AppCommands.SendMessage: + return new SendMessageCommand(GetMessage(command)); + + case AppCommands.SendStatusUpdate: + return new SendStatusUpdateCommand(GetUserStatus(command)); + + case AppCommands.SyncMessage: + return new SyncEntityCommand(Entities.Messages, GetMessage(command).MessageKey, command); + + case AppCommands.SyncPerson: + return new SyncEntityCommand(Entities.Persons, GetPerson(command).PersonKey, command); + + case AppCommands.SyncStatusUpdate: + return new SyncEntityCommand(Entities.StatusUpdates, GetUserStatus(command).StatusKey, command); + } + + throw new ArgumentException(String.Format("Unexpected command type {0}", command.CommandType)); + } + + static Message GetMessage(QueuedCommand command) + { + var messageid = Int64.Parse(command.Target.Substring(1)); + Message message; + + using (VirtualMailBox.Current.Messages.ReaderLock) + message = VirtualMailBox.Current.Messages.FirstOrDefault(m => m.MessageId == messageid); + + if (message == null) + throw new ApplicationException(String.Format("The given source entity with key {0} was not found", command.Target)); + + return message; + } + + static UserStatus GetUserStatus(QueuedCommand command) + { + var statusId = Int64.Parse(command.Target.Substring(1)); + UserStatus status; + + using (VirtualMailBox.Current.StatusUpdates.ReaderLock) + status = VirtualMailBox.Current.StatusUpdates.FirstOrDefault(s => s.StatusId == statusId); + + if (status == null) + throw new ApplicationException(String.Format("The given source entity with key {0} was not found", command.Target)); + + return status; + } + + static Person GetPerson(QueuedCommand command) + { + var personId = Int64.Parse(command.Target.Substring(1)); + Person person; + + using (VirtualMailBox.Current.Persons.ReaderLock) + person = VirtualMailBox.Current.Persons.FirstOrDefault(s => s.PersonId == personId); + + if (person == null) + throw new ApplicationException(String.Format("The given source entity with key {0} was not found", command.Target)); + + return person; + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Commands/SendMessageCommand.cs b/Code/Client/Inbox2/Core/Threading/Commands/SendMessageCommand.cs new file mode 100644 index 0000000..cc59cb5 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Commands/SendMessageCommand.cs @@ -0,0 +1,233 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading; +using System.Web; +using Inbox2.Core.Configuration; +using Inbox2.Core.Configuration.Channels; +using Inbox2.Core.Threading.Tasks; +using Inbox2.Framework; +using Inbox2.Framework.Extensions; +using Inbox2.Framework.Localization; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.Threading; +using Inbox2.Framework.Threading.Progress; +using Inbox2.Framework.VirtualMailBox; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Framework.Web; +using Inbox2.Platform.Framework.Web.Upload; +using Inbox2.Platform.Interfaces.Enumerations; +using Inbox2.Platform.Logging; + +namespace Inbox2.Core.Threading.Commands +{ + class SendMessageCommand : ConnectedCommand + { + private readonly Message message; + private readonly VirtualMailBox mailbox; + + public SendMessageCommand(Message message) + { + this.message = message; + this.mailbox = VirtualMailBox.Current; + } + + protected override void ExecuteCore() + { + var access = new ClientMessageAccess(message); + var group = new ProgressGroup { Status = Strings.SendingMessage }; + + ProgressManager.Current.Register(group); + + var msg = message.DuckCopy(); + + try + { + msg.BodyText = access.BodyText.ToStream(); + msg.BodyHtml = access.BodyHtml.ToStream(); + + // Handle attachments + foreach (var document in message.Documents) + { + var attachment = new ChannelAttachment + { + Filename = document.Filename, + ContentType = document.ContentType, + ContentStream = new MemoryStream() + }; + + attachment.ContentStream = File.OpenRead( + ClientState.Current.Storage.ResolvePhysicalFilename(".", document.StreamName)); + + msg.Attachments.Add(attachment); + } + + Logger.Debug("Message has {0} attachments", LogSource.BackgroundTask, msg.Attachments.Count); + + var recipients = BuildRecipients(); + + try + { + group.SourceChannelId = message.TargetChannelId; + + var channel = ChannelsManager.GetChannelObject(message.TargetChannelId); + + // The messageid itself is not used by the send channel, so inject our friendlyrowkey into that field. + // The field is added to the headers collection which in turn is used again to determine if its a sent + // item that is allready in your inbox2 sent items folder. + msg.MessageIdentifier = message.MessageKey; + msg.ConversationId = message.ConversationIdentifier; + + // Filter only the recipients that belong to this channel + msg.To = recipients[message.TargetChannelId].To; + msg.CC = recipients[message.TargetChannelId].CC; + msg.BCC = recipients[message.TargetChannelId].BCC; + + Logger.Debug("Sending message. Channel = {0}", LogSource.BackgroundTask, channel.Configuration.DisplayName); + + if (channel.Configuration.IsConnected) + SendCloudMessage(channel.Configuration, msg); + else + channel.OutputChannel.Send(msg); + + Logger.Debug("Send was successfull. Channel = {0}", LogSource.BackgroundTask, channel.Configuration.DisplayName); + } + catch (Exception ex) + { + ClientState.Current.ShowMessage( + new AppMessage(String.Concat(Strings.UnableToSendMessage, ", ", + String.Format(Strings.ServerSaid, ex.Message))) + { + SourceChannelId = message.TargetChannelId + }, MessageType.Error); + + throw; + } + + EventBroker.Publish(AppEvents.SendMessageFinished); + + Thread.CurrentThread.ExecuteOnUIThread(() => + ClientState.Current.ShowMessage( + new AppMessage(Strings.MessageSentSuccessfully) + { + EntityId = message.MessageId.Value, + EntityType = EntityType.Message + }, MessageType.Success)); + } + finally + { + if (msg.BodyText != null) + msg.BodyText.Dispose(); + + if (msg.BodyHtml != null) + msg.BodyHtml.Dispose(); + + group.IsCompleted = true; + + // Close attachment streams + foreach (var channelAttachment in msg.Attachments) + { + channelAttachment.ContentStream.Dispose(); + channelAttachment.ContentStream = null; + } + } + } + + public Dictionary BuildRecipients() + { + var channels = new List(); + var result = new Dictionary(); + + // Append recients per channel + if (message.MessageFolder == Folders.SentItems + || message.MessageFolder == Folders.Drafts) + { + // Use target channels + channels.Add(ChannelsManager.GetChannelObject(message.TargetChannel.ChannelId)); + } + else + { + // Use source channel + channels.Add(ChannelsManager.GetChannelObject(message.SourceChannel.ChannelId)); + } + + foreach (var channel in channels) + { + var recipients = new Recipients(); + + recipients.To.AddRange(FilterByTargetChannel(message.To, channel)); + recipients.CC.AddRange(FilterByTargetChannel(message.CC, channel)); + recipients.BCC.AddRange(FilterByTargetChannel(message.BCC, channel)); + + if (!recipients.IsEmpty) + { + result.Add(channel.Configuration.ChannelId, recipients); + } + } + + return result; + } + + IEnumerable FilterByTargetChannel(IEnumerable source, ChannelInstance channel) + { + foreach (var address in source) + { + if (channel.Configuration.Charasteristics.SupportsEmail) + { + // Mail channels allow everything that is a valid email address + if (SourceAddress.IsValidEmail(address.Address)) + yield return address; + } + else + { + // Social channels only allow entries that are available in the addressbook + SourceAddress address1 = address; + + using (mailbox.Profiles.ReaderLock) + if (mailbox.Profiles.Where(p => p.Address == address1.Address).Count() > 0) + yield return address; + } + } + } + + void SendCloudMessage(ChannelConfiguration channel, ChannelMessage message) + { + var data = String.Format("wrap_access_token={0}&targetchannelkey={1}&from={2}&to={3}&cc={4}&bcc={5}&subject={6}&inreplyto={7}&conversationidentifier={8}&body={9}", + CloudApi.AccessToken, + channel.ChannelKey, + HttpUtility.UrlEncode(message.From.ToString()), + HttpUtility.UrlEncode(message.To.ToString()), + HttpUtility.UrlEncode(message.CC.ToString()), + HttpUtility.UrlEncode(message.BCC.ToString()), + HttpUtility.UrlEncode(message.Context), + HttpUtility.UrlEncode(message.InReplyTo), + HttpUtility.UrlEncode(message.ConversationId), + HttpUtility.UrlEncode(message.BodyHtml.ReadString())); + + string messageKey; + + if (message.Attachments.Count > 0) + { + var files = message.Attachments + .Select(s => new UploadFile(s.ContentStream, s.Filename, "application/octet-stream")) + .ToList(); + + messageKey = HttpServiceRequest.Post(String.Concat(CloudApi.ApiBaseUrl, "send/message"), data, files, true); + } + else + { + messageKey = HttpServiceRequest.Post(String.Concat(CloudApi.ApiBaseUrl, "send/message"), data, true); + } + + // Update messagekey + this.message.MessageKey = messageKey; + + ClientState.Current.DataService.Update(this.message); + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Commands/SendStatusUpdateCommand.cs b/Code/Client/Inbox2/Core/Threading/Commands/SendStatusUpdateCommand.cs new file mode 100644 index 0000000..e3d7067 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Commands/SendStatusUpdateCommand.cs @@ -0,0 +1,91 @@ +using System; +using System.Threading; +using System.Web; +using Inbox2.Core.Configuration; +using Inbox2.Framework; +using Inbox2.Framework.Extensions; +using Inbox2.Framework.Localization; +using Inbox2.Framework.Threading; +using Inbox2.Framework.Threading.Progress; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Channels; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Framework.Web; +using Inbox2.Platform.Interfaces.Enumerations; +using Inbox2.Platform.Logging; + +namespace Inbox2.Core.Threading.Commands +{ + class SendStatusUpdateCommand : ConnectedCommand + { + private readonly UserStatus status; + + public SendStatusUpdateCommand(UserStatus status) + { + this.status = status; + } + + protected override void ExecuteCore() + { + var group = new ProgressGroup { Status = Strings.UpdatingStatus }; + + ProgressManager.Current.Register(group); + + try + { + foreach (var config in status.TargetChannels) + { + var channel = ChannelsManager.GetChannelObject(config.ChannelId); + + try + { + group.SourceChannelId = config.ChannelId; + + ChannelContext.Current.ClientContext = new ChannelClientContext(ClientState.Current.Context, config); + + Logger.Debug("Updating status. Channel = {0}", LogSource.BackgroundTask, config.DisplayName); + + if (config.IsConnected) + { + var data = String.Format("wrap_access_token={0}&channels={1}&inreplyto={2}&body={3}", + CloudApi.AccessToken, config.ChannelKey, status.InReplyTo, HttpUtility.UrlEncode(status.Status)); + + HttpServiceRequest.Post(String.Concat(CloudApi.ApiBaseUrl, "send/statusupdate"), data, true); + + } + else + { + channel.StatusUpdatesChannel.UpdateMyStatus(status.DuckCopy()); + } + } + catch (Exception ex) + { + ClientState.Current.ShowMessage( + new AppMessage( + String.Concat( + String.Format(Strings.ErrorOccuredDuringStatusUpdate, channel.Configuration.DisplayName), + String.Format(Strings.ServerSaid, ex.Message))) + { + SourceChannelId = config.ChannelId + }, MessageType.Error); + + throw; + } + } + + Thread.CurrentThread.ExecuteOnUIThread(() => + ClientState.Current.ShowMessage( + new AppMessage(Strings.StatusUpdatedSuccessfully) + { + EntityId = status.StatusId, + EntityType = EntityType.UserStatus + }, MessageType.Success)); + } + finally + { + group.IsCompleted = true; + } + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Commands/SyncEntityCommand.cs b/Code/Client/Inbox2/Core/Threading/Commands/SyncEntityCommand.cs new file mode 100644 index 0000000..8e97733 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Commands/SyncEntityCommand.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using Inbox2.Core.Configuration; +using Inbox2.Core.Threading.Tasks; +using Inbox2.Framework.Interfaces; +using Inbox2.Framework.Threading; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Framework.CloudApi.Enumerations; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Framework.Web; +using Inbox2.Platform.Logging; + +namespace Inbox2.Core.Threading.Commands +{ + class SyncEntityCommand : ConnectedCommand, IContextTask + { + private readonly string key; + private readonly Entities entities; + private readonly QueuedCommand inner; + + public Dictionary Values { get; private set; } + + public SyncEntityCommand(Entities entities, string key, QueuedCommand inner) + { + Values = new Dictionary { { "wrap_access_token", CloudApi.AccessToken } }; + + this.key = key; + this.entities = entities; + this.inner = inner; + } + + protected override void ExecuteCore() + { + try + { + Values.Add("keys", key); + Values.Add("value", inner.Value); + Values.Add("modifyaction", inner.ModifyAction); + + var data = String.Join("&", Values.Select(kv => String.Format("{0}={1}", kv.Key, kv.Value)).ToArray()); + + HttpServiceRequest.Post(CloudApi.ApiBaseUrl + String.Format("modify/{0}", entities), data, true); + } + catch (WebException ex) + { + var response = (HttpWebResponse)ex.Response; + + using (var stream = response.GetResponseStream()) + Logger.Error("An error has occured while executing cloud command. Error = {0}", LogSource.Command, stream.ReadString()); + + throw; + } + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Threading/ExceptionHelper.cs b/Code/Client/Inbox2/Core/Threading/ExceptionHelper.cs new file mode 100644 index 0000000..ee1f84e --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/ExceptionHelper.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Channels.Interfaces; + +namespace Inbox2.Core.Threading +{ + public static class ExceptionHelper + { + public static string BuildChannelError(IClientInputChannel channel, ConnectResult result, bool isException) + { + var messageBuilder = new StringBuilder(); + + messageBuilder.AppendFormat("Unable to connect "); + + if (isException) + { + messageBuilder.AppendFormat(" due to an application error"); + } + else + { + switch (result) + { + case ConnectResult.AuthFailure: + messageBuilder.AppendFormat(", server said: {0}", channel.AuthMessage); + break; + default: + messageBuilder.AppendFormat(" due to a channel error"); + break; + } + } + + return messageBuilder.ToString(); + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Handlers/ContactsHandler.cs b/Code/Client/Inbox2/Core/Threading/Handlers/ContactsHandler.cs new file mode 100644 index 0000000..2b238e0 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Handlers/ContactsHandler.cs @@ -0,0 +1,28 @@ +using System; +using Inbox2.Core.Threading.Handlers.Matchers; +using Inbox2.Framework; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Channels.Entities; + +namespace Inbox2.Core.Threading.Handlers +{ + public static class ContactsHandler + { + public static void Init() + { + EventBroker.Subscribe(AppEvents.ContactReceived, ContactReceived); + EventBroker.Subscribe(AppEvents.MessageStored, MessageStored); + } + + public static void ContactReceived(ChannelContact contact) + { + new ContactMatcher(contact).Execute(); + } + + public static void MessageStored(Message message) + { + new ProfileMatcher(message).Execute(); + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Handlers/DocumentsHandler.cs b/Code/Client/Inbox2/Core/Threading/Handlers/DocumentsHandler.cs new file mode 100644 index 0000000..eb33733 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Handlers/DocumentsHandler.cs @@ -0,0 +1,101 @@ +using System; +using System.IO; +using System.Linq; +using System.Threading; +using Inbox2.Framework; +using Inbox2.Framework.Extensions; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.VirtualMailBox; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Framework.Extensions; + +namespace Inbox2.Core.Threading.Handlers +{ + public static class DocumentsHandler + { + public static void Init() + { + EventBroker.Subscribe(AppEvents.DocumentReceived, DocumentReceived); + } + + public static void DocumentReceived(Document source) + { + try + { + var mailbox = VirtualMailBox.Current; + var document = source; + + document.Crc32 = document.ContentStream.CalculateCrc32(); + document.Size = document.ContentStream.Length; + + var message = document.Message; + + bool isNewVersion; + + using (mailbox.Documents.ReaderLock) + { + Document document1 = document; + + isNewVersion = mailbox.Documents.Any(d => d.Crc32 == document1.Crc32); + } + + if (isNewVersion == false) + { + document.StreamName = Guid.NewGuid().GetHash(12) + "_" + Path.GetExtension(document.Filename); + + // Save document to storage engine + ClientState.Current.Storage.Write( + ".", + document.StreamName, + document.ContentStream); + + // New document, save stream and add to search/mailbox + ClientState.Current.DataService.Save(document); + + ClientState.Current.Search.Store(document); + + mailbox.Documents.Add(document); + } + else + { + // Replace document reference with instance from mailbox + Document document1 = document; + + document = mailbox.Documents.First(d => d.Crc32 == document1.Crc32); + } + + // Create new version + var version = new DocumentVersion + { + DocumentId = document.DocumentId.Value, + SourceChannelId = document.SourceChannelId, + TargetChannelId = document.TargetChannelId, + StreamName = document.StreamName, + Filename = document.Filename, + DateReceived = document.DateReceived, + DateSent = document.DateSent + }; + + mailbox.DocumentVersions.Add(version); + + document.Versions.Add(version); + + ClientState.Current.DataService.Save(version); + + if (message != null) + { + version.From = message.From; + version.To = message.To; + version.MessageId = message.MessageId; + + Thread.CurrentThread.ExecuteOnUIThread(() => message.Add(document)); + } + } + finally + { + source.ContentStream.Dispose(); + source.ContentStream = null; + } + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Handlers/Matchers/ContactMatcher.cs b/Code/Client/Inbox2/Core/Threading/Handlers/Matchers/ContactMatcher.cs new file mode 100644 index 0000000..5b4f6cf --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Handlers/Matchers/ContactMatcher.cs @@ -0,0 +1,234 @@ +using System; +using System.Linq; +using System.Threading; +using Inbox2.Framework; +using Inbox2.Framework.Extensions; +using Inbox2.Framework.VirtualMailBox; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Web; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Logging; + +namespace Inbox2.Core.Threading.Handlers.Matchers +{ + public enum ContactMatchResult + { + NoMatch, + MatchedOnPerson, + MatchedOnProfile, + MatchedOnChannelProfileKey, + Error, + } + + public class ContactMatcher + { + private readonly ChannelContact contact; + + private Person person; + private Profile profile; + private VirtualMailBox mailbox; + + private ContactMatchResult result = ContactMatchResult.NoMatch; + + public ContactMatchResult Result + { + get { return result; } + } + + public ContactMatcher(ChannelContact contact) + { + this.contact = contact; + this.mailbox = VirtualMailBox.Current; + } + + public void Execute() + { + // Validate the minimum required fields + if (String.IsNullOrEmpty(contact.Person.Name.Trim())) + { + Logger.Warn("Contact for channelprofilekey [{0}] has an empty name and an invalid sourceaddress, ignoring entry", LogSource.Sync, contact.Profile.ChannelProfileKey); + + result = ContactMatchResult.Error; + + return; + } + + if (String.IsNullOrEmpty(contact.Profile.ChannelProfileKey)) + { + Logger.Debug("Profile for person [{0}] did not have a valid ChannelProfileKey, ignoring entry", LogSource.Sync, contact.Person.Name); + + result = ContactMatchResult.Error; + + return; + } + + if (contact.Profile.SourceAddress == null) + { + Logger.Warn("Contact for channelprofilekey [{0}] has an invalid sourceaddress, ignoring entry", LogSource.Sync, contact.Profile.ChannelProfileKey); + + result = ContactMatchResult.Error; + + return; + } + + // Some contacts (especially from gmail) don't have names but only email adrreses, + // use the email address as name in that case + if (String.IsNullOrEmpty(contact.Person.Name.Trim())) + { + contact.Person.Name = contact.Profile.SourceAddress.ToString(); + contact.IsSoft = true; + } + + // Try to match the person to our addressbook based on unique channelprofilekey + using (mailbox.Profiles.ReaderLock) + profile = mailbox.Profiles.FirstOrDefault(p => p.ChannelProfileKey == contact.Profile.ChannelProfileKey); + + if (profile != null) + { + // Find person belonging to profile + EnsurePerson(); + + result = ContactMatchResult.MatchedOnProfile; + + return; + } + + // Profile not found on channel profile key, perform a match on person name + FindPersonByName(); + + // Person has been redirected + if (person != null && person.RedirectPersonId.HasValue) + person = mailbox.Persons.FirstOrDefault(p => p.PersonId == person.RedirectPersonId); + + if (person != null) + { + var matchOnAddress = mailbox.Profiles.FirstOrDefault(p => p.Address == contact.Profile.SourceAddress.Address); + + if (matchOnAddress != null) + { + Logger.Debug("Found soft profile [{0}] for person [{1}] on address match [{2}], removing from mailbox and recreating new one...", LogSource.Sync, + matchOnAddress.ProfileId, contact.Person.Name, contact.Profile.SourceAddress.Address); + + // We have a soft profile on the same address that we are now receiving a hard profile for, + // remove the soft profile so that the matcher will create a new hard profile. + ClientState.Current.DataService.Delete(matchOnAddress); + } + + // Doesn't have this profile yet, add it + Logger.Debug("Found new profile [{0}] for person [{1}]", LogSource.Sync, contact.Profile.ChannelProfileKey, contact.Person.Name); + + // Append new profile + SaveProfile(contact); + + result = ContactMatchResult.MatchedOnPerson; + } + else + { + profile = mailbox.Profiles.FirstOrDefault(p => p.Address.Equals(contact.Profile.SourceAddress.Address, StringComparison.InvariantCultureIgnoreCase)); + + // Try to match to profile address + if (profile != null) + { + EnsurePerson(); + + result = ContactMatchResult.MatchedOnProfile; + + return; + } + + // Unable to match, create new person + SavePerson(contact); + + // Create new profile + SaveProfile(contact); + } + } + + void FindPersonByName() + { + person = mailbox.Persons.FirstOrDefault(p => p.Name.Equals(contact.Person.Name, StringComparison.InvariantCultureIgnoreCase) + || p.Name.Replace(" ", "").IndexOf(contact.Person.Name, StringComparison.InvariantCultureIgnoreCase) > -1); + } + + void EnsurePerson() + { + using (mailbox.Persons.ReaderLock) + person = mailbox.Persons.FirstOrDefault(p => p.PersonId == profile.PersonId); + + if (person == null) + { + FindPersonByName(); + + // Person not found on id or name, create a new person entry + if (person == null) + SavePerson(contact); + } + } + + void SavePerson(ChannelContact channelContact) + { + person = channelContact.Person.DuckCopy(); + person.PersonId = person.PersonId; + person.Firstname = person.Firstname.Capitalize(); + person.Lastname = person.Lastname.Capitalize(); + + mailbox.Persons.Add(person); + + ClientState.Current.DataService.Save(person); + + Logger.Debug("Profile saved successfully in ContactMatcher. Person = {0}", LogSource.Sync, person.PersonId); + } + + void SaveProfile(ChannelContact channelContact) + { + profile = channelContact.Profile.DuckCopy(); + profile.PersonId = person.PersonId.Value; + profile.IsSoft = channelContact.IsSoft; + + // SourceAddress can be null with for instance phone contacts + if (profile.SourceAddress != null) + { + if (String.IsNullOrEmpty(profile.ScreenName)) + profile.ScreenName = profile.SourceAddress.DisplayName; + + if (String.IsNullOrEmpty(profile.Address)) + profile.Address = profile.SourceAddress.Address; + } + + try + { + if (channelContact.Profile.ChannelAvatar != null && + (channelContact.Profile.ChannelAvatar.ContentStream != null || !String.IsNullOrEmpty(channelContact.Profile.ChannelAvatar.Url))) + { + var streamname = Guid.NewGuid().GetHash(12) + "png"; + + if (channelContact.Profile.ChannelAvatar.ContentStream == null) + { + var helper = new WebContentStreamHelper(channelContact.Profile.ChannelAvatar.Url); + + channelContact.Profile.ChannelAvatar.ContentStream = helper.GetContentStream(); + } + + using (channelContact.Profile.ChannelAvatar.ContentStream) + ClientState.Current.Storage.Write("a", streamname, channelContact.Profile.ChannelAvatar.ContentStream); + + profile.AvatarStreamName = streamname; + } + } + catch (Exception ex) + { + Logger.Error("An error occured while trying to save avatar. ChannelProfileKey = {0} Exception = {1}", LogSource.Sync, channelContact.Profile.ChannelProfileKey, ex); + } + + mailbox.Profiles.Add(profile); + + Thread.CurrentThread.ExecuteOnUIThread(() => person.Add(profile)); + + ClientState.Current.DataService.Save(profile); + ClientState.Current.Search.Store(profile); + + Logger.Debug("Profile saved successfully in ContactMatcher. Person = {0}, Profile.SourceAddress = {1}", LogSource.Sync, person.PersonId, profile.SourceAddress); + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Handlers/Matchers/MessageMatcher.cs b/Code/Client/Inbox2/Core/Threading/Handlers/Matchers/MessageMatcher.cs new file mode 100644 index 0000000..737475c --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Handlers/Matchers/MessageMatcher.cs @@ -0,0 +1,350 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading; +using Inbox2.Framework; +using Inbox2.Framework.Extensions; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.Threading; +using Inbox2.Framework.VirtualMailBox; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Extensions; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Interfaces.Enumerations; +using Inbox2.Platform.Logging; + +namespace Inbox2.Core.Threading.Handlers.Matchers +{ + public class MessageMatcher + { + /// + /// Matches the specified message. + /// + /// The message. + /// + public static Conversation Match(Message message) + { + return new MessageMatcher().MatchToConversation(message); + } + + /// + /// Private constructor, only allow access through static accessors. + /// + internal MessageMatcher() + { + mailbox = VirtualMailBox.Current; + } + + private readonly VirtualMailBox mailbox; + + /// + /// Matches the message to a conversation. + /// + /// The message. + /// + internal Conversation MatchToConversation(Message message) + { + Logger.Debug("Trying to match conversation for message {0}", LogSource.MessageMatcher, message); + + Conversation conversation; + + if (MatchOnConversationId(message, out conversation) == ExecutionResult.Break) + { + UpdateConversation(conversation); + + return conversation; + } + + if (MatchOnInReplyTo(message, out conversation, 1) == ExecutionResult.Break) + { + UpdateConversation(conversation); + + return conversation; + } + + if (MatchOnSubject(message, out conversation) == ExecutionResult.Break) + { + UpdateConversation(conversation); + + return conversation; + } + + throw new ApplicationException("Unable to match message to conversation!"); + } + + /// + /// Matches the conversation on the conversation id field. + /// + /// The message. + /// The conversation. + /// + ExecutionResult MatchOnConversationId(Message message, out Conversation conversation) + { + conversation = null; + + if (String.IsNullOrEmpty(message.ConversationIdentifier)) + return ExecutionResult.Continue; + + Logger.Debug("MatchOnConversationId: Message {0} had ConversationIdentifier {1}", LogSource.MessageMatcher, message, message.ConversationIdentifier); + + // Retreive conversation from database + using (mailbox.Conversations.ReaderLock) + conversation = mailbox.Conversations.FirstOrDefault(c => c.ConversationIdentifier == message.ConversationIdentifier); + + if (conversation == null) + { + Logger.Debug("MatchOnConversationId: Conversation did not exist, creating a new one with ConversationIdentifier {0}", LogSource.MessageMatcher, message.ConversationIdentifier); + + // Not found, create new one + conversation = CreateNewConversation(message); + } + else + { + UpdateMessage(message, conversation); + } + + return ExecutionResult.Break; + } + + /// + /// Matches the conversation on the in reply to field. + /// + /// The message. + /// The conversation. + /// + ExecutionResult MatchOnInReplyTo(Message message, out Conversation conversation, int nrtry) + { + conversation = null; + + if (String.IsNullOrEmpty(message.InReplyTo)) + return ExecutionResult.Continue; + + Logger.Debug("MatchOnInReplyTo: Message {0} had In-Reply-To {1}", LogSource.MessageMatcher, message, message.InReplyTo); + + Message msg; + + using (mailbox.Messages.ReaderLock) + msg = mailbox.Messages.FirstOrDefault(m => m.MessageIdentifier == message.InReplyTo); + + if (msg != null) + { + // Update source message stats + msg.TrackAction(ActionType.ReplyForward, message.SortDate); + + // Found a conversationId + using (mailbox.Conversations.ReaderLock) + conversation = mailbox.Conversations.FirstOrDefault(c => c.ConversationIdentifier == msg.ConversationIdentifier); + + if (conversation == null) + { + if (nrtry == 3) + { + // We are unable to find the conversation after two tries, + // match the message being replied to, to fix this. + Match(msg); + + return MatchOnInReplyTo(message, out conversation, ++nrtry); + } + + // Seems we have a conversationId but the actual conversation has not been written to disk yet + // Sleep for 500 ms and then try again + Thread.Sleep(500); + + return MatchOnInReplyTo(message, out conversation, ++nrtry); + } + + Logger.Debug("MatchOnInReplyTo: Found conversation with ConversationIdentifier [{0}] for Message {1}", LogSource.MessageMatcher, conversation, message); + + UpdateMessage(message, conversation); + + return ExecutionResult.Break; + } + + // Continue as our other rules might generate a hit + return ExecutionResult.Continue; + } + + /// + /// Matches the conversation on the the subject field. + /// + /// The message. + /// The conversation. + /// + ExecutionResult MatchOnSubject(Message message, out Conversation conversation) + { + if (message.MessageFolder == Folders.SentItems) + { + Logger.Debug("MatchOnSubject: Message {0} is a sent item. Creating new conversation because it is not a reply but a new message", LogSource.MessageMatcher, message); + + conversation = CreateNewConversation(message); + + return ExecutionResult.Break; + } + + if (message.MessageFolder == Folders.Drafts) + { + Logger.Debug("MatchOnSubject: Message {0} is a concept message. Creating new conversation", LogSource.MessageMatcher, message); + + conversation = CreateNewConversation(message); + + return ExecutionResult.Break; + } + + if (String.IsNullOrEmpty(message.Context) || String.IsNullOrEmpty(message.Context.ToClearSubject()) || message.Context.Trim().Length == 0) + { + Logger.Debug("MatchOnSubject: Message {0} has an empty context. Creating new conversation", LogSource.MessageMatcher, message); + + conversation = CreateNewConversation(message); + + return ExecutionResult.Break; + } + + Logger.Debug("MatchOnSubject: trying to find conversation for Message {0} with Context {1}", LogSource.MessageMatcher, message, message.Context.ToClearSubject()); + + string context = message.Context.ToClearSubject(); + + // Determine if the recipients in the message match with the current recipients + List messagesWithSameContext; + + using (mailbox.Messages.ReaderLock) + messagesWithSameContext = mailbox.Messages.Where( + m => m.MessageId != message.MessageId && (m.Context == context || m.Context.ToClearSubject() == context)) + .ToList(); + + string conversationId = null; + + var recentRelatedMessage = messagesWithSameContext.Where(m => DateTime.Compare((m.SortDate).AddDays(3), DateTime.Now) >= 0).FirstOrDefault(); + + if (recentRelatedMessage != null) + { + conversationId = recentRelatedMessage.ConversationIdentifier; + } + else + { + if (message.MessageFolder == Folders.Inbox) + { + if (messagesWithSameContext.Count > 0) + { + // This is an incoming message + SourceAddress from = message.From; + bool isEmailChannel = SourceAddress.IsValidEmail(from.Address); + + //Get all channels for user + var addresses = ChannelsManager + .Channels + .Where(c => c.InputChannel != null) + .Select(c => c.InputChannel.SourceAdress) + .ToList(); + + foreach (var contextMessage in messagesWithSameContext) + { + var addressCollection = new SourceAddressCollection(); + addressCollection.AddRange(contextMessage.To); + addressCollection.AddRange(contextMessage.CC); + addressCollection.AddRange(contextMessage.BCC); + addressCollection.Add(contextMessage.From); + + if (addressCollection.Contains(from, new SourceAddressComparer())) + { + bool hasMatchedConversation = false; + + if (message.To.Count( + c => addresses.Contains(c.Address) || addressCollection.Contains(c)) > 0) + hasMatchedConversation = true; + + if (!hasMatchedConversation && !isEmailChannel) + { + if (message.To.Count(addressCollection.Contains) > 0) + hasMatchedConversation = true; + } + + if (hasMatchedConversation) + { + conversationId = contextMessage.ConversationIdentifier; + break; + } + } + } + } + } + } + + if (String.IsNullOrEmpty(conversationId)) + { + Logger.Debug("MatchOnSubject: Message {0} has no matching conversation, creating a new one", LogSource.MessageMatcher, message); + + // Nothing found, create new conversation + conversation = CreateNewConversation(message); + } + else + { + using (mailbox.Conversations.ReaderLock) + conversation = mailbox.Conversations.FirstOrDefault(c => c.ConversationIdentifier == conversationId); + + Logger.Debug("MatchOnSubject: Message {0} has matching conversation with ConversationId {1}", LogSource.MessageMatcher, message, conversation.ConversationId); + + UpdateMessage(message, conversation); + + Logger.Debug("MatchOnSubject: Message {0} now has ConversationId {1}", LogSource.MessageMatcher, message, message.ConversationIdentifier); + } + + // End of line + return ExecutionResult.Break; + } + + /// + /// Updates the conversation. + /// + /// The conversation. + void UpdateConversation(Conversation conversation) + { + conversation.UpdateProperty("Last"); + conversation.UpdateProperty("ProcessingHints"); + conversation.UpdateProperty("TotalMessageCount"); + } + + /// + /// Creates a new conversation. + /// + /// The message. + /// + Conversation CreateNewConversation(Message message) + { + Conversation conversation = DispatcherActivator.Create(); + + string conversationId = message.ConversationIdentifier; + + if (String.IsNullOrEmpty(message.ConversationIdentifier)) + { + // Create new conversation id + conversationId = Guid.NewGuid().ToConversationId(); + } + + conversation.ConversationIdentifier = conversationId; + conversation.Context = message.Context.ToClearSubject(); + + ClientState.Current.DataService.Save(conversation); + + Logger.Debug("Conversation {0} was created successfully", LogSource.MessageMatcher, conversation); + Logger.Debug("Message {0} now has ConversationIdentifier {1}", LogSource.MessageMatcher, message, conversationId); + + UpdateMessage(message, conversation); + + Debug.Assert(!String.IsNullOrEmpty(message.ConversationIdentifier), "Message can not have an empty ConversationIdentifier!"); + + mailbox.Conversations.Add(conversation); + + return conversation; + } + + void UpdateMessage(Message message, Conversation conversation) + { + message.ConversationIdentifier = conversation.ConversationIdentifier; + ClientState.Current.DataService.Update(message); + + Thread.CurrentThread.ExecuteOnUIThread(() => conversation.Add(message)); + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Handlers/Matchers/ProfileMatcher.cs b/Code/Client/Inbox2/Core/Threading/Handlers/Matchers/ProfileMatcher.cs new file mode 100644 index 0000000..65637f0 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Handlers/Matchers/ProfileMatcher.cs @@ -0,0 +1,192 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using Inbox2.Framework; +using Inbox2.Framework.Extensions; +using Inbox2.Framework.Threading; +using Inbox2.Framework.VirtualMailBox; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Text; +using Inbox2.Platform.Logging; + +namespace Inbox2.Core.Threading.Handlers.Matchers +{ + public class ProfileMatcher + { + private readonly Message message; + private readonly VirtualMailBox mailbox; + + public ProfileMatcher(Message message) + { + this.message = message; + this.mailbox = VirtualMailBox.Current; + } + + public void Execute() + { + var sourceaddresses = + new SourceAddressCollection() + .AddRange(message.To) + .AddRange(message.CC) + .AddRange(message.BCC); + + // Try to match every source address to a profile + foreach (var address in sourceaddresses) + ProcessSourceAddress(address); + + ProcessSourceAddress(message.From); + } + + long ProcessSourceAddress(SourceAddress address) + { + List profiles; + + using (mailbox.Profiles.ReaderLock) + profiles = mailbox.Profiles.Where(p => p.Address == address.Address).ToList(); + + if (profiles.Count == 0) + { + Logger.Debug("Profile for address {0} not found", LogSource.Sync, address); + + if (String.IsNullOrEmpty(address.DisplayName)) + { + Logger.Warn("Address {0} had no displayname, ignoring", LogSource.Sync, address); + + return -1; + } + else + { + // No profile found, try to match on person + string name = PersonName.Parse(address.DisplayName).ToString(); + List persons; + + // The non spaced matche helps with contacts that are for instance called waseemsadiq on twitter and Waseem Sadiq elsewhere + using (mailbox.Persons.ReaderLock) + persons = mailbox.Persons.Where(c => c.Name == name || c.Name == name.Replace(" ", String.Empty).Trim()).ToList(); + + if (persons.Count > 0) + { + Logger.Debug("Profile for address {0} had contact, creating new profile", LogSource.Sync, address); + + // Add profile to existing person + var person = persons.First(); + + // Person has been redirected + if (person.RedirectPersonId.HasValue) + { + using (mailbox.Persons.ReaderLock) + { + // Find redirected person + Person person1 = person; + + person = mailbox.Persons.FirstOrDefault(p => p.PersonId == person1.RedirectPersonId); + } + } + + if (person != null) + { + // If personid does not have a value yet, spin until the object is written to the database + while (!person.PersonId.HasValue) + Thread.SpinWait(1000); + + SaveProfile(person, address); + + return person.PersonId.Value; + } + } + + Logger.Debug("Person for address {0} not found, creating new person and profile", LogSource.Sync, address); + + // Create new soft contact and soft profile + return SavePerson(address); + } + } + else + { + var profile = profiles.First(); + + Thread.CurrentThread.ExecuteOnUIThread(delegate + { + // Set profile + message.Profile = profile; + + profile.Messages.Add(message); + + if (profile.Person != null) + { + profile.Person.Messages.Add(message); + + profile.Person.RebuildScore(); + } + }); + + return profile.PersonId; + } + } + + long SavePerson(SourceAddress address) + { + // Create new person + Person person = DispatcherActivator.Create(); + + person.Name = address.DisplayName; + // See comment in SaveProfile method + person.SourceChannelId = + SourceAddress.IsValidEmail(address.Address) ? 0 : message.SourceChannelId; ; + person.DateCreated = DateTime.Now; + + mailbox.Persons.Add(person); + + Thread.CurrentThread.ExecuteOnUIThread(() => person.Messages.Add(message)); + + person.RebuildScore(); + + ClientState.Current.DataService.Save(person); + + Logger.Debug("Person saved successfully in ProfileMatcher. Person = {0}", LogSource.Sync, person.PersonId); + + SaveProfile(person, address); + + return person.PersonId.Value; + } + + void SaveProfile(Person person, SourceAddress address) + { + // Create new profile + Profile profile = DispatcherActivator.Create(); + + profile.PersonId = person.PersonId.Value; + + // SourceChannelId is 0 if its a valid email (because soft email addresses are not + // nescessarily tied to any channel), otherwise its the SourceChannelId of the message + // (usually Facebook/Twitter/etc) + profile.SourceChannelId = + SourceAddress.IsValidEmail(address.Address) ? 0 : message.SourceChannelId; + + profile.ScreenName = address.DisplayName; + profile.Address = address.Address; + profile.SourceAddress = address; + profile.ProfileType = ProfileType.Default; + profile.IsSoft = true; + profile.DateCreated = DateTime.Now; + + mailbox.Profiles.Add(profile); + + Thread.CurrentThread.ExecuteOnUIThread(delegate + { + person.Profiles.Add(profile); + + // Set profile + message.Profile = profile; + + profile.Messages.Add(message); + }); + + ClientState.Current.DataService.Save(profile); + + Logger.Debug("Profile saved successfully in ProfileMatcher. Person = {0}, Profile.SourceAddress = {1}", LogSource.Sync, person.PersonId, profile.SourceAddress); + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Handlers/MessagesHandler.cs b/Code/Client/Inbox2/Core/Threading/Handlers/MessagesHandler.cs new file mode 100644 index 0000000..85d7196 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Handlers/MessagesHandler.cs @@ -0,0 +1,33 @@ +using System; +using Inbox2.Core.Threading.Handlers.Matchers; +using Inbox2.Framework; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.VirtualMailBox; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Framework.VirtualMailBox.View; + +namespace Inbox2.Core.Threading.Handlers +{ + public static class MessagesHandler + { + public static void Init() + { + EventBroker.Subscribe(AppEvents.MessageStored, MessageStored); + } + + public static void MessageStored(Message message) + { + var mailbox = VirtualMailBox.Current; + + // Match thread + MessageMatcher.Match(message); + + mailbox.Messages.Add(message); + + ViewFilter.Current.UpdateCurrentViewAsync(); + + // Add to search index + ClientState.Current.Search.Store(message); + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Threading/Handlers/UserStatusHandler.cs b/Code/Client/Inbox2/Core/Threading/Handlers/UserStatusHandler.cs new file mode 100644 index 0000000..03b0137 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Handlers/UserStatusHandler.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using Inbox2.Framework; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.VirtualMailBox.Entities; + +namespace Inbox2.Core.Threading.Handlers +{ + public class UserStatusHandler + { + public static void Init() + { + EventBroker.Subscribe(AppEvents.StatusUpdateReceived, StatusUpdateReceived); + } + + public static void StatusUpdateReceived(UserStatus status) + { + // Add to search index + ClientState.Current.Search.Store(status); + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Inbox2.Core.Threading.csproj b/Code/Client/Inbox2/Core/Threading/Inbox2.Core.Threading.csproj new file mode 100644 index 0000000..983c003 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Inbox2.Core.Threading.csproj @@ -0,0 +1,289 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {61EF019B-7EFF-4383-ABFF-17C053A7DB50} + Library + Properties + Inbox2.Core.Threading + Inbox2.Core.Threading + v3.5 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Channels.dll + + + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Framework.dll + + + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Interfaces.dll + + + ..\..\..\..\Stable Assemblies\Inbox2.Platform.Logging.dll + + + ..\..\..\..\..\ThirdParty\Json.Net\Newtonsoft.Json.dll + + + 3.0 + + + False + ..\..\..\..\Stable Assemblies\protobuf-net.dll + + + + False + ..\..\..\..\..\ThirdParty\MEF\System.ComponentModel.Composition.dll + + + 3.5 + + + 3.0 + + + 3.0 + + + 3.5 + + + + 3.5 + + + 3.5 + + + + + 3.0 + + + + + AssemblyInfo.cs + + + + + + + + + + + + + + + Code + + + Code + + + Code + + + Code + + + + + Code + + + Code + + + + Code + + + + + + + + + + + + + + + + + + + Code + + + Code + + + + + {CFEC0A6E-AFAE-4FC1-8F07-B1B0F97B4162} + Inbox2.Framework.Extensions + + + {B6402BD1-3B14-4ED8-A0A2-11665AEC6D3F} + Inbox2.Framework + + + {8E52D082-3EF7-4A0A-961C-E63C8D4B1947} + Inbox2.Framework.Interfaces + + + {4E91D564-1B6E-4FF0-A177-3ED4632EA5D2} + Inbox2.Framework.Localization + + + {C20E7E84-728A-4891-B99B-D6DD4029FFF4} + Inbox2.Framework.Persistance + + + {EF22C92A-3F62-4420-BF6B-B6F6D8CFCF40} + Inbox2.Framework.Plugins + + + {428793DE-2946-4FB0-B8B8-E372084A58E7} + Inbox2.Framework.Threading + + + {0A5281EA-0E45-448A-9828-A7E96DA1B530} + Inbox2.Framework.Utils + + + {9B222C61-ECAD-46C0-A3DD-66E0590F9B50} + Inbox2.Framework.VirtualMailBox + + + {2E870F3B-1BBB-44B0-B534-4A1D1CCB17C8} + Inbox2.Core.Configuration + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Threading/ProcessingPool.cs b/Code/Client/Inbox2/Core/Threading/ProcessingPool.cs new file mode 100644 index 0000000..1d12b42 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/ProcessingPool.cs @@ -0,0 +1,185 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using Inbox2.Core.Configuration; +using Inbox2.Framework; +using Inbox2.Framework.Extensions; +using Inbox2.Framework.Interfaces; +using Inbox2.Framework.Threading; +using Inbox2.Platform.Interfaces.Enumerations; + +namespace Inbox2.Core.Threading +{ + public class ProcessingPool + { + private readonly TaskQueue _queue; + protected AutoResetEvent signal; + protected Thread schedulingThread; + protected List processors; + protected bool shutdown; + protected object syncroot = new object(); + + public int Free + { + get + { + lock(syncroot) + return processors.Count(p => p.IsFree); + } + } + + public List Processors + { + get { return processors; } + } + + /// + /// Initializes a new instance of the class. + /// + public ProcessingPool(TaskQueue queue) + { + _queue = queue; + processors = new List(DebugKeys.DefaultNrOfProcessors * 2); + + for (int i = 0; i < DebugKeys.DefaultNrOfProcessors; i++) + processors.Add(new TaskProcessor(OnProcessingStarted, OnProcessingFinished, i)); + + signal = new AutoResetEvent(false); + + schedulingThread = new Thread(Scheduler); + schedulingThread.Name = "Background Scheduling Thread"; + schedulingThread.IsBackground = true; + schedulingThread.Priority = ThreadPriority.BelowNormal; + schedulingThread.Start(); + } + + /// + /// Processes this instance. + /// + public void Process() + { + signal.Set(); + } + + public bool HasRunning() + { + lock (syncroot) + { + return Processors.Any(p => p.QueuedBackgroundTask != null && + p.QueuedBackgroundTask.GetType() == typeof(T)); + } + } + + /// + /// Kills all processors that are running tasks of the given type + /// + /// + public void Kill() + { + lock(syncroot) + { + foreach (var processor in + Processors.Where(p => p.QueuedBackgroundTask != null && + p.QueuedBackgroundTask.GetType() == typeof(T)) + .ToList()) + { + try + { + processor.Shutdown(); + } + catch (Exception) + { + } + finally + { + // Add a new processor to replace the one we just killed + processors.Add(new TaskProcessor(OnProcessingStarted, OnProcessingFinished, processors.Count)); + } + } + } + } + + /// + /// Shutdowns this instance. + /// + public void Shutdown() + { + shutdown = true; + signal.Set(); + + lock (syncroot) + foreach (var processor in processors) + processor.Shutdown(); + } + + /// + /// Scheduler thread, waits for signal that something has been queued for processing. + /// + private void Scheduler() + { + do + { + // Wait for the signal to be set + signal.WaitOne(); + + if (shutdown) + return; + + TaskProcessor processor = GetAvailableProcessor(); + + while (processor != null) + { + // If no more items left for processing, break out of inner loop + if (ClientState.Current.TaskQueue.Count == 0) + break; + + // Process segment into free slot + processor.Process((BackgroundTask) ClientState.Current.TaskQueue.Dequeue()); + + // Get the next available slot + processor = GetAvailableProcessor(); + } + } + while (true); + } + + /// + /// Gets the available processor. + /// + /// + protected TaskProcessor GetAvailableProcessor() + { + lock (syncroot) + { + // If we have a free processor, return it + if (processors.Count(p => p.IsFree) > 0) + { + return processors.First(p => p.IsFree); + } + + // Else return null + return null; + } + } + + /// + /// Called when [processing started]. + /// + protected void OnProcessingStarted(IBackgroundTask task) + { + + } + + /// + /// Called when [processing finished]. + /// + protected void OnProcessingFinished(IBackgroundTask task) + { + // Remove item from queue to cleanup any held references + if (task.ExecutionStatus == ExecutionStatus.Error || task.ExecutionStatus == ExecutionStatus.Success) + _queue.Remove(task); + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Repeat/Repeat.cs b/Code/Client/Inbox2/Core/Threading/Repeat/Repeat.cs new file mode 100644 index 0000000..15f147a --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Repeat/Repeat.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; + +namespace Inbox2.Core.Threading.Repeat +{ + public class Repeat : ScheduledItem + { + private int repeatDelay; + private TimeSpan repeatEvery; + + public Repeat(string key) : base(key) + { + } + + protected Repeat(string key, TimeSpan repeatEvery, Action action) + : base(key) + { + DateScheduled = DateTime.Now.Add(repeatEvery); + + this.repeatEvery = repeatEvery; + this.action = action; + } + + public Repeat Every(int repeatDelay) + { + this.repeatDelay = repeatDelay; + + return this; + } + + public Repeat Seconds() + { + repeatEvery = TimeSpan.FromSeconds(repeatDelay); + + DateScheduled = DateTime.Now.Add(repeatEvery); + + return this; + } + + public Repeat Minutes() + { + repeatEvery = TimeSpan.FromMinutes(repeatDelay); + + DateScheduled = DateTime.Now.Add(repeatEvery); + + return this; + } + + public override void OnAfterExecute() + { + // Re-register new instance of this repeat + ScheduledTaskRunner.Enqueue(new Repeat(Key, repeatEvery, action)); + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Threading/Repeat/Run.cs b/Code/Client/Inbox2/Core/Threading/Repeat/Run.cs new file mode 100644 index 0000000..39c0a27 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Repeat/Run.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Core.Threading.Repeat +{ + public class Run : ScheduledItem + { + public int repeatDelay; + + public Run(string key) : base(key) + { + } + + public Run After(int repeatDelay) + { + this.repeatDelay = repeatDelay; + + return this; + } + + public Run Seconds() + { + DateScheduled = DateTime.Now.AddSeconds(repeatDelay); + + return this; + } + + public Run Minutes() + { + DateScheduled = DateTime.Now.AddMinutes(repeatDelay); + + return this; + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Repeat/ScheduledItem.cs b/Code/Client/Inbox2/Core/Threading/Repeat/ScheduledItem.cs new file mode 100644 index 0000000..327fd5a --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Repeat/ScheduledItem.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Inbox2.Core.Threading.Repeat +{ + public abstract class ScheduledItem + { + protected Action action; + + public DateTime DateScheduled { get; protected set; } + + public string Key { get; private set; } + + protected ScheduledItem(string key) + { + Key = key; + } + + public void Call(Action theAction) + { + action = theAction; + + ScheduledTaskRunner.Enqueue(this); + } + + public virtual void OnBeforeExecute() + { + } + + public void Execute() + { + OnBeforeExecute(); + + try + { + action(); + } + catch + { + // Swallow exceptions + } + + ScheduledTaskRunner.Dequeue(this); + + OnAfterExecute(); + } + + public virtual void OnAfterExecute() + { + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Repeat/ScheduledTaskRunner.cs b/Code/Client/Inbox2/Core/Threading/Repeat/ScheduledTaskRunner.cs new file mode 100644 index 0000000..9dfcaf2 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Repeat/ScheduledTaskRunner.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Timer=System.Timers.Timer; + +namespace Inbox2.Core.Threading.Repeat +{ + public static class ScheduledTaskRunner + { + private static Timer _Timer; + private static List _Runs = new List(); + private static object SyncLock = new object(); + + static ScheduledTaskRunner() + { + _Timer = new Timer(500); + _Timer.Elapsed += Timer_Elapsed; + _Timer.Start(); + } + + static void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) + { + var runs = new List(); + + lock (SyncLock) + { + runs.AddRange(_Runs.Where(r => DateTime.Now > r.DateScheduled)); + + runs.ForEach(r => _Runs.Remove(r)); + } + + runs.ForEach(r => r.Execute()); + } + + public static void Enqueue(ScheduledItem scheduledItem) + { + lock (SyncLock) + { + _Runs.RemoveAll(r => r.Key == scheduledItem.Key); + + _Runs.Add(scheduledItem); + } + } + + public static void Dequeue(ScheduledItem scheduledItem) + { + lock (SyncLock) + { + _Runs.Remove(scheduledItem); + } + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Threading/TaskProcessor.cs b/Code/Client/Inbox2/Core/Threading/TaskProcessor.cs new file mode 100644 index 0000000..4839dcc --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/TaskProcessor.cs @@ -0,0 +1,220 @@ +using System; +using System.ComponentModel; +using System.Diagnostics; +using System.Globalization; +using System.Threading; +using Inbox2.Framework.Extensions; +using Inbox2.Framework.Interfaces; +using Inbox2.Framework.Threading; +using Inbox2.Platform.Logging; + +namespace Inbox2.Core.Threading +{ + public class TaskProcessor : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + protected readonly AutoResetEvent signal; + protected readonly Thread runnerThread; + + protected bool isFree = true; + protected bool shutdown = false; + + protected BackgroundTask queuedBackgroundTask; + + protected Action processingStarted; + protected Action processingFinished; + + public string Name + { + get { return runnerThread.Name; } + } + + public BackgroundTask QueuedBackgroundTask + { + get { return queuedBackgroundTask; } + } + + /// + /// Gets a value indicating whether this instance is processing. + /// + /// + /// true if this instance is processing; otherwise, false. + /// + public virtual bool IsFree + { + get { return isFree; } + } + + /// + /// Gets a value indicating whether requires the STA appartment state. + /// + /// + /// true if requires STA appartment state; otherwise, false. + /// + public virtual bool RequiresSTAAppartmentState + { + get { return false; } + } + + /// + /// Initializes a new instance of the class. + /// + public TaskProcessor(Action processingStarted, Action processingFinished, int threadNr) + { + this.processingStarted = processingStarted; + this.processingFinished = processingFinished; + + this.signal = new AutoResetEvent(false); + + this.runnerThread = new Thread(Heartbeat); + this.runnerThread.Name = "Processing Thread " + threadNr; + this.runnerThread.IsBackground = true; + this.runnerThread.Priority = ThreadPriority.AboveNormal; + + if (this.RequiresSTAAppartmentState) + this.runnerThread.SetApartmentState(ApartmentState.STA); + + this.runnerThread.Start(); + } + + /// + /// Processes the specified work item. + /// + /// The work item. + public void Process(BackgroundTask backgroundTask) + { + if (backgroundTask == null) + { + Debug.Fail("Not allowed to be null"); + + return; + } + + Trace.WriteLine("Signaling processing thread to process the queued task"); + + queuedBackgroundTask = backgroundTask; + OnPropertyChanged("QueuedBackgroundTask"); + + ToggleStatus(false); + + // Signal our processing thread to process the queued task + signal.Set(); + } + + /// + /// Shutdowns this instance. + /// + public void Shutdown() + { + if (!isFree) + { + // Kill running task + if (queuedBackgroundTask is IDisposable) + (queuedBackgroundTask as IDisposable).Dispose(); + + if (runnerThread.IsAlive) + runnerThread.Abort(); + + return; + } + + shutdown = true; + signal.Set(); + } + + /// + /// Heartbeat thread, waits for signal that something has been queued for processing. + /// + protected virtual void Heartbeat() + { + Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); + + do + { + if (shutdown) + return; + + Trace.WriteLine("Processor idle, waiting for signal..."); + + // Wait for the signal to be set + signal.WaitOne(); + + Trace.WriteLine("Got signal, processing task"); + + // Exit heartbeat + if (shutdown) + return; + + try + { + queuedBackgroundTask.OnStarted(); + + queuedBackgroundTask.Execute(); + + queuedBackgroundTask.OnSuccess(); + } + //catch (ThreadAbortException) + //{ + // Thread.ResetAbort(); + //} + catch (Exception ex) + { + try + { + Logger.Error("An error has occured while executing the task {0}, Exception = {1}", LogSource.TaskQueue, this, ex); + + queuedBackgroundTask.OnFailure(); + } + catch (Exception ex1) + { + Logger.Error("A fatal background task exception has occured. Exception = {0}", LogSource.TaskQueue, ex1); + } + } + finally + { + try + { + queuedBackgroundTask.OnCompleted(); + + ToggleStatus(true); + + queuedBackgroundTask = null; + OnPropertyChanged("QueuedBackgroundTask"); + } + catch (Exception ex) + { + Logger.Error("A fatal background task exception has occured. Exception = {0}", LogSource.TaskQueue, ex); + } + } + } + while (true); + } + + /// + /// Toggles the status. + /// + /// if set to true [status]. + private void ToggleStatus(bool status) + { + if (status) + processingFinished(queuedBackgroundTask); + else + processingStarted(queuedBackgroundTask); + + isFree = status; + } + + /// + /// Called when [propertyproperty changed]. + /// + /// Name of the property. + protected void OnPropertyChanged(string propertyName) + { + if (PropertyChanged != null) + { + Thread.CurrentThread.RaiseUIPropertyChanged(this, propertyName, PropertyChanged); + } + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/TaskQueue.cs b/Code/Client/Inbox2/Core/Threading/TaskQueue.cs new file mode 100644 index 0000000..c0f4a70 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/TaskQueue.cs @@ -0,0 +1,135 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Diagnostics; +using System.Linq; +using System.Text; +using Inbox2.Framework.Interfaces; +using Inbox2.Framework.Threading; +using Inbox2.Platform.Interfaces.Enumerations; + +namespace Inbox2.Core.Threading +{ + [Export(typeof(ITaskQueue))] + public class TaskQueue : ITaskQueue + { + public ProcessingPool ProcessingPool { get; private set; } + public List Tasks { get; private set; } + + protected object syncroot = new object(); + + public int Count + { + get + { + lock (syncroot) + { + return Tasks.Count(t => t.ExecutionStatus == ExecutionStatus.Pending + && t.ExecuteAfter < DateTime.Now); + } + } + } + + public TaskQueue() + { + Tasks = new List(); + ProcessingPool = new ProcessingPool(this); + } + + /// + /// Enqueues the specified work item. + /// + /// The work item. + public void Enqueue(IBackgroundTask backgroundTask) + { + var task = (BackgroundTask)backgroundTask; + + lock (syncroot) + { + if (backgroundTask.MaxQueuedInstances == GetQueuedInstances(backgroundTask.GetType(), (BackgroundTask)backgroundTask)) + { + Trace.WriteLine(String.Format("Task {0} has allready reached maximum allowed instances in the queue, ignoring enqueue...", backgroundTask.GetType())); + + task.OnFinished(); + return; + } + + // Else + Tasks.Add(task); + } + + // Signal the processing pool to start (if it wasn't allready running) + ProcessingPool.Process(); + } + + /// + /// Dequeues this instance. + /// + /// + public IBackgroundTask Dequeue() + { + IBackgroundTask task = null; + + lock (syncroot) + { + if (Tasks.Count(t => t.ExecutionStatus == ExecutionStatus.Pending + && t.ExecuteAfter < DateTime.Now) > 0) + { + task = Tasks.First(t => t.ExecutionStatus == ExecutionStatus.Pending + && t.ExecuteAfter < DateTime.Now); + + task.ExecutionStatus = ExecutionStatus.Submitted; + } + } + + // Might be null, by design + return task; + } + + public void Remove(IBackgroundTask task) + { + lock (syncroot) + { + Tasks.Remove(task); + } + } + + public T Find() where T : IBackgroundTask + { + lock (syncroot) + { + return (T)Tasks.FirstOrDefault(t => t.GetType() == typeof(T)); + } + } + + /// + /// Determines whether the specified task type is queued. + /// + /// Type of the task. + /// + /// true if the specified task type is queued; otherwise, false. + /// + public int GetQueuedInstances(Type taskType, BackgroundTask instance) + { + return Tasks.Count(t => t.GetType() == taskType + && t.SingletonKey == instance.SingletonKey + && (t.ExecutionStatus == ExecutionStatus.Pending + || t.ExecutionStatus == ExecutionStatus.Submitted + || t.ExecutionStatus == ExecutionStatus.Running)); + } + + + /// + /// Gets the currently running instances. + /// + /// Type of the task. + /// The instance. + /// + public int GetRunningInstances(Type taskType, BackgroundTask instance) + { + return Tasks.Count(t => t.GetType() == taskType + && t.SingletonKey == instance.SingletonKey + && (t.ExecutionStatus == ExecutionStatus.Running)); + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Tasks/Application/CheckForUpdateTask.cs b/Code/Client/Inbox2/Core/Threading/Tasks/Application/CheckForUpdateTask.cs new file mode 100644 index 0000000..6137f6d --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Tasks/Application/CheckForUpdateTask.cs @@ -0,0 +1,94 @@ +using System; +using System.IO; +using System.Linq; +using System.Net; +using System.Xml.Linq; +using Inbox2.Core.Configuration; +using Inbox2.Core.Threading.Repeat; +using Inbox2.Framework; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.Threading; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Logging; +using Microsoft.Win32; + +namespace Inbox2.Core.Threading.Tasks.Application +{ + public class CheckForUpdateTask : BackgroundTask + { + public override bool RequiresNetworkConnection + { + get { return true; } + } + + string AssetBaseUrl + { + get + { + return String.Format("http://download{0}.inbox2.com/", + String.IsNullOrEmpty(CommandLine.Current.Environment) ? String.Empty : "." + CommandLine.Current.Environment); + } + } + + protected override void ExecuteCore() + { + string versionString; + + if (CheckNeedsUpgrade(out versionString)) + DownloadUpdate(versionString); + + //DownloadRssUpdates("Twitter", "http://twitter.com/statuses/user_timeline/16018665.rss"); + //DownloadRssUpdates("Blog", "http://feeds.feedburner.com/inbox2"); + //DownloadRssUpdates("Facebook", "http://www.facebook.com/feeds/page.php?format=rss20&id=82632103211"); + + EventBroker.Publish(AppEvents.UpdateCheckFinished); + } + + public bool CheckNeedsUpgrade(out string versionString) + { + var wc = new WebClient(); + var currentVersion = GetType().Assembly.GetName().Version; + var clientId = SettingsManager.ClientSettings.AppConfiguration.ClientId; + + versionString = wc.DownloadString(AssetBaseUrl + String.Format("version/latest?clientId={0}&version={1}", clientId, currentVersion)); + + return (new Version(versionString) > currentVersion); + } + + void DownloadUpdate(string versionString) + { + Logger.Debug("Starting download of upgrade archive", LogSource.BackgroundTask); + + var wc = new WebClient(); + var filename = Path.GetTempFileName(); + string url; + + if (String.IsNullOrEmpty(CommandLine.Current.Environment)) + url = String.Format("http://cdn.inbox2.com/client/x86/upgrade {0}.zip", versionString); + else + url = String.Format("http://download.{0}.inbox2.com/client/x86/upgrade {1}.zip", CommandLine.Current.Environment, versionString); + + wc.DownloadFile(url, filename); + + RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\Inbox2\\Upgrade", true); + + if (key == null) + key = Registry.CurrentUser.CreateSubKey("Software\\Inbox2\\Upgrade"); + + key.SetValue("filename", filename); + key.SetValue("version", GetType().Assembly.GetName().Version.ToString()); + key.Close(); + + Logger.Debug("Finished download of upgrade archive", LogSource.BackgroundTask); + Logger.Debug("Pending upgrade filename = {0}", LogSource.BackgroundTask, filename); + } + + public override void OnCompleted() + { + // Schedule next execution + new Run("UpdateCheck").After(60).Minutes().Call(Tasks.CheckForUpdate); + + base.OnCompleted(); + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Tasks/Application/PurgeDataTask.cs b/Code/Client/Inbox2/Core/Threading/Tasks/Application/PurgeDataTask.cs new file mode 100644 index 0000000..ca37d23 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Tasks/Application/PurgeDataTask.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using Inbox2.Core.Threading.Handlers.Matchers; +using Inbox2.Framework; +using Inbox2.Framework.Extensions; +using Inbox2.Framework.Threading; +using Inbox2.Framework.VirtualMailBox; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Logging; + +namespace Inbox2.Core.Threading.Tasks.Application +{ + public class PurgeDataTask : BackgroundTask + { + private readonly VirtualMailBox mailbox; + + public PurgeDataTask() + { + mailbox = VirtualMailBox.Current; + } + + protected override void ExecuteCore() + { + List delete; + + using (mailbox.StatusUpdates.ReaderLock) + delete = mailbox.StatusUpdates.Where(u => u.SortDate < DateTime.Now.AddDays(-7)).ToList(); + + foreach (var status in delete) + { + try + { + ClientState.Current.DataService.Delete(status); + + ClientState.Current.Search.Delete(status); + } + catch (Exception ex) + { + Logger.Error("An error has occured while purging userstatus, Exception = {0}", LogSource.BackgroundTask, ex); + } + } + + Thread.CurrentThread.ExecuteOnUIThread(() => delete.ForEach(d => mailbox.StatusUpdates.Remove(d))); + + // Find messages that have not been matched + List messages; + + using (mailbox.Messages.ReaderLock) + messages = mailbox.Messages.Where(m => m.ConversationIdentifier == String.Empty && m.DateCreated < DateTime.Now.AddMinutes(1)).ToList(); + + foreach (var message in messages) + { + try + { + MessageMatcher.Match(message); + } + catch (Exception ex) + { + Logger.Error("An error has occured while trying to match old message. Exception = {0}", LogSource.BackgroundTask, ex); + } + } + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Tasks/Application/RemoveChannelTask.cs b/Code/Client/Inbox2/Core/Threading/Tasks/Application/RemoveChannelTask.cs new file mode 100644 index 0000000..b0f2d17 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Tasks/Application/RemoveChannelTask.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using Inbox2.Core.Configuration; +using Inbox2.Framework; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.Threading; +using Inbox2.Framework.VirtualMailBox; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Framework.Web; + +namespace Inbox2.Core.Threading.Tasks.Application +{ + public class RemoveChannelTask : BackgroundTask + { + private readonly ChannelConfiguration configuration; + private readonly VirtualMailBox mailbox; + private readonly bool notify; + + public RemoveChannelTask(ChannelConfiguration configuration) : this(configuration, true) + { + } + + public RemoveChannelTask(ChannelConfiguration configuration, bool notify) + { + this.configuration = configuration; + this.mailbox = VirtualMailBox.Current; + this.notify = notify; + } + + protected override void ExecuteCore() + { + var config = ClientState.Current.DataService.SelectByKey(configuration.ChannelId); + + if (notify && config.ChannelConnection == ChannelConnection.Connected) + { + // Remove configuration from server + HttpServiceRequest.Post(CloudApi.ApiBaseUrl + "account/removechannel", + String.Format("wrap_access_token={0}&key={1}", CloudApi.AccessToken, config.ChannelKey), true); + } + + ClientState.Current.DataService.ExecuteNonQuery("DELETE FROM UserStatus WHERE SourceChannelId=" + config.ChannelConfigId); + ClientState.Current.DataService.ExecuteNonQuery("DELETE FROM Profiles WHERE SourceChannelId=" + config.ChannelConfigId); + ClientState.Current.DataService.ExecuteNonQuery("DELETE FROM Persons WHERE SourceChannelId=" + config.ChannelConfigId); + ClientState.Current.DataService.ExecuteNonQuery("DELETE FROM Conversations WHERE ConversationIdentifier IN (SELECT ConversationIdentifier FROM Messages WHERE Messages.SourceChannelId=" + config.ChannelConfigId + " OR TargetChannelId=" + config.ChannelConfigId + ")"); + ClientState.Current.DataService.ExecuteNonQuery("DELETE FROM Messages WHERE SourceChannelId=" + config.ChannelConfigId + " OR TargetChannelId=" + config.ChannelConfigId); + ClientState.Current.DataService.ExecuteNonQuery("DELETE FROM Documents WHERE SourceChannelId=" + config.ChannelConfigId); + ClientState.Current.DataService.ExecuteNonQuery("DELETE FROM DocumentVersions WHERE SourceChannelId=" + config.ChannelConfigId); + ClientState.Current.DataService.Delete(config); + + mailbox.StatusUpdates.RemoveAll(u => u.SourceChannelId == config.ChannelConfigId || u.TargetChannelId == config.ChannelConfigId.ToString()); + mailbox.Profiles.RemoveAll(p => p.SourceChannelId == config.ChannelConfigId); + mailbox.Persons.RemoveAll(p => p.SourceChannelId == config.ChannelConfigId); + // conversations are not deleted because well we don't care about then, will be gone on the next restart anyway + mailbox.Messages.RemoveAll(m => m.SourceChannelId == config.ChannelConfigId || m.TargetChannelId == config.ChannelConfigId); + mailbox.Documents.RemoveAll(d => d.SourceChannelId == config.ChannelConfigId || d.TargetChannelId == config.ChannelConfigId); + mailbox.DocumentVersions.RemoveAll(d => d.SourceChannelId == config.ChannelConfigId || d.TargetChannelId == config.ChannelConfigId); + + // Delete channel from the ChannelsManager + ChannelsManager.Remove(ChannelsManager.GetChannelObject(config.ChannelConfigId.Value)); + + EventBroker.Publish(AppEvents.RebuildToolbar); + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Tasks/Application/ShipLogTask.cs b/Code/Client/Inbox2/Core/Threading/Tasks/Application/ShipLogTask.cs new file mode 100644 index 0000000..45eb204 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Tasks/Application/ShipLogTask.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using Inbox2.Core.Configuration; +using Inbox2.Core.Threading.Repeat; +using Inbox2.Framework; +using Inbox2.Framework.Stats; +using Inbox2.Framework.Threading; +using Inbox2.Framework.VirtualMailBox; +using Inbox2.Platform.Framework.Extensions; +using Inbox2.Platform.Framework.Web; +using Inbox2.Platform.Logging; +using Newtonsoft.Json; + +namespace Inbox2.Core.Threading.Tasks.Application +{ + public class ShipLogTask : BackgroundTask + { + private static string _SessionId = Guid.NewGuid().GetHash(12); + + public override bool RequiresNetworkConnection + { + get { return true; } + } + + private string AssetBaseUrl + { + get + { + return String.Format("http://download{0}.inbox2.com/", + String.IsNullOrEmpty(CommandLine.Current.Environment) ? String.Empty : "." + CommandLine.Current.Environment); + } + } + + protected override bool CanExecute() + { + return !SettingsManager.ClientSettings.AppConfiguration.IsStatsDisabled; + } + + protected override void ExecuteCore() + { + + } + + public override void OnCompleted() + { + // Schedule next execution + new Run("ShipLogs").After(5).Minutes().Call(Tasks.ShipLogs); + + base.OnCompleted(); + } + + static string ToJson(object o) + { + var sb = new StringBuilder(); + + using (var sw = new StringWriter(sb)) + { + // Create json representation of data + var ser = new JsonSerializer(); + ser.Serialize(sw, o); + } + + return sb.ToString(); + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Tasks/Commands/CleanupCommandsTask.cs b/Code/Client/Inbox2/Core/Threading/Tasks/Commands/CleanupCommandsTask.cs new file mode 100644 index 0000000..7cb8180 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Tasks/Commands/CleanupCommandsTask.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Framework; +using Inbox2.Framework.Threading; + +namespace Inbox2.Core.Threading.Tasks.Commands +{ + public class CleanupCommandsTask : BackgroundTask + { + protected override void ExecuteCore() + { + // Delete completed tasks or tasks with errors and retries >= MaxRetries + ClientState.Current.DataService.ExecuteNonQuery("delete from CommandQueue where Status='Success' or (Status='Error' and ActualRetries >= MaxRetries) "); + + // Unblock pending commands whose execution has exceeded 3 minutes and is still pending + var command = ClientState.Current.DataService.CreateCommand(); + var parameter = ClientState.Current.DataService.CreateParameter(); + + parameter.ParameterName = "@DateScheduled"; + parameter.Value = DateTime.Now.AddMinutes(-3); + + command.CommandText = "update CommandQueue set Status='Pending' where Status='Running' and DateScheduled > @DateScheduled"; + command.Parameters.Add(parameter); + + ClientState.Current.DataService.ExecuteNonQuery(command); + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Tasks/Commands/ExecuteCommandsTask.cs b/Code/Client/Inbox2/Core/Threading/Tasks/Commands/ExecuteCommandsTask.cs new file mode 100644 index 0000000..92cce92 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Tasks/Commands/ExecuteCommandsTask.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Core.Threading.Commands; +using Inbox2.Framework; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.Threading; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Interfaces.Enumerations; +using Inbox2.Platform.Logging; + +namespace Inbox2.Core.Threading.Tasks.Commands +{ + public class ExecuteCommandsTask : BackgroundTask + { + private readonly ExecutionTrigger trigger; + + public ExecuteCommandsTask(ExecutionTrigger trigger) + { + this.trigger = trigger; + } + + protected override void ExecuteCore() + { + var commands = + ClientState.Current.DataService.SelectAllBy( + new { TriggerType = trigger.ToString(), Status = ExecutionStatus.Pending.ToString() }).ToList(); + + if (commands.Count == 0) + return; + + Logger.Debug("{0} commands queued with triggger {1}", LogSource.Command, commands.Count, trigger); + + foreach (var command in commands) + { + if (DateTime.Now > command.DateScheduled) + { + var cmdObject = CommandFactory.CreateCommand(command); + + if (cmdObject.CanExecute) + { + // Lock this task (prevents execution by any other task) + command.Status = ExecutionStatus.Submitted; + ClientState.Current.DataService.Update(command); + + var task = new BackgroundActionTask(cmdObject.Execute); + + // Create new task for command + Logger.Debug("Creating task for command {0}", LogSource.Command, command); + + // Update timestamp on started + QueuedCommand command1 = command; + + task.Started += delegate + { + Logger.Debug("Command {0} started", LogSource.Command, command1); + + command1.Status = ExecutionStatus.Submitted; + command1.DateStarted = DateTime.Now; + + ClientState.Current.DataService.Update(command1); + }; + + // Update status on success + task.FinishedSuccess += delegate + { + Logger.Debug("Command {0} finished successfully", LogSource.Command, command1); + + command1.Status = ExecutionStatus.Success; + + ClientState.Current.DataService.Update(command1); + }; + + // Update status on failure + task.FinishedFailure += delegate + { + Logger.Debug("Command {0} finished with failure", LogSource.Command, command1); + + command1.Status = (command1.ActualRetries < command1.MaxRetries) ? ExecutionStatus.Pending : ExecutionStatus.Error; + command1.ActualRetries++; + + ClientState.Current.DataService.Update(command1); + }; + + task.ExecuteAsync(); + } + } + } + } + } +} \ No newline at end of file diff --git a/Code/Client/Inbox2/Core/Threading/Tasks/ExceptionHelper.cs b/Code/Client/Inbox2/Core/Threading/Tasks/ExceptionHelper.cs new file mode 100644 index 0000000..f7e3e0d --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Tasks/ExceptionHelper.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Framework.Localization; + +namespace Inbox2.Core.Threading.Tasks +{ + internal static class ExceptionHelper + { + internal static string BuildChannelError(IClientInputChannel channel, ConnectResult result, bool isException) + { + var messageBuilder = new StringBuilder(); + + messageBuilder.Append(Strings.UnableToConnect); + messageBuilder.Append(", "); + + if (isException) + { + messageBuilder.Append(Strings.DueToAnApplicationError); + } + else + { + switch (result) + { + case ConnectResult.AuthFailure: + messageBuilder.AppendFormat(Strings.ServerSaid, channel.AuthMessage); + break; + default: + messageBuilder.Append(Strings.DueToAChannelError); + break; + } + } + + return messageBuilder.ToString(); + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Tasks/Receive/EnumerateLabelsFolderTask.cs b/Code/Client/Inbox2/Core/Threading/Tasks/Receive/EnumerateLabelsFolderTask.cs new file mode 100644 index 0000000..723775a --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Tasks/Receive/EnumerateLabelsFolderTask.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Inbox2.Framework.Interfaces.Enumerations; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Interfaces.Enumerations; +using Inbox2.Platform.Interfaces.ValueTypes; +using Inbox2.Framework.Localization; + +namespace Inbox2.Core.Threading.Tasks.Receive +{ + public class EnumerateLabelsFolderTask : ReceiveMessagesTask + { + public EnumerateLabelsFolderTask(ChannelConfiguration config, IClientInputChannel channel, ChannelFolder folder, ReceiveRange range) + : base(config, channel, folder, range) + { + } + + protected override void PreProcess() + { + channel.Connect(); + + ProgressGroup.Status = String.Format("Updating label '{0}'", folder.Name); + } + + protected override List GetHeadersToDownload(List headers) + { + var headersToDownload = new List(); + + foreach (var header in headers) + { + Message message; + ChannelMessageHeader header1 = header; + + using (mailbox.Messages.ReaderLock) + message = mailbox.Messages.FirstOrDefault(m => (m.SourceChannelId == config.ChannelId || m.TargetChannelId == config.ChannelId) + && m.MessageIdentifier == header1.MessageIdentifier && m.Size == header1.Size); + + if (message != null) + message.ReceiveLabels.Add(new Label(folder.Name, ParseLabelType(folder.Name), header.MessageNumber)); + else + { + // Message not found, perform a download + headersToDownload.Add(header1); + } + } + + return headersToDownload; + } + + protected override void PostProcess() + { + } + + LabelType ParseLabelType(string label) + { + if (label == Strings.Todo) + return LabelType.Todo; + else if (label == Strings.WaitingFor) + return LabelType.WaitingFor; + else if (label == Strings.Someday) + return LabelType.Someday; + else + return LabelType.Custom; + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Tasks/Receive/EnumerateMessagesFolderTask.cs b/Code/Client/Inbox2/Core/Threading/Tasks/Receive/EnumerateMessagesFolderTask.cs new file mode 100644 index 0000000..f530d25 --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Tasks/Receive/EnumerateMessagesFolderTask.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Channels.Configuration; +using Inbox2.Platform.Channels.Entities; +using Inbox2.Platform.Channels.Interfaces; +using Inbox2.Platform.Interfaces.ValueTypes; + +namespace Inbox2.Core.Threading.Tasks.Receive +{ + public class EnumerateMessagesFolderTask : ReceiveMessagesTask + { + public EnumerateMessagesFolderTask(ChannelConfiguration config, IClientInputChannel channel, ChannelFolder folder, ReceiveRange range) + : base(config, channel, folder, range) + { + } + + protected override void PreProcess() + { + channel.Connect(); + + ProgressGroup.Status = String.Format("Synchronizing '{0}' folder", folder.FolderType); + } + + protected override List GetHeadersToDownload(List headers) + { + foreach (var header in headers) + { + Message message; + ChannelMessageHeader header1 = header; + + using (mailbox.Messages.ReaderLock) + message = mailbox.Messages.FirstOrDefault(m => (m.SourceChannelId == config.ChannelId || m.TargetChannelId == config.ChannelId) + && m.MessageIdentifier == header1.MessageIdentifier && m.Size == header1.Size); + + if (message != null) + { + // Check if the message is in the folder we are currently enumerating + if (message.MessageFolder != folder.ToStorageFolder()) + message.MoveToFolder(folder.ToStorageFolder()); + } + } + + // Return empty list + return null; + } + + protected override void PostProcess() + { + } + } +} diff --git a/Code/Client/Inbox2/Core/Threading/Tasks/Receive/ProcessLabelsTask.cs b/Code/Client/Inbox2/Core/Threading/Tasks/Receive/ProcessLabelsTask.cs new file mode 100644 index 0000000..3c365bd --- /dev/null +++ b/Code/Client/Inbox2/Core/Threading/Tasks/Receive/ProcessLabelsTask.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Inbox2.Framework.Threading; +using Inbox2.Framework.VirtualMailBox; +using Inbox2.Framework.VirtualMailBox.Entities; +using Inbox2.Platform.Channels.Configuration; + +namespace Inbox2.Core.Threading.Tasks.Receive +{ + public class ProcessLabelsTask : BackgroundTask + { + private readonly ChannelConfiguration config; + + private readonly VirtualMailBox mailbox = VirtualMailBox.Current; + + public ProcessLabelsTask(ChannelConfiguration config) + { + this.config = config; + } + + protected override void ExecuteCore() + { + List messages; + + using (mailbox.Messages.ReaderLock) + messages = mailbox.Messages + .Where(m => m.SourceChannelId == config.ChannelId || m.TargetChannelId == config.ChannelId) + .Where(m => m.ReceiveLabels.Any() || m.LabelsList.Any()) + .ToList(); + + foreach (var message in messages) + { + var removed = new List