/// <summary> /// Initializes a new instance of the <see cref="PathGroup"/> class. /// </summary> /// <param name="pathTable">The table of items in the group.</param> /// <param name="groupParentPath">The specified parent path.</param> public PathGroup(IReadOnlyDictionary <ITreeNodePath, IPathConnection> pathTable, IFolderPath groupParentPath) { if (groupParentPath == null) { throw new ArgumentNullException(nameof(groupParentPath)); } if (pathTable == null) { throw new ArgumentNullException(nameof(pathTable)); } Debug.Assert(HasNullCommonParent(pathTable)); Dictionary <ITreeNodePath, IPathConnection> PathTable = new Dictionary <ITreeNodePath, IPathConnection>(); foreach (KeyValuePair <ITreeNodePath, IPathConnection> Entry in pathTable) { ITreeNodePath Path = Entry.Key; IPathConnection PathConnection = Entry.Value; IFolderPath? ParentPath = PathConnection.ParentPath; ITreeNodeProperties Properties = PathConnection.Properties; bool IsExpanded = PathConnection.IsExpanded; if (ParentPath == null) { ParentPath = GroupParentPath; } PathTable.Add(Path, new PathConnection(ParentPath, Properties, IsExpanded)); } this.PathTable = PathTable; GroupParentPath = groupParentPath; }
public PathGroup(IReadOnlyDictionary <ITreeNodePath, IPathConnection> pathTable, IFolderPath groupParentPath) { Assert.ValidateReference(pathTable); Assert.ValidateReference(groupParentPath); Assert.CheckCondition(HasNullCommonParent(pathTable)); Dictionary <ITreeNodePath, IPathConnection> PathTable = new Dictionary <ITreeNodePath, IPathConnection>(); foreach (KeyValuePair <ITreeNodePath, IPathConnection> Entry in pathTable) { ITreeNodePath Path = Entry.Key; IPathConnection PathConnection = Entry.Value; IFolderPath ParentPath = PathConnection.ParentPath; ITreeNodeProperties Properties = PathConnection.Properties; bool IsExpanded = PathConnection.IsExpanded; if (ParentPath == null) { ParentPath = GroupParentPath; } PathTable.Add(Path, new PathConnection(ParentPath, Properties, IsExpanded)); } this.PathTable = PathTable; this.GroupParentPath = GroupParentPath; }
/// <summary> /// Initializes a new instance of the <see cref="SolutionTreeNode"/> class. /// </summary> /// <param name="parent">The parent folder.</param> /// <param name="path">The node path.</param> /// <param name="properties">The node properties.</param> protected SolutionTreeNode(ISolutionFolder?parent, ITreeNodePath path, ITreeNodeProperties properties) { Parent = parent; Path = path; Properties = properties; UpdateName(); }
protected SolutionTreeNode(ISolutionFolder parent, ITreeNodePath path, ITreeNodeProperties properties) { this.Parent = parent; this.Path = path; this.Properties = properties; UpdateName(); InitIsDirty(); }
public PathGroup(ITreeNodePath path, IFolderPath parentPath, ITreeNodeProperties properties) { Assert.ValidateReference(path); Assert.ValidateReference(parentPath); Assert.ValidateReference(properties); Dictionary <ITreeNodePath, IPathConnection> SinglePathTable = new Dictionary <ITreeNodePath, IPathConnection>(); SinglePathTable.Add(path, new PathConnection(parentPath, properties, false)); PathTable = SinglePathTable; GroupParentPath = parentPath; }
/// <summary> /// Initializes a new instance of the <see cref="PathGroup"/> class. /// </summary> /// <param name="path">The single member of the group.</param> /// <param name="parentPath">The parent path.</param> /// <param name="properties">Properties of the associated item.</param> public PathGroup(ITreeNodePath path, IFolderPath parentPath, ITreeNodeProperties properties) { if (path == null) { throw new ArgumentNullException(nameof(path)); } if (parentPath == null) { throw new ArgumentNullException(nameof(parentPath)); } if (properties == null) { throw new ArgumentNullException(nameof(properties)); } Dictionary <ITreeNodePath, IPathConnection> SinglePathTable = new Dictionary <ITreeNodePath, IPathConnection>(); SinglePathTable.Add(path, new PathConnection(parentPath, properties, false)); PathTable = SinglePathTable; GroupParentPath = parentPath; }
protected AddRemoveSingleOperation(ISolutionRoot root, IFolderPath parentPath, ITreeNodePath path, ITreeNodeProperties properties) : base(root, CreateSinglePathTable(parentPath, path, properties)) { }
private static IReadOnlyDictionary <ITreeNodePath, IPathConnection> CreateSinglePathTable(IFolderPath parentPath, ITreeNodePath path, ITreeNodeProperties properties) { return(new Dictionary <ITreeNodePath, IPathConnection>() { { path, new PathConnection(parentPath, properties, false) } }); }
public NodePastedCompletionArgs(ITreeNodePath NewPath, ITreeNodeProperties NewProperties) { this.NewPath = NewPath; this.NewProperties = NewProperties; }
/// <summary> /// Initializes a new instance of the <see cref="NodePastedCompletionArgs"/> class. /// </summary> /// <param name="newPath">The new node path.</param> /// <param name="newProperties">The new node properties.</param> public NodePastedCompletionArgs(ITreeNodePath newPath, ITreeNodeProperties newProperties) { NewPath = newPath; NewProperties = newProperties; }
protected AddSingleOperation(ISolutionRoot root, IFolderPath destinationFolderPath, ITreeNodePath newPath, ITreeNodeProperties newProperties) : base(root, destinationFolderPath, newPath, newProperties) { Assert.ValidateReference(destinationFolderPath); this.DestinationFolderPath = destinationFolderPath; }
/// <summary> /// Initializes a new instance of the <see cref="AddSingleOperation"/> class. /// </summary> /// <param name="root">The root path.</param> /// <param name="destinationFolderPath">The destination folder path.</param> /// <param name="newPath">The path of the added item.</param> /// <param name="newProperties">The properties of the added item.</param> protected AddSingleOperation(ISolutionRoot root, IFolderPath destinationFolderPath, ITreeNodePath newPath, ITreeNodeProperties newProperties) : base(root, destinationFolderPath, newPath, newProperties) { if (destinationFolderPath == null) { throw new ArgumentNullException(nameof(destinationFolderPath)); } this.DestinationFolderPath = destinationFolderPath; }
/// <summary> /// Notifies handlers that the operation is completed. /// </summary> /// <param name="dispatcher">The window dispatcher.</param> /// <param name="newPath">The path to the new node.</param> /// <param name="newProperties">The properties of the new node.</param> public virtual void NotifyCompletedAsync(Dispatcher dispatcher, ITreeNodePath newPath, ITreeNodeProperties newProperties) { INodePastedCompletionArgs CompletionArgs = new NodePastedCompletionArgs(newPath, newProperties); NotifyEventCompletedAsync(dispatcher, CompletionArgs); }
/// <summary> /// Initializes a new instance of the <see cref="PathConnection"/> class. /// </summary> /// <param name="parentPath">The parent path.</param> /// <param name="properties">The properties.</param> /// <param name="isExpanded">True if the connection is expanded.</param> public PathConnection(IFolderPath?parentPath, ITreeNodeProperties properties, bool isExpanded) { ParentPath = parentPath; Properties = properties; IsExpanded = isExpanded; }
public PathConnection(IFolderPath parentPath, ITreeNodeProperties properties, bool isExpanded) { this.ParentPath = parentPath; this.Properties = properties; this.IsExpanded = isExpanded; }