public override ITreeConfigNode NodeAddNew() { var node = new GroupListConstants(this.Parent); (this.Parent as GroupConstantGroups).ListConstantGroups.Add(node); this.GetUniqueName(Defaults.ConstantsGroupName, node, (this.Parent as GroupConstantGroups).ListConstantGroups); this.SetSelected(node); return(node); }
public override ITreeConfigNode NodeAddClone() { var node = GroupListConstants.Clone(this.Parent, this, true, true); node.Parent = this.Parent; (this.Parent as GroupConstantGroups).ListConstantGroups.Add(node); this._Name = this._Name + "2"; this.SetSelected(node); return(node); }
public GroupListConstants AddGroupConstants(string name) { var node = new GroupListConstants(this) { Name = name }; this.NodeAddNewSubNode(node); return(node); }
public override ITreeConfigNode NodeAddNewSubNode(ITreeConfigNode node_impl = null) { GroupListConstants node = null; if (node_impl == null) { node = new GroupListConstants(this); } else { node = (GroupListConstants)node_impl; } this.ListConstantGroups.Add(node); if (node_impl == null) { this.GetUniqueName(Defaults.ConstantsGroupName, node, this.ListConstantGroups); } this.SetSelected(node); return(node); }
private bool IsUnique(Constant val) { if (val.Parent == null) { return(true); } if (string.IsNullOrWhiteSpace(val.Name)) // handled by another rule { return(true); } GroupListConstants p = (GroupListConstants)val.Parent; foreach (var t in p.ListConstants) { if ((val.Guid != t.Guid) && (val.Name == t.Name)) { return(false); } } return(true); }