public override ITreeConfigNode NodeAddNew() { var node = new AppProject(this.Parent); (this.Parent as AppSolution).ListAppProjects.Add(node); this.GetUniqueName(AppProject.DefaultName, node, (this.Parent as AppSolution).ListAppProjects); this.SetSelected(node); return(node); }
//public override void NodeRemove(bool ask = true) //{ // if (ask) // { // var res = MessageBox.Show("You are deleting generators for Project. Continue?", "Warning", System.Windows.MessageBoxButton.OKCancel); // if (res != System.Windows.MessageBoxResult.OK) // return; // } // foreach (var t in this.ListAppProjectGenerators) // { // t.NodeRemove(false); // } // (this.Parent as AppSolution).ListAppProjects.Remove(this); // this.Parent = null; //} public override ITreeConfigNode NodeAddClone() { var node = AppProject.Clone(this.Parent, this, true, true); node.Parent = this.Parent; (this.Parent as AppSolution).ListAppProjects.Add(node); this._Name = this._Name + "2"; this.SetSelected(node); return(node); }
public string GetGenerationFolderPath() { if (string.IsNullOrEmpty(cfg.CurrentCfgFolderPath)) { return(""); } AppProject prj = this.Parent as AppProject; var path = prj.GetProjectFolderPath(); if (string.IsNullOrWhiteSpace(this.RelativePathToGenFolder)) { path = Path.Combine(path, this.RelativePathToGenFolder); } return(path); }
public override ITreeConfigNode NodeAddNewSubNode(ITreeConfigNode node_impl = null) { AppProject node = null; if (node_impl == null) { node = new AppProject(this); } else { node = (AppProject)node_impl; } node.Parent = this; this.ListAppProjects.Add(node); if (node_impl == null) { this.GetUniqueName(AppProject.DefaultName, node, this.ListAppProjects); } this.SetSelected(node); return(node); }
private bool IsUnique(AppProject val) { if (val.Parent == null) { return(true); } if (string.IsNullOrWhiteSpace(val.Name)) // handled by another rule { return(true); } AppSolution p = (AppSolution)val.Parent; foreach (var t in p.ListAppProjects) { if ((val.Guid != t.Guid) && (val.Name == t.Name)) { return(false); } } return(true); }
public FrameworkElement ResolveEditor(Xceed.Wpf.Toolkit.PropertyGrid.PropertyItem propertyItem) { Contract.Requires(propertyItem != null); prj = (AppProject)propertyItem.Instance; Grid grd = new Grid(); var cd1 = new ColumnDefinition(); cd1.Width = new GridLength(1, GridUnitType.Star); var cd2 = new ColumnDefinition(); cd2.Width = new GridLength(1, GridUnitType.Auto); grd.ColumnDefinitions.Add(cd1); grd.ColumnDefinitions.Add(cd2); textBox = new PropertyGridEditorTextBox(); textBox.Watermark = "Select file"; var _binding = new Binding("Value"); //bind to the Value property of the PropertyItem _binding.Source = propertyItem; _binding.ValidatesOnExceptions = true; _binding.ValidatesOnDataErrors = true; _binding.Mode = propertyItem.IsReadOnly ? BindingMode.OneWay : BindingMode.TwoWay; BindingOperations.SetBinding(textBox, PropertyGridEditorTextBox.TextProperty, _binding); Button b = new Button(); b.Content = "..."; b.Click += B_Click; Grid.SetColumn(textBox, 0); Grid.SetColumn(b, 1); grd.Children.Add(textBox); grd.Children.Add(b); return(grd); }
public AppProject AddProject(string name, string projectPath) { AppProject node = new AppProject(this, name, projectPath); return(node); }