/// <summary> /// Move a descendent element to the path indicated and change its parent /// </summary> /// <param name="DragItem">The item to move</param> /// <param name="destination">The new parent</param> /// <param name="path">The new path for the file</param> /// <returns>true if the operation completed successfully</returns> internal bool MoveElement(Item DragItem, ContainerItem destination, string path, Func <string, bool> ShouldReplaceFile) { if (DragItem.File.Move(path, () => ShouldReplaceFile(path))) { RemoveProjectChild(DragItem, DragItem.File.FullName); ContainerItem.InsertChildAlphabetically(destination, DragItem); return(true); } return(false); }
//This makes the instance InsertChildAlphabetically availble to ProjectItem protected static void InsertChildAlphabetically(ContainerItem parent, Item child) { parent.InsertChildAlphabetically(child); }
public void InsertProjectChildAlphabetically(ContainerItem parent, Item item) { m_contents.Add(item.File.FullName); ContainerItem.InsertChildAlphabetically(parent, item); }