/// <summary> /// Adds the given item to the solution /// </summary> /// <param name="path">New path of the item</param> /// <param name="item">The item to add</param> protected void AddItem(string path, IOnDisk item) { if (ItemExists(path)) { throw new ArgumentException(Properties.Resources.Project_ItemExistsAtPath, nameof(path)); } var parentDir = FixPath(Path.GetDirectoryName(path)); if (!string.IsNullOrEmpty(parentDir) && !DirectoryExists(parentDir)) { CreateDirectory(parentDir); } var fixedPath = FixPath(path); Items.Add(fixedPath, item); ItemAdded?.Invoke(this, new ItemAddedEventArgs(fixedPath)); }
public new void AddItem(string path, IOnDisk item) { base.AddItem(path, item); }