public static void Nest(IEnumerable <ProjectItem> items) { ItemSelector selector = new ItemSelector(items); if (!selector.ShowDialog().Value) { return; } foreach (ProjectItem item in items) { string path = item.FileNames[0]; ProjectItem parent = item.DTE.Solution.FindProjectItem(selector.SelectedFile); if (parent == null) { continue; } bool mayNeedAttributeSet = item.ContainingProject.IsKind(ProjectTypes.DOTNET_Core, ProjectTypes.UNIVERSAL_APP); if (mayNeedAttributeSet) { SetDependentUpon(item, parent.Name); } else { item.Remove(); parent.ProjectItems.AddFromFile(path); } } }
public static void Nest(IEnumerable <ProjectItem> items) { ItemSelector selector = new ItemSelector(items); if (!selector.ShowDialog().Value) { return; } foreach (ProjectItem item in items) { string path = item.FileNames[0]; ProjectItem parent = item.DTE.Solution.FindProjectItem(selector.SelectedFile); if (parent == null) { continue; } bool mayNeedAttributeSet = item.ContainingProject.Kind.Equals(CordovaKind, System.StringComparison.OrdinalIgnoreCase); if (mayNeedAttributeSet) { SetDependentUpon(item, parent.Name); } else { item.Remove(); parent.ProjectItems.AddFromFile(path); } } }
public static void Nest(IEnumerable<ProjectItem> items) { ItemSelector selector = new ItemSelector(items); if (!selector.ShowDialog().Value) { return; } foreach (ProjectItem item in items) { string path = item.FileNames[0]; ProjectItem parent = item.DTE.Solution.FindProjectItem(selector.SelectedFile); if (parent == null) continue; bool mayNeedAttributeSet = item.ContainingProject.Kind.Equals(CordovaKind, System.StringComparison.OrdinalIgnoreCase); if (mayNeedAttributeSet) { SetDependentUpon(item, parent.Name); } else { item.Remove(); parent.ProjectItems.AddFromFile(path); } } }
public ItemSelector(IEnumerable <EnvDTE.ProjectItem> items) { InitializeComponent(); ddlFiles.Focus(); var siblings = ItemSelector.GetSiblings(items.ElementAt(0)); _files = this.GetSource(siblings, items, new Dictionary <string, string>(), string.Empty); ddlFiles.ItemsSource = _files.Keys; ddlFiles.SelectedIndex = 0; }
public static void Nest(IEnumerable<ProjectItem> items) { ItemSelector selector = new ItemSelector(items); if (!selector.ShowDialog().Value) return; foreach (ProjectItem item in items) { string path = item.Properties.Item("FullPath").Value.ToString(); ProjectItem parent = item.DTE.Solution.FindProjectItem(selector.SelectedFile); if (parent != null) parent.ProjectItems.AddFromFile(path); } }
public ItemSelector(IEnumerable <EnvDTE.ProjectItem> items) { InitializeComponent(); ddlFiles.Focus(); EnvDTE.ProjectItem currentItem = items.ElementAt(0); var siblings = ItemSelector.GetSiblings(currentItem); _files = this.GetSelectedItmes(siblings, items, new Dictionary <string, string>(), string.Empty); ddlFiles.ItemsSource = _files.Keys; var index = GetMatchParentIndex(currentItem.Name, _files.Keys.ToArray()); ddlFiles.SelectedIndex = index; }
public static void Nest(IEnumerable <ProjectItem> items) { ItemSelector selector = new ItemSelector(items); if (!selector.ShowDialog().Value) { return; } foreach (ProjectItem item in items) { string path = item.FileNames[0]; ProjectItem parent = item.DTE.Solution.FindProjectItem(selector.SelectedFile); if (parent != null) { parent.ProjectItems.AddFromFile(path); } } }
public static void Nest(IEnumerable<ProjectItem> items) { ItemSelector selector = new ItemSelector(items); if (!selector.ShowDialog().Value) return; foreach (ProjectItem item in items) { string path = item.FileNames[0]; ProjectItem parent = item.DTE.Solution.FindProjectItem(selector.SelectedFile); if (parent == null) continue; bool mayNeedAttributeSet = item.ContainingProject.Kind == CordovaKind; if (mayNeedAttributeSet) { SetDependentUpon(item, parent.Name); } else { parent.ProjectItems.AddFromFile(path); } } }