Esempio n. 1
0
 public virtual void OnFolderRenamed(FolderRenamedEventArgs args)
 {
     if (FolderRenamed != null)
     {
         FolderRenamed(this, args);
     }
 }
Esempio n. 2
0
        public void TestFolderRenamedEventArgs()
        {
            var args = new FolderRenamedEventArgs("Istanbul", "Constantinople");

            Assert.AreEqual("Istanbul", args.OldName);
            Assert.AreEqual("Constantinople", args.NewName);

            Assert.Throws <ArgumentNullException> (() => new FolderRenamedEventArgs(null, "name"));
            Assert.Throws <ArgumentNullException> (() => new FolderRenamedEventArgs("name", null));
        }
Esempio n. 3
0
        void ParentFolderRenamed(object sender, FolderRenamedEventArgs e)
        {
            var oldEncodedName = EncodedName;
            var oldFullName = FullName;

            FullName = ParentFolder.FullName + DirectorySeparator + Name;
            EncodedName = ImapEncoding.Encode (FullName);
            Engine.FolderCache.Remove (oldEncodedName);
            Engine.FolderCache[EncodedName] = this;

            if (Engine.Selected == this) {
                Engine.State = ImapEngineState.Authenticated;
                Access = FolderAccess.None;
                Engine.Selected = null;
            }

            OnRenamed (oldFullName, FullName);
        }