public virtual void OnFolderRenamed(FolderRenamedEventArgs args) { if (FolderRenamed != null) { FolderRenamed(this, args); } }
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)); }
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); }