• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# NodeList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中NodeList的典型用法代码示例。如果您正苦于以下问题:C# NodeList类的具体用法?C# NodeList怎么用?C# NodeList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NodeList类属于命名空间,在下文中一共展示了NodeList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Ruleset

 protected Ruleset(NodeList<Selector> selectors, NodeList rules, Ruleset originalRuleset)
     : this()
 {
     Selectors = selectors;
     Rules = rules;
     OriginalRuleset = originalRuleset ?? this;
 }
开发者ID:chrisortman,项目名称:dotless,代码行数:7,代码来源:Ruleset.cs


示例2: Expression

 public Expression(IEnumerable<Node> value)
 {
     if(value is NodeList)
         Value = value as NodeList;
     else
         Value = new NodeList(value);
 }
开发者ID:nlerikheemskerk,项目名称:cassette,代码行数:7,代码来源:Expression.cs


示例3: Build

        public void Build()
        {
            NodeList<BuildAction> roots = new NodeList<BuildAction>();
            NodeList<BuildAction> allgames = new NodeList<BuildAction>();
            foreach (var replay in m_replays)
            {
                foreach (var player in replay.Players)
                {
                    var actions = replay.Actions.Where(x => x.Player == player
                                                && x.ActionType == Entities.ActionType.Build)
                                                .OrderBy(y => y.Sequence)
                                                .Cast<BuildAction>();

                    if (actions.Count() > 0)
                    {
                        BuildAction action = actions.ElementAt(0);
                        Node<BuildAction> node = new Node<BuildAction>(1, action, buildTree(actions));
                        allgames.Add(node);

                        if (roots.Where(x => x.Value.ObjectType == action.ObjectType).Count() == 0)
                        {
                            roots.Add(node);
                        }
                    }
                }
            }

            countOccurances(roots, allgames);
            m_roots = roots;
            m_allGames = allgames;
        }
开发者ID:Excolo,项目名称:SCReplayFileParser,代码行数:31,代码来源:TreeBuilder.cs


示例4: CartoSelector

    public CartoSelector(IEnumerable<Element> elements, Env env)
      : base(elements)
    {
      m_filters = new CartoFilterSet();
      m_zooms = new NodeList<CartoZoomElement>();
      m_elements = new NodeList<CartoElement>();

      m_conditions = 0;
      if (env == null)
      	env = new Env(); // TODO
      
      foreach (Element elem in elements)
      {
        if (elem is CartoFilterElement)
        {
          m_filters.Add(elem as CartoFilterElement, env);
          m_conditions++;
        }
        else if (elem is CartoZoomElement)
        {
          m_zooms.Add(elem as CartoZoomElement);
          m_conditions++;
        }
        else if (elem is CartoAttachmentElement)
          m_attachment = (elem as CartoAttachmentElement).Value;
        else
          m_elements.Add((CartoElement)elem);
      }
    }
开发者ID:Rungee,项目名称:MapSurfer.NET-CartoCSS,代码行数:29,代码来源:CartoSelector.cs


示例5: AStar

    public AStar(int width, int height)
    {
        w = width;
        h = height;

        //MAKE THE ARRAY OF COORDINATES SO THAT WE SEARCH THEM IN THE RIGHT ORDER
        coords = new System.Collections.Generic.List<Vector2>();
        coords.Add(new Vector2(0,-1)); // UP
        coords.Add(new Vector2(1,0)); // RIGHT
        coords.Add(new Vector2(0,1)); // DOWN
        coords.Add(new Vector2(-1,0)); // LEFT

        if(allowDiagonals)
        {
            coords.Add(new Vector2(-1,-1)); // UP-LEFT
            coords.Add(new Vector2(1,-1)); // UP-RIGHT
            coords.Add(new Vector2(1,1)); // DOWN-RIGHT
            coords.Add(new Vector2(-1,1)); // DOWNLEFT
        }

        relCurrent = new Vector2();
        relLast = new Vector2();

        startNode = new GridNode();
        endNode = new GridNode();

        open = new NodeList(w*h);
        closed = new NodeList(w*h);

        createGrid(w,h);

        r = new RandomSeed(THE_SEED);
    }
开发者ID:snotwadd20,项目名称:UnityLevelGen,代码行数:33,代码来源:AStar.cs


示例6: ResourceNode

 public ResourceNode(Game game, NodeList subNode, String name, ResourceNodeType type = ResourceNodeType.MESH)
 {
     m_game = game;
     m_subNodes = subNode;
     m_name = name;
     m_type = type;
 }
开发者ID:DelBero,项目名称:XnaScrap,代码行数:7,代码来源:ResourceNode.cs


示例7: StartStep

            public override PropertyTreeMetaObject StartStep(PropertyTreeMetaObject target, PropertyTreeNavigator self, NodeList children)
            {
                Predicate<PropertyTreeNavigator> predicate = ImplicitDirective(target, "source");

                var node = children.FindAndRemove(predicate).FirstOrDefault();
                if (node != null) {
                    IServiceProvider serviceProvider = Parent.GetBasicServices(node);
                    var uriContext = node as IUriContext;
                    TargetSourceDirective ss;
                    ss = this.DirectiveFactory.CreateTargetSource(node, uriContext);

                    if (ss != null) {
                        try {
                            target = target.BindStreamingSource(ss, serviceProvider);
                        } catch (Exception ex) {
                            if (ex.IsCriticalException())
                                throw;

                            Parent.errors.FailedToLoadFromSource(ss.Uri, ex, node.FileLocation);
                        }
                    }
                }

                return target;
            }
开发者ID:Carbonfrost,项目名称:ff-property-trees,代码行数:25,代码来源:ApplyStreamingSourcesStep.cs


示例8: LoopNode

 public LoopNode(string initExpression, string iterExpression, string testExpression, NodeList nodes)
 {
     m_initExpression = initExpression;
     m_iterExpression = iterExpression;
     m_testExpression = testExpression;
     m_nodes.AddRange(nodes);
 }
开发者ID:remcovanreij,项目名称:liteflow,代码行数:7,代码来源:LoopNode.cs


示例9: Module

        private NodeList SiteList; //List containing sites for this module

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Create a new module
        /// </summary>
        public Module()
        {
            //Initialize list containers
            SiteList = new NodeList();
            ImportList = new NodeList();
            FunctionDefinitionList = new NodeList();
        }
开发者ID:spreeker,项目名称:waebric,代码行数:16,代码来源:Module.cs


示例10: Main

 static void Main(string[] args)
 {
     for (int i = 0; i < 20; i++)
     {
         NodeList nodeList = new NodeList(20, 80, 15, 100, 100);
         AlgorithmFunction.AlgorithmPreparation(nodeList, 15);
         ////质心算法
         //AlgorithmFunction.CenterOfMass_algorithm(nodeList, 1);
         //DataExport.DataExportToExcel(nodeList, @"d:/COM.xls");
         ////DV-Hop算法
         List<Node> generalNodeList = nodeList.GetAllGeneralNode();
         foreach (GeneralNode gn in generalNodeList)
         {
             gn.EstimatedX = gn.EstimatedY = 0d;
             gn.IsLocatable = gn.IsAlreadyLocated = false;
         }
         AlgorithmFunction.DV_Hop_algorithm(nodeList);
         DataExport.DataExportToExcel(nodeList, @"d:/DV-Hop.xls");
         //Revised DV-Hop算法
         foreach (GeneralNode gn in generalNodeList)
         {
             gn.EstimatedX = gn.EstimatedY = 0d;
             gn.IsLocatable = gn.IsAlreadyLocated = false;
         }
         AlgorithmFunction.Revised_DV_Hop_algorithm(nodeList, 5);
         DataExport.DataExportToExcel(nodeList, @"d:/Revised-DV-Hop.xls");
     }
     Console.WriteLine("==========Done==========");
     Console.ReadKey();
 }
开发者ID:unclechao,项目名称:Revised-DV-Hop-algorithm,代码行数:30,代码来源:Program.cs


示例11: StartStep

            public override PropertyTreeMetaObject StartStep(
                PropertyTreeMetaObject target,
                PropertyTreeNavigator self,
                NodeList children)
            {
                if (!(target is UntypedToTypedMetaObject))
                    return target;

                if (!children.Any())
                    return target;

                try {
                    // TODO Only supports one child (lame spec)
                    var rootType = target.Root.ComponentType;
                    var types = children.Select(t => ConvertToType(t, rootType)).ToArray();

                    target = target.BindGenericParameters(types);

                } catch (Exception ex) {
                    if (ex.IsCriticalException())
                        throw;

                    Parent.errors.CouldNotBindGenericParameters(target.ComponentType, ex, self.FileLocation);
                }

                Parent.Bind(target, children.First(), null);
                children.Clear();
                return target;
            }
开发者ID:Carbonfrost,项目名称:ff-property-trees,代码行数:29,代码来源:ApplyGenericParametersStep.cs


示例12: OrderByClause

 /// <summary>
 ///     Initializes order by clause.
 /// </summary>
 internal OrderByClause(NodeList<OrderByClauseItem> orderByClauseItem, Node skipExpr, Node limitExpr, uint methodCallCount)
 {
     _orderByClauseItem = orderByClauseItem;
     _skipExpr = skipExpr;
     _limitExpr = limitExpr;
     _methodCallCount = methodCallCount;
 }
开发者ID:christiandpena,项目名称:entityframework,代码行数:10,代码来源:OrderByClause.cs


示例13: CenterOfMass_algorithm

 /// <summary>
 /// 质心算法
 /// </summary>
 /// <param name="nodeList"></param>
 /// <param name="j">质心算法中取j跳范围内的信标节点帮助计算</param>
 public static void CenterOfMass_algorithm(NodeList nodeList, int j)
 {
     List<Node> generalNodeList = nodeList.GetAllGeneralNode();
     foreach (GeneralNode gn in generalNodeList)
     {
         //循环,进行定位
         List<Node> AssistLocateNodeList = new List<Node>();
         //将信标节点加入到协助定位的节点列表中
         foreach (int nodeId in gn.HopCountTable.Keys)
         {
             if (nodeList.GetNodeById(nodeId).IsBeaconNode && gn.HopCountTable[nodeId] <= j)
             {
                 AssistLocateNodeList.Add(nodeList.GetNodeById(nodeId));
             }
         }
         if (AssistLocateNodeList.Count >= 1)
         {
             double sumEstimatedX = 0d;
             double sumEstimatedY = 0d;
             foreach (BeaconNode bn in AssistLocateNodeList)
             {
                 sumEstimatedX += bn.RealX;
                 sumEstimatedY += bn.RealY;
             }
             gn.IsLocatable = true;
             gn.IsAlreadyLocated = true;
             gn.EstimatedX = sumEstimatedX / AssistLocateNodeList.Count;
             gn.EstimatedY = sumEstimatedY / AssistLocateNodeList.Count;
         }
     }
 }
开发者ID:unclechao,项目名称:Revised-DV-Hop-algorithm,代码行数:36,代码来源:AlgorithmFunction.cs


示例14: MethodExpr

 /// <summary>
 ///     Initializes method ast node.
 /// </summary>
 internal MethodExpr(
     Node expr,
     DistinctKind distinctKind,
     NodeList<Node> args)
     : this(expr, distinctKind, args, null)
 {
 }
开发者ID:junxy,项目名称:entityframework,代码行数:10,代码来源:MethodExpr.cs


示例15: Cluster

        public void Cluster(int k, NodeList<BuildAction> observations)
        {
            // Use random observations as centroids
            //List<Centroid> centroids = initialCentroidRandom(k, observations);
            List<Centroid> centroids = initialCentroidReasonable(observations); // OBS! Ignores k
            foreach (Centroid c in centroids)
                observations.Remove(c.Value);

            assignToCentroid(observations, centroids);

            // TODO: Check if stability has occured instead
            // Im tired, no moar coffee....
            for (int i = 0; i < 3; i++)
            {
                centroids = iterate(centroids);
                assignToCentroid(observations, centroids);
            }

            foreach (var c in centroids)
            {
                var err = c.Observations.Where(x => x.Value.ObjectType != c.Value.Value.ObjectType);
                System.Console.WriteLine("Error count: " + err.Count());
            }

            m_clusters = centroids;
        }
开发者ID:Excolo,项目名称:SCReplayFileParser,代码行数:26,代码来源:Kmeans.cs


示例16: AlgorithmPreparation

 /// <summary>
 /// 算法准备阶段
 /// </summary>
 /// <param name="nodeList"></param>
 /// <param name="count"></param>
 public static void AlgorithmPreparation(NodeList nodeList, int count)
 {
     //取得节点的邻居节点
     nodeList.GetNeighbourNode(nodeList);
     //得到网络节点的跳数
     nodeList.GetNodeAllHop(nodeList, count);
 }
开发者ID:unclechao,项目名称:Revised-DV-Hop-algorithm,代码行数:12,代码来源:AlgorithmFunction.cs


示例17: Node

 /// <summary>
 /// Constructs a new node.
 /// </summary>
 internal Node(String name, NodeType type = NodeType.Element, NodeFlags flags = NodeFlags.None)
 {
     _name = name ?? String.Empty;
     _type = type;
     _children = new NodeList();
     _flags = flags;
 }
开发者ID:jogibear9988,项目名称:AngleSharp,代码行数:10,代码来源:Node.cs


示例18: Evaluate

            public override Node Evaluate(Env env)
            {
                foreach (var frame in env.Frames)
                {
                  NodeList mixins;
                  if ((mixins = frame.Find(Selector, null)).Count == 0)
                continue;

                  var rules = new NodeList();
                  foreach (var node in mixins)
                  {
                if(!(node is Ruleset))
                  continue;

                var ruleset = node as Ruleset;

                if(!ruleset.MatchArguements(Arguments, env))
                  continue;

                if (node is Mixin.Definition)
                {
                  var mixin = node as Mixin.Definition;
                  rules.AddRange(mixin.Evaluate(Arguments, env).Rules);
                }
                else
                {
                  if (ruleset.Rules != null)
                rules.AddRange(ruleset.Rules);
                }
                // todo fix for other Ruleset types?
                  }
                  return rules;
                }
                throw new ParsingException(Selector.ToCSS().Trim() + " is undefined");
            }
开发者ID:JasonCline,项目名称:dotless,代码行数:35,代码来源:Mixin.cs


示例19: Parse

 /// <summary>
 /// Parse node contents add return a fresh node.
 /// </summary>
 /// <param name="prototypes">List containing all node types</param>
 /// <param name="parent">Node that this is a subnode to. Can be null</param>
 /// <param name="line">Line to parse</param>
 /// <param name="offset">Where to start the parsing. Should be set to where the next node should start parsing.</param>
 /// <returns>A node corresponding to the bla bla; null if parsing failed.</returns>
 /// <exception cref="Exceptions.CodeGeneratorException"></exception>
 public override Node Parse(NodeList prototypes, Node parent, LineInfo line, ref int offset)
 {
     offset = line.Data.Length;
     return new DocTypeTag(
         @"<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Strict//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"">".Replace("\"", "\"\""),
         parent);
 }
开发者ID:Horlos,项目名称:web-server,代码行数:16,代码来源:DocTypeTag.cs


示例20: StartStep

            public override PropertyTreeMetaObject StartStep(PropertyTreeMetaObject target, PropertyTreeNavigator self, NodeList children)
            {
                foreach (var child in children.Rest()) {

                    string msg;
                    if (target.ComponentType.IsHiddenUX()) {
                        msg = SR.BinderMissingPropertyNoType(child.QualifiedName);
                    } else {
                        msg = SR.BinderMissingProperty(child.QualifiedName, target.ComponentType);
                    }

                    try {
                        var info = new InterfaceUsageInfo(InterfaceUsage.Missing, msg, null, true);
                        Parent.Callback.OnPropertyAnnotation(child.QualifiedName.ToString(), info);

                    } catch (Exception ex) {
                        if (ex.IsCriticalException())
                            throw;

                        throw PropertyTreesFailure.UnmatchedMembersGenericError(ex, child.FileLocation);
                    }
                }

                return target;
            }
开发者ID:Carbonfrost,项目名称:ff-property-trees,代码行数:25,代码来源:ErrorUnmatchedMembersStep.cs



注:本文中的NodeList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NodeLocation类代码示例发布时间:2022-05-24
下一篇:
C# NodeInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap