/// <summary>
 /// Initializes a new instance of the <see cref="MoveMessageRequest"/> class.
 /// </summary>
 /// <param name="message">The messagy to copy.</param>
 /// <param name="destFolder">The destination folder.</param>
 /// <param name="callback">The callback to call when copy operation is completed.</param>
 public CopyMessageRequest(IMessage message, IFolder destFolder, RequestCompletedCallback callback)
     : base(callback)
 {
     PreCommand = new SelectFolderCommand(message.Folder, null);
     Command = new CopyMessageCommand(message, destFolder, null);
     ProcessorType = typeof(CopyMessageProcessor);
 }
 public DeleteFolderRequest(IFolder folder, RequestCompletedCallback callback)
     : base(callback)
 {
     /*
      * Process for deleting a folder:
      * the IMAP spec states that deleting a folder should NOT delete any sub folders.
      * So in that case we must rename any and all sub folders to include the name of the 
      * parent folder that is being deleted. for example:
      * 
      * INBOX/Sub1/SubSub1
      *           /SubSub2
      *           /SubSub3
      *           
      * if we delete Sub1, Sub1's sub folders become:
      * 
      * INBOX/Sub1_SubSub1
      * INBOX/Sub1_SubSub2
      * INBOX/Sub1_SubSub3
      * 
      * This request is ONLY for deleting the folder on the server. A higher level construct
      * is needed to facilitate the renaming of sub folders.
      * 
      * */
     Command = new DeleteFolderCommand(folder, null);
     ProcessorType = typeof (DeleteFolderProcessor);
 }
 /// <summary>
 /// Create new changeflag request
 /// </summary>
 /// <param name="msg"></param>
 /// <param name="flag"></param>
 /// <param name="value"></param>
 /// <param name="callback"></param>
 public ChangeFlagRequest(IMessage msg, string flag, bool value, RequestCompletedCallback callback)
     : base(callback)
 {
     PreCommand    = new SelectFolderCommand(msg.Folder, null);
     Command       = new ChangeFlagCommand(msg, flag, value, null);
     ProcessorType = typeof(ChangeFlagProcessor);
 }
 public DeleteFolderRequest(IFolder folder, RequestCompletedCallback callback)
     : base(callback)
 {
     /*
      * Process for deleting a folder:
      * the IMAP spec states that deleting a folder should NOT delete any sub folders.
      * So in that case we must rename any and all sub folders to include the name of the
      * parent folder that is being deleted. for example:
      *
      * INBOX/Sub1/SubSub1
      *           /SubSub2
      *           /SubSub3
      *
      * if we delete Sub1, Sub1's sub folders become:
      *
      * INBOX/Sub1_SubSub1
      * INBOX/Sub1_SubSub2
      * INBOX/Sub1_SubSub3
      *
      * This request is ONLY for deleting the folder on the server. A higher level construct
      * is needed to facilitate the renaming of sub folders.
      *
      * */
     Command       = new DeleteFolderCommand(folder, null);
     ProcessorType = typeof(DeleteFolderProcessor);
 }
Exemple #5
0
 public SearchRequest(IFolder folder, SearchCriteria criteria, RequestCompletedCallback callback)
     : base(callback)
 {
     PreCommand = new SelectFolderCommand(folder, null);
     Command = new SearchCommand(criteria, null);
     ProcessorType = typeof (SearchProcessor);
 }
 /// <summary>
 /// Create new changeflag request
 /// </summary>
 /// <param name="msg"></param>
 /// <param name="flag"></param>
 /// <param name="value"></param>
 /// <param name="callback"></param>
 public ChangeFlagRequest(IMessage msg, MessageFlag flag, bool value, RequestCompletedCallback callback)
     : base(callback)
 {
     PreCommand = new SelectFolderCommand(msg.Folder, null);
     Command = new ChangeFlagCommand(msg, flag, value, null);
     ProcessorType = typeof (ChangeFlagProcessor);
 }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MoveMessageRequest"/> class.
 /// </summary>
 /// <param name="message">The messagy to copy.</param>
 /// <param name="destFolder">The destination folder.</param>
 /// <param name="callback">The callback to call when copy operation is completed.</param>
 public CopyMessageRequest(IMessage message, IFolder destFolder, RequestCompletedCallback callback)
     : base(callback)
 {
     PreCommand    = new SelectFolderCommand(message.Folder, null);
     Command       = new CopyMessageCommand(message, destFolder, null);
     ProcessorType = typeof(CopyMessageProcessor);
 }
 /// <summary>
 /// Retreives the list of message UIDs for the specified folder from the server.
 /// </summary>
 /// <param name="folder"></param>
 /// <param name="callback"></param>
 public MessageListRequest(IFolder folder, RequestCompletedCallback callback)
     : base(callback)
 {
     PreCommand = new ExamineFolderCommand(folder, null);
     Command = new MessageListCommand(folder, null);
     ProcessorType = typeof (MessageListProcessor);
 }
 /// <summary>
 /// Retreives the list of message UIDs for the specified folder from the server.
 /// </summary>
 /// <param name="folder"></param>
 /// <param name="callback"></param>
 public MessageListRequest(IFolder folder, RequestCompletedCallback callback)
     : base(callback)
 {
     PreCommand    = new ExamineFolderCommand(folder, null);
     Command       = new MessageListCommand(folder, null);
     ProcessorType = typeof(MessageListProcessor);
 }
Exemple #10
0
        /// <summary>
        /// Create a FolderTreeRequest specifying the callback method to execute on completion.
        /// </summary>
        /// <param name="rootFolder"></param>
        /// <param name="callback"></param>
        public FolderTreeRequest(string rootFolder, RequestCompletedCallback callback) 
            : base(callback)
        {
            Command = new FolderListCommand(rootFolder, null);
            ProcessorType = typeof (FolderListProcessor);

        }
 public SearchRequest(IFolder folder, SearchCriteria criteria, RequestCompletedCallback callback)
     : base(callback)
 {
     PreCommand    = new SelectFolderCommand(folder, null);
     Command       = new SearchCommand(criteria, null);
     ProcessorType = typeof(SearchProcessor);
 }
 /// <summary>
 /// Create a new message part request
 /// </summary>
 /// <param name="content"></param>
 /// <param name="callback"></param>
 /// <param name="dataReceived"></param>
 public MessagePartRequest(IMessageContent content, RequestCompletedCallback callback, BaseCommand.CommandDataReceivedCallback dataReceived)
     : base(callback)
 {
     PreCommand    = new ExamineFolderCommand(content.Message.Folder, null);
     Command       = new MessagePartCommand(content, dataReceived);
     ProcessorType = typeof(MessagePartProcessor);
 }
 public DeleteMessageRequest(IMessage msg, RequestCompletedCallback callback)
     : base(callback)
 {
     PreCommand = new SelectFolderCommand(msg.Folder, null);
     Command = new ChangeFlagCommand(msg, MessageFlag.Deleted, true, null);
     PostCommand = new ExpungeCommand(null);
     ProcessorType = typeof (DeleteMessageProcessor);
 }
Exemple #14
0
 public DeleteMessageRequest(IMessage msg, RequestCompletedCallback callback)
     : base(callback)
 {
     PreCommand    = new SelectFolderCommand(msg.Folder, null);
     Command       = new ChangeFlagCommand(msg, MessageFlag.Deleted, true, null);
     PostCommand   = new ExpungeCommand(null);
     ProcessorType = typeof(DeleteMessageProcessor);
 }
 /// <summary>
 /// Create a new message part request
 /// </summary>
 /// <param name="content"></param>
 /// <param name="callback"></param>
 /// <param name="dataReceived"></param>
 public MessagePartRequest(IMessageContent content, RequestCompletedCallback callback, BaseCommand.CommandDataReceivedCallback dataReceived)
     : base(callback)
 {
     
     
     PreCommand = new ExamineFolderCommand(content.Message.Folder, null);
     Command = new MessagePartCommand(content, dataReceived);
     ProcessorType = typeof (MessagePartProcessor);
 }
        /// <summary>
        /// Create a new MessageHeaderRequest
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="callback"></param>
        public MessageHeaderRequest(IFolder folder, RequestCompletedCallback callback)
            : base(callback)
        {
            if (folder == null)
                throw new NullReferenceException("MessageHeaderRequest: folder is null");

            PreCommand = new ExamineFolderCommand(folder, null);
            Command = new MessageHeaderCommand(folder, null);
            ProcessorType = typeof(MessageHeaderProcessor);
        }
 /// <summary>
 /// Create a new message structure request
 /// </summary>
 /// <param name="msg"></param>
 /// <param name="callback"></param>
 public MessageStructureRequest(IMessage msg, RequestCompletedCallback callback)
     :base(callback)
 {
     if (msg.ContentLoaded)
         return;
     
     PreCommand = new ExamineFolderCommand(msg.Folder, null);
     Command = new MessageStructureCommand(msg, null);
     ProcessorType = typeof (MessageStructureProcessor);
 }
Exemple #18
0
        /// <summary>
        /// Create a new message structure request
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="callback"></param>
        public MessageStructureRequest(IMessage msg, RequestCompletedCallback callback)
            : base(callback)
        {
            if (msg.ContentLoaded)
            {
                return;
            }

            PreCommand    = new ExamineFolderCommand(msg.Folder, null);
            Command       = new MessageStructureCommand(msg, null);
            ProcessorType = typeof(MessageStructureProcessor);
        }
Exemple #19
0
        /// <summary>
        /// Create a new MessageHeaderRequest
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="callback"></param>
        public MessageHeaderRequest(IFolder folder, RequestCompletedCallback callback)
            : base(callback)
        {
            if (folder == null)
            {
                throw new NullReferenceException("MessageHeaderRequest: folder is null");
            }

            PreCommand    = new ExamineFolderCommand(folder, null);
            Command       = new MessageHeaderCommand(folder, null);
            ProcessorType = typeof(MessageHeaderProcessor);
        }
        /// <summary>
        /// Create a new MessageHeaderRequest
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="callback"></param>
        public MessageHeaderRequest(IMessage msg, RequestCompletedCallback callback)
            : base(callback)
        {
            if (msg == null)
                throw new NullReferenceException("MessageHeaderRequest: msg is null");

            if (msg.HeaderLoaded)
                return;

            PreCommand = new ExamineFolderCommand(msg.Folder, null);
            Command = new MessageHeaderCommand(msg, null);
            ProcessorType = typeof (MessageHeaderProcessor);
        }
Exemple #21
0
        /// <summary>
        /// Create a new MessageHeaderRequest
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="callback"></param>
        public MessageHeaderRequest(IMessage msg, RequestCompletedCallback callback)
            : base(callback)
        {
            if (msg == null)
            {
                throw new NullReferenceException("MessageHeaderRequest: msg is null");
            }

            if (msg.HeaderLoaded)
            {
                return;
            }

            PreCommand    = new ExamineFolderCommand(msg.Folder, null);
            Command       = new MessageHeaderCommand(msg, null);
            ProcessorType = typeof(MessageHeaderProcessor);
        }
 public MessageFlagRequest(IMessage msg, RequestCompletedCallback callback) : base(callback)
 {
     PreCommand    = new ExamineFolderCommand(msg.Folder, null);
     Command       = new MessageFlagCommand(msg, null);
     ProcessorType = typeof(MessageFlagProcessor);
 }
 public CreateFolderRequest(string folderName, IFolder parentFolder, RequestCompletedCallback callback)
     : base(callback)
 {
     Command       = new CreateFolderCommand(folderName, parentFolder, null);
     ProcessorType = typeof(CreateFolderProcessor);
 }
Exemple #24
0
 /// <summary>
 /// Create a new folder data request
 /// </summary>
 /// <param name="folder"></param>
 /// <param name="callback"></param>
 public FolderDataRequest(IFolder folder, RequestCompletedCallback callback)
     : base(callback)
 {
     Command = new ExamineFolderCommand(folder, null);
     ProcessorType = typeof (FolderDataProcessor);
 }
 public RenameFolderRequest(IFolder folder, string newName, RequestCompletedCallback callback)
     : base(callback)
 {
     Command = new RenameFolderCommand(folder, newName, null);
     ProcessorType = typeof (RenameFolderProcessor);
 }
 public AppendRequest(string emlContent, string flags, IFolder parentFolder, RequestCompletedCallback callback)
     : base(callback)
 {
     Command       = new AppendCommand(emlContent, flags, parentFolder, null);
     ProcessorType = typeof(AppendProcessor);
 }
Exemple #27
0
 public MoveFolderRequest(IFolder folder, IFolder parentFolder, RequestCompletedCallback callback)
     : base(callback)
 {
     Command = new MoveFolderCommand(folder, parentFolder, null);
     ProcessorType = typeof(MoveFolderProcessor);
 }
 public MoveFolderRequest(IFolder folder, IFolder parentFolder, RequestCompletedCallback callback)
     : base(callback)
 {
     Command       = new MoveFolderCommand(folder, parentFolder, null);
     ProcessorType = typeof(MoveFolderProcessor);
 }
 /// <summary>
 /// Create a FolderTreeRequest specifying the callback method to execute on completion.
 /// </summary>
 /// <param name="rootFolder"></param>
 /// <param name="callback"></param>
 public FolderTreeRequest(string rootFolder, RequestCompletedCallback callback)
     : base(callback)
 {
     Command       = new FolderListCommand(rootFolder, null);
     ProcessorType = typeof(FolderListProcessor);
 }
Exemple #30
0
 /// <summary>
 /// Basic Constructor
 /// </summary>
 /// <param name="callback"></param>
 public BaseRequest(RequestCompletedCallback callback)
 {
     //_client = client;
     RequestCompleted += callback;
 }
 public RenameFolderRequest(IFolder folder, string newName, RequestCompletedCallback callback)
     : base(callback)
 {
     Command       = new RenameFolderCommand(folder, newName, null);
     ProcessorType = typeof(RenameFolderProcessor);
 }
Exemple #32
0
 public AppendRequest(string emlContent, string flags, IFolder parentFolder, RequestCompletedCallback callback)
     : base(callback)
 {
     Command = new AppendCommand(emlContent, flags, parentFolder, null);
     ProcessorType = typeof (AppendProcessor);
 }
 public CreateFolderRequest(string folderName, IFolder parentFolder, RequestCompletedCallback callback)
     : base(callback)
 {
     Command = new CreateFolderCommand(folderName, parentFolder, null);
     ProcessorType = typeof (CreateFolderProcessor);
 }
 public MessageFlagRequest(IMessage msg, RequestCompletedCallback callback) : base(callback)
 {
     PreCommand = new ExamineFolderCommand(msg.Folder, null);
     Command = new MessageFlagCommand(msg, null);
     ProcessorType = typeof (MessageFlagProcessor);
 }
Exemple #35
0
 /// <summary>
 /// Create a new folder data request
 /// </summary>
 /// <param name="folder"></param>
 /// <param name="callback"></param>
 public FolderDataRequest(IFolder folder, RequestCompletedCallback callback)
     : base(callback)
 {
     Command       = new ExamineFolderCommand(folder, null);
     ProcessorType = typeof(FolderDataProcessor);
 }