public void RemoveAllProperties() { AssertCanModify(); properties.Clear(); ChildNodes = ChildNodes.Clear(); NotifyChanged(); }
public void ClearChildren() { foreach (var childNode in ChildNodes) { childNode.ParentNodes.Remove(this); } ChildNodes.Clear(); }
public StatementListNode(NodeArgs args, AstNodeList statements) : base(args) { ChildNodes.Clear(); foreach (AstNode stmt in statements) { AddChild(null, stmt); } }
public void ExpandNode(int level = 0) { this.Expanded = true; if (ChildNodes.Count > 0 && ChildNodes[0] == null) { ChildNodes.Clear(); ParseChildren(Node.ChildNodes, level); } }
public BinExprNode(NodeArgs args, AstNode left, string op, AstNode right) : base(args) { ChildNodes.Clear(); Left = left; AddChild("Arg", Left); Op = op; Right = right; AddChild("Arg", Right); //Flags |= AstNodeFlags.TypeBasedDispatch; }
public CondClauseNode(NodeArgs args, AstNode test, StatementListNode expressions) : base(args) { ChildNodes.Clear(); this.Role = "Clause"; Test = test; Test.Role = "Test"; ChildNodes.Add(Test); Expressions = expressions; Expressions.Role = "Command"; ChildNodes.Add(Expressions); }
/// <summary> /// Removes all the child nodes and/or attributes of /// the current node. /// </summary> public virtual void RemoveAll() { if (null != ChildNodes) { ChildNodes.Clear(); } if (null != Attributes) { Attributes.Clear(); } }
public UnExprNode(NodeArgs args, string op, AstNode arg) : base(args) { ChildNodes.Clear(); Op = op; if (!Op.EndsWith("U")) { Op += "U"; //Unary operations are marked as "+U", "-U", "!U" } Arg = arg; ChildNodes.Add(arg); //Flags |= AstNodeFlags.TypeBasedDispatch; }
public FunctionCallNode(NodeArgs args, VarRefNode name, AstNodeList arguments) : base(args) { ChildNodes.Clear(); NameRef = name; NameRef.Flags |= AstNodeFlags.SuppressNotDefined; AddChild("Name", NameRef); Arguments = arguments; foreach (AstNode arg in Arguments) { AddChild("Arg", arg); } }//constructor
public override void Prepare() { Expression <Func <IElement> > refs = Root.ApplySharpView(); Func <IElement> compiled = refs.Compile(); IElement result = compiled(); if (result != this && (result != null && (result.TagName != null || result.ChildNodes.Count > 0))) { ChildNodes.Clear(); ChildNodes.Add(result); } }
/// <summary> /// 清空所有子项 /// 注意该方法会删除子节点 /// </summary> public void Clear() { foreach (var item in ChildNodes) { item.DeleteObject(); } ChildNodes.Clear(); IsExpand = _isExpand; if (StateChangedHandle != null) { StateChangedHandle(); } }
public AnonFunctionNode(NodeArgs args, AstNode parameters, AstNode body) : base(args) { ChildNodes.Clear(); Parameters = parameters; AddChild("Params", Parameters); Body = body; AddChild("Body", Body); foreach (VarRefNode prm in Parameters.ChildNodes) { prm.Flags |= AstNodeFlags.AllocateSlot; } BindingInfo = new FunctionBindingInfo(null, Parameters.ChildNodes.Count, this.Body.Evaluate, this, FunctionFlags.IsLocal); }
void LoadFromXml(MSBuildXmlReader reader) { AssertCanModify(); DisposeMainInstance(); ChildNodes = ChildNodes.Clear(); conditionedProperties = new ConditionedPropertyCollection(); bestGroups = null; hadXmlDeclaration = false; initialWhitespace = null; StartInnerWhitespace = null; while (!reader.EOF && reader.NodeType != XmlNodeType.Element) { if (reader.NodeType == XmlNodeType.XmlDeclaration) { initialWhitespace = reader.ConsumeWhitespace(); hadXmlDeclaration = true; reader.Read(); } else if (reader.IsWhitespace) { reader.ReadAndStoreWhitespace(); } else { reader.Read(); } } if (reader.EOF) { return; } Read(reader); while (!reader.EOF) { if (reader.IsWhitespace) { reader.ReadAndStoreWhitespace(); } else { reader.Read(); } } }
public CondFormNode(NodeArgs args, AstNodeList clauses, AstNode elseClause) : base(args) { ChildNodes.Clear(); Clauses = clauses; foreach (AstNode clause in clauses) { clause.Role = "Arg"; ChildNodes.Add(clause); } ElseClause = elseClause; if (ElseClause != null) { ElseClause.Role = "else"; ChildNodes.Add(ElseClause); } }
public AssigmentNode(NodeArgs args, AstNode lvalue, AstNode expression) : base(args) { ChildNodes.Clear(); var Identifier = lvalue as VarRefNode; if (Identifier == null) { args.Context.ReportError(lvalue.Location, "Expected identifier."); return; } Identifier.Flags |= AstNodeFlags.AllocateSlot | AstNodeFlags.NotRValue; Identifier.Access = AccessType.Write; AddChild("Name", Identifier); Expression = expression; AddChild("Expr", Expression); }
public AssigmentNode(NodeArgs args, AstNode id, AstNode expression) : base(args) { ChildNodes.Clear(); Identifier = id as VarRefNode; if (Identifier == null) //id might be a simple token { Identifier = new VarRefNode(args, id); } if (Identifier == null && id is Token) { args.Context.ReportError(id.Location, "Expected identifier."); } Identifier.Flags |= AstNodeFlags.AllocateSlot | AstNodeFlags.NotRValue; Identifier.Access = AccessType.Write; AddChild("Name", Identifier); Expression = expression; AddChild("Expr", Expression); }
public override void GetChildNodes() { if (!String.IsNullOrEmpty(FullPath)) { ChildNodes.Clear(); string[] directories = Directory.GetDirectories(FullPath); foreach (string directory in directories) { try { string folder = Path.Combine(FullPath, directory); DirectoryInfo info = new DirectoryInfo(folder); if ((info.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden) { DirectoryTreeNode node = new DirectoryTreeNode(Path.GetFileName(directory), directory, TreeView); node.Level = Level + 1; node.TreeView = TreeView; TreeView.CheckedNodeChanged += new EventHandler <TreeNodeEventArgs>(TreeView_OnCheckedNodeChanged); node.HasChildNodes = (Directory.GetDirectories(node.FullPath).Length > 0); ChildNodes.Add(node); } } catch (UnauthorizedAccessException ex) { Debug.WriteLine(ex); } catch (DriveNotFoundException ex) { Debug.WriteLine(ex); } catch (IOException ex) { Debug.WriteLine(ex); } } HasChildNodes = (ChildNodes.Count > 0); } base.GetChildNodes(); }
public IfNode(NodeArgs args, AstNode test, AstNode ifTrue, AstNode ifFalse) : base(args) { ChildNodes.Clear(); Test = test; AddChild("Test", Test); IfTrue = ifTrue; if (IfTrue.IsEmpty()) { IfTrue = null; } AddChild("IfTrue", IfTrue); IfFalse = ifFalse; if (IfFalse.IsEmpty()) { IfFalse = null; } AddChild("IfFalse", IfFalse); }
public override void GetChildNodes() { if (!String.IsNullOrEmpty(FullPath)) { ChildNodes.Clear(); string[] directories = Directory.GetDirectories(FullPath); foreach (string directory in directories) { try { DirectoryTreeNode node = new DirectoryTreeNode(Path.GetFileName(directory), directory, TreeView); node.Level = Level + 1; node.TreeView = TreeView; TreeView.CheckedNodeChanged += new EventHandler <TreeNodeEventArgs>(TreeView_OnCheckedNodeChanged); node.HasChildNodes = (Directory.GetDirectories(node.FullPath).Length > 0); ChildNodes.Add(node); } catch (UnauthorizedAccessException ex) { OMLApplication.DebugLine("[DirectoryTreeNode] " + ex.Message); } catch (DriveNotFoundException ex) { OMLApplication.DebugLine("[DirectoryTreeNode] " + ex.Message); } catch (IOException ex) { OMLApplication.DebugLine("[DirectoryTreeNode] " + ex.Message); } } HasChildNodes = (ChildNodes.Count > 0); } base.GetChildNodes(); }
public VarRefNode(NodeArgs args, string name) : base(args) { ChildNodes.Clear(); Name = name; }
/// <summary>子ノードを全て削除する。</summary> /// <returns>現在のノード</returns> public TNode ClearChildren() { ChildNodes.Clear(); return(self); }
public void Clear() { ChildNodes.ForEach(o => o.Dispose()); ChildNodes.Clear(); }
private void InitializeDomDocument() { ChildNodes.Clear(); SelectorXref.Clear(); OriginalStrings = new List <Tuple <int, int> >(); }
public VarRefNode(NodeArgs args, AstNode idNode) : base(args) { ChildNodes.Clear(); Name = GetContent(idNode); }
/// <summary> /// 清空所有节点数据 /// </summary> public void Clear() { Values.Clear(); ChildNodes.Clear();//主要清空这个 }
/// <summary> /// Clears all the objects in this instance. /// </summary> public void Clear() { ChildNodes.Clear(); }
public override void GetChildNodes() { if (!String.IsNullOrEmpty(FullPath)) { ChildNodes.Clear(); string[] directories = Directory.GetDirectories(FullPath); string[] files = FileTreeNode.GetFiles(FullPath, Filter); foreach (string directory in directories) { try { string folder = Path.Combine(FullPath, directory); DirectoryInfo info = new DirectoryInfo(folder); if ((info.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden) { FileTreeNode node = new FileTreeNode(Path.GetFileName(directory), directory, Filter, TreeView); node.Level = Level + 1; node.TreeView = TreeView; node.Selectable = false; TreeView.CheckedNodeChanged += new EventHandler <TreeNodeEventArgs>(TreeView_OnCheckedNodeChanged); node.HasChildNodes = ((Directory.GetDirectories(node.FullPath).Length > 0) || (FileTreeNode.GetFiles(node.FullPath, Filter).Length > 0)); ChildNodes.Add(node); } } catch (UnauthorizedAccessException ex) { Debug.WriteLine(ex); } catch (DriveNotFoundException ex) { Debug.WriteLine(ex); } catch (IOException ex) { Debug.WriteLine(ex); } } foreach (string thefile in files) { try { string hfile = Path.Combine(FullPath, thefile); FileInfo info = new FileInfo(hfile); if ((info.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden) { FileTreeNode node = new FileTreeNode(Path.GetFileName(thefile), thefile, Filter, TreeView); node.Level = Level + 1; node.TreeView = TreeView; node.NodeColor = new Color(Colors.YellowGreen); TreeView.CheckedNodeChanged += new EventHandler <TreeNodeEventArgs>(TreeView_OnCheckedNodeChanged); node.HasChildNodes = false; ChildNodes.Add(node); } } catch (UnauthorizedAccessException ex) { Debug.WriteLine(ex); } catch (DriveNotFoundException ex) { Debug.WriteLine(ex); } catch (IOException ex) { Debug.WriteLine(ex); } } HasChildNodes = (ChildNodes.Count > 0); } base.GetChildNodes(); }