コード例 #1
0
 public void RemoveAllProperties()
 {
     AssertCanModify();
     properties.Clear();
     ChildNodes = ChildNodes.Clear();
     NotifyChanged();
 }
コード例 #2
0
 public void ClearChildren()
 {
     foreach (var childNode in ChildNodes)
     {
         childNode.ParentNodes.Remove(this);
     }
     ChildNodes.Clear();
 }
コード例 #3
0
 public StatementListNode(NodeArgs args, AstNodeList statements) : base(args)
 {
     ChildNodes.Clear();
     foreach (AstNode stmt in statements)
     {
         AddChild(null, stmt);
     }
 }
コード例 #4
0
 public void ExpandNode(int level = 0)
 {
     this.Expanded = true;
     if (ChildNodes.Count > 0 && ChildNodes[0] == null)
     {
         ChildNodes.Clear();
         ParseChildren(Node.ChildNodes, level);
     }
 }
コード例 #5
0
 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;
 }
コード例 #6
0
 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);
 }
コード例 #7
0
ファイル: HtmlNode.cs プロジェクト: minskowl/MY
 /// <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();
     }
 }
コード例 #8
0
 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;
 }
コード例 #9
0
 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
コード例 #10
0
        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);
            }
        }
コード例 #11
0
 /// <summary>
 /// 清空所有子项
 /// 注意该方法会删除子节点
 /// </summary>
 public void Clear()
 {
     foreach (var item in ChildNodes)
     {
         item.DeleteObject();
     }
     ChildNodes.Clear();
     IsExpand = _isExpand;
     if (StateChangedHandle != null)
     {
         StateChangedHandle();
     }
 }
コード例 #12
0
 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);
 }
コード例 #13
0
ファイル: MSBuildProject.cs プロジェクト: sim756/monodevelop
        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();
                }
            }
        }
コード例 #14
0
 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);
     }
 }
コード例 #15
0
        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);
        }
コード例 #16
0
 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);
 }
コード例 #17
0
        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();
        }
コード例 #18
0
ファイル: IfNode.cs プロジェクト: yuva2achieve/SharpDevelop
        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);
        }
コード例 #19
0
        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();
        }
コード例 #20
0
 public VarRefNode(NodeArgs args, string name) : base(args)
 {
     ChildNodes.Clear();
     Name = name;
 }
コード例 #21
0
 /// <summary>子ノードを全て削除する。</summary>
 /// <returns>現在のノード</returns>
 public TNode ClearChildren()
 {
     ChildNodes.Clear();
     return(self);
 }
コード例 #22
0
 public void Clear()
 {
     ChildNodes.ForEach(o => o.Dispose());
     ChildNodes.Clear();
 }
コード例 #23
0
ファイル: DomDocument.cs プロジェクト: mburgman101/CsQuery
 private void InitializeDomDocument()
 {
     ChildNodes.Clear();
     SelectorXref.Clear();
     OriginalStrings = new List <Tuple <int, int> >();
 }
コード例 #24
0
 public VarRefNode(NodeArgs args, AstNode idNode) : base(args)
 {
     ChildNodes.Clear();
     Name = GetContent(idNode);
 }
コード例 #25
0
 /// <summary>
 /// 清空所有节点数据
 /// </summary>
 public void Clear()
 {
     Values.Clear();
     ChildNodes.Clear();//主要清空这个
 }
コード例 #26
0
 /// <summary>
 ///   Clears all the objects in this instance.
 /// </summary>
 public void Clear()
 {
     ChildNodes.Clear();
 }
コード例 #27
0
        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();
        }