private void event_ItemRenamed(object sender, ItemRenamedEventArgs e) { if (this.Directories.Contains(e.OldValue) == true) { // Let's update directories path. foreach (string directoryPath in this.Directories.ToList()) { if (directoryPath.Length > e.OldValue.Length && directoryPath.Substring(0, e.OldValue.Length) == e.OldValue) { this.Directories.Remove(directoryPath); this.Directories.Add(Path.Combine(e.NewValue, directoryPath.Remove(0, e.OldValue.Length + 1))); } } // Let's update files path. foreach (string fileName in this.Files.ToList()) { if (fileName.Length > e.OldValue.Length && fileName.Substring(0, e.OldValue.Length) == e.OldValue) { this.Files.Remove(fileName); this.Files.Add(Path.Combine(e.NewValue, fileName.Remove(0, e.OldValue.Length + 1))); } } this.Directories.Remove(e.OldValue); this.Directories.Add(e.NewValue); } else if (this.Files.Contains(e.OldValue) == true) { this.Files.Remove(e.OldValue); this.Files.Add(e.NewValue); } }
private void TypeContextBase_ItemRenamed(object sender, ItemRenamedEventArgs <_I> e) { foreach (var item in this.GetTables()) { var tableInfo = item.TableInfo; this.RenameType(ref tableInfo, e.OldPath, e.Item.Path); item.TableInfo = tableInfo; } }
private void ItemRenamedNotification(object sender, ItemRenamedEventArgs args) { Assert.ArgumentNotNull(sender, "sender"); Assert.ArgumentNotNull(args, "args"); if ((WebUtil.GetQueryString("mo") == "preview") && (args.Item.ID.ToString() == WebUtil.GetQueryString("fo"))) { UrlOptions defaultOptions = UrlOptions.DefaultOptions; defaultOptions.ShortenUrls = false; SheerResponse.SetAttribute("scPostAction", "value", "goto:" + LinkManager.GetItemUrl(args.Item, defaultOptions)); } Item folder = this.ContentEditorDataContext.GetFolder(); if (Settings.ContentEditor.ClassicFrameEventPropagation || ((folder != null) && ((folder.ID == args.Item.ID) || (folder.ID == args.Item.ParentID)))) { SheerResponse.Eval("scContent.postMessage(\"" + string.Concat(new object[] { "notification:itemrenamed(item=", GetUri(args.Item), ",oldname=", args.OldName, ")" }) + "\")"); } }
/// <summary> /// Handles event fired when a node is renamed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _queueSetItem_ItemRenamed(object sender, ItemRenamedEventArgs e) { base.Text = e.Item.Name; }
/// <summary> /// Handles event raised when Q Set attached to the explorer is renamed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void QSet_ItemRenamed(object sender, ItemRenamedEventArgs e) { base.TaskManager.SetTitleBarText(); base.TaskManager.MenuStateManger.SetQSetMenuState(); }