当前位置: 首页>>代码示例>>C#>>正文


C# NodeData类代码示例

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


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

示例1: GetEvent

        public NodeEvent GetEvent(ZWaveNode node, byte[] message)
        {
            //Set up the color values array
            var colordata = node.GetData("ColorValues");
            if (colordata == null) { colordata = new NodeData("ColorValues", new List<ColorValue>()); }
            var colorvals = colordata.Value as List<ColorValue>;
            NodeEvent nodeEvent = null;
            byte cmdType = message[1];
            if (cmdType == (byte)Command.SwitchColorCapabilityReport)
            {
                for (int i = 2; i < 4; i++)
                {
                    for (int j = 0; j < 8; j++)
                    {
                        if ((message[i] & 0x1 << j) > 0)
                        {
                            var colnum = (ZWaveSwitchColorNumber)(8*i+j);
                            var exist = (from val in colorvals
                                         where val.ColorNumber == colnum
                                         select val).FirstOrDefault();
                            if (exist == null) { colorvals.Add(new ColorValue { ColorNumber = colnum, Value = 0 }); }
                            Get(node, 8 * i + j);
                        }
                    }
                }
            }
            else if (cmdType == (byte)Command.SwitchColorReport)
            {

            }
            node.UpdateData("ColorValues", colorvals);
            return nodeEvent;
        }
开发者ID:nyasara,项目名称:zwave-lib-dotnet,代码行数:33,代码来源:SwitchColor.cs

示例2: AddNamespace

 private void AddNamespace(string prefix, string ns)
 {
     this.nsManager.AddNamespace(prefix, ns);
     int length = this.nsAttrCount++;
     if (this.nsAttributes == null)
     {
         this.nsAttributes = new NodeData[this.InitialNamespaceAttributeCount];
     }
     if (length == this.nsAttributes.Length)
     {
         NodeData[] destinationArray = new NodeData[this.nsAttributes.Length * 2];
         Array.Copy(this.nsAttributes, 0, destinationArray, 0, length);
         this.nsAttributes = destinationArray;
     }
     if (this.nsAttributes[length] == null)
     {
         this.nsAttributes[length] = new NodeData();
     }
     if (prefix.Length == 0)
     {
         this.nsAttributes[length].Set(XmlNodeType.Attribute, this.xmlns, string.Empty, this.xmlns, this.xmlnsUri, ns);
     }
     else
     {
         this.nsAttributes[length].Set(XmlNodeType.Attribute, prefix, this.xmlns, base.reader.NameTable.Add(this.xmlns + ":" + prefix), this.xmlnsUri, ns);
     }
     this.state = State.ClearNsAttributes;
     this.curNsAttr = -1;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:29,代码来源:XmlSubtreeReader.cs

示例3: TraverseNode

        void TraverseNode(NodeData nodeData, NodeData parentData)
        {
            if (parentData != null)
            {
                if (parentData.Connector != null)
                {
                    nodeData.Encoding = (parentData.Encoding == string.Empty) ? parentData.Connector.ToString() + nodeData.Connector.ToString() :
                        parentData.Encoding.ToString() + nodeData.Connector;
                }
                else
                {
                    nodeData.Encoding = nodeData.Connector.ToString();
                }
            }

            if ((nodeData.LeftNode == null) && (nodeData.RightNode == null))
            {
                var keyChar = Convert.ToChar(nodeData.Characters);
                if (!_encodingDictionary.ContainsKey(keyChar))
                {
                    nodeData.Encoding = parentData.Encoding + nodeData.Connector.ToString();
                    _encodingDictionary.Add(keyChar, nodeData.Encoding);
                }
            }

            if (!(nodeData.LeftNode == null))
            {
                TraverseNode(nodeData.LeftNode, nodeData);
            }
            if (!(nodeData.RightNode == null))
            {
                TraverseNode(nodeData.RightNode, nodeData);
            }
        }
开发者ID:bhabesh7,项目名称:bhabeshgitprojects,代码行数:34,代码来源:GraphTraversal.cs

示例4: AddNodeEx

 public static BoxL.Box AddNodeEx(this BoxL.Container p, double w, double h, string s)
 {
     var box = p.AddBox(w, h);
     var node_data = new NodeData();
     node_data.Text = s;
     box.Data = node_data;
     return box;
 }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:8,代码来源:BoxLayoutSamples.cs

示例5: Node

 public Node(string prop_name, object val, comparison c)
 {
     data = new NodeData()
     {
         value = val,
         prop = prop_name,
         comp = c
     };
 }
开发者ID:skaliak,项目名称:ExpTrees,代码行数:9,代码来源:Node.cs

示例6: NodeBuilder

 public NodeBuilder(NodeToken token)
 {
     _token = token;
     _token.NodeData = null;
     _data = new NodeData(_token.NodeTypeId, _token.ContentListTypeId)
     {
         IsShared = false,
         SharedData = null,
     };
 }
开发者ID:maxpavlov,项目名称:FlexNet,代码行数:10,代码来源:NodeBuilder.cs

示例7: GetTitle

 public string GetTitle(Node node, RequestContext context)
 {
     var contextData = new NodeData(context);
     if (node.Data == contextData) {
         node.Data.CopyQueryString(context);
         var id = GetId(node.Data, context);
         if (id > 0) {
             return GetTitleInternal(node, id);
         }
     }
     return DefaultTitle;
 }
开发者ID:andreister,项目名称:MvcBreadcrumbs,代码行数:12,代码来源:AbstractTitleProvider.cs

示例8: Decode

    private static ExplorationNode Decode(NodeData data)
    {
        ExplorationNode newNode = new ExplorationNode(data.State.Decode());
        newNode.Id = data.NodeId;
        newNode.PageRank = data.PageRank;
        newNode.InversePageRank = data.InversePageRank;

        StoreMinCuts(newNode, data.MinCutIn, newNode.SetMinCutIn);
        StoreMinCuts(newNode, data.MinCutOut, newNode.SetMinCutOut);

        return newNode;
    }
开发者ID:fgeraci,项目名称:CS195-Core,代码行数:12,代码来源:GraphDecoder.cs

示例9: UpdateVerletSim

    void UpdateVerletSim(NodeData node)
    {
        Vector3 force = (Settings.Gravity * Settings.Mass) * TimeMultiplier * TimeMultiplier;
        Vector3 newPos = node.Position * 2 - node.LastPosition + (force / Settings.Mass) * (Time.deltaTime * Time.deltaTime);

        node.CurrentMoveDir = newPos - node.Position;

        node.LastPosition = node.Position;
        node.Position = node.Position + (node.CurrentMoveDir * (1 - Settings.Damping));

        node.Node.position = node.Position;
    }
开发者ID:Fawcan,项目名称:GameJamVR,代码行数:12,代码来源:ConstraintModule.cs

示例10: XmlSubtreeReader

 internal XmlSubtreeReader(XmlReader reader) : base(reader)
 {
     this.curNsAttr = -1;
     this.InitialNamespaceAttributeCount = 4;
     this.initialDepth = reader.Depth;
     this.state = State.Initial;
     this.nsManager = new XmlNamespaceManager(reader.NameTable);
     this.xmlns = reader.NameTable.Add("xmlns");
     this.xmlnsUri = reader.NameTable.Add("http://www.w3.org/2000/xmlns/");
     this.tmpNode = new NodeData();
     this.tmpNode.Set(XmlNodeType.None, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
     this.SetCurrentNode(this.tmpNode);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:XmlSubtreeReader.cs

示例11: GetId

 private long GetId(NodeData nodeData, RequestContext context)
 {
     long result;
     if (context.RouteData.Values.ContainsKey(IdKey) && context.RouteData.Values[IdKey] != null && long.TryParse(context.RouteData.Values[IdKey].ToString(), out result)) {
         return result;
     }
     if (long.TryParse(context.HttpContext.Request.QueryString.Get(IdKey), out result)) {
         return result;
     }
     if (nodeData.RouteValues.ContainsKey(IdKey) && nodeData.RouteValues[IdKey] != null && long.TryParse(nodeData.RouteValues[IdKey].ToString(), out result)) {
         return result;
     }
     return 0;
 }
开发者ID:andreister,项目名称:MvcBreadcrumbs,代码行数:14,代码来源:AbstractTitleProvider.cs

示例12: CreateNodeDataDependency

        //ContentListTypeId 
        //BinaryPropertyTypeIds 
        internal static CacheDependency CreateNodeDataDependency(NodeData nodeData)
        {
            if (nodeData == null)
                throw new ArgumentNullException("nodeData");

            var aggregateCacheDependency = new System.Web.Caching.AggregateCacheDependency();

            aggregateCacheDependency.Add(
                new NodeIdDependency(nodeData.Id),
                new PathDependency(nodeData.Path),
                //new VersionIdDependency(nodeData.VersionId),
                new NodeTypeDependency(nodeData.NodeTypeId)
                );

            return aggregateCacheDependency;
        }
开发者ID:maxpavlov,项目名称:FlexNet,代码行数:18,代码来源:CacheDependencyFactory.cs

示例13: CreateGraph

        public bool CreateGraph(IDictionary<char, int> uniqueCharacterToFrequencyMap)
        {
            Graph = null;
            Graph = new NodeData();
            _uniqueCharToFreqMapSortedInDesc = uniqueCharacterToFrequencyMap;

            IList<NodeData> firstLevelNodes = new List<NodeData>();
            foreach (var item in _uniqueCharToFreqMapSortedInDesc)
            {
                var newLeafNode = CreateLeafNode(item.Key.ToString(), item.Value);
                //_characterGraph.AddFirst(newLeafNode);
                firstLevelNodes.Add(newLeafNode);
            }

            //var firstLevelNodes = _uniqueCharToFreqMapSortedInDesc.Select(x => x.Value).ToList();
            var isSuccess = TraverseBreadthAndCreateNewCombineNodes(firstLevelNodes);
            
            return isSuccess;
        }
开发者ID:bhabesh7,项目名称:bhabeshgitprojects,代码行数:19,代码来源:GraphCreator.cs

示例14: Load

    public void Load(NodeData data)
    {
        gizmoSize = data.gizmoSize;

        frontControl = data.frontControl;
        backControl = data.backControl;

        trackWidthModifier = data.trackWidthModifier;
        rightCurvature = data.rightCurvature; // between 0 and 1
        leftCurvature = data.leftCurvature; // between 0 and 1

        transform.position = data.position;
        transform.rotation = data.rotation;

        frontTransform.position = data.frontControl;
        backTransform.position = data.backControl;

        reverse = data.reverse;
    }
开发者ID:alejandroSaura,项目名称:ChryslerCarnage,代码行数:19,代码来源:Node.cs

示例15: CountAction

		IEnumerator CountAction (int count)
		{
			// Init

			Debug.Log ("Init counter");

			int current = 0;
			NodeData data = new NodeData ();

			yield return data;

			// Run
			
			while (!data.ShouldReset && ++current <= count)
			{
				Debug.Log (current);

				yield return Running;
			}

			yield return Success;
		}
开发者ID:alfiesyukur,项目名称:PracticalAIinUnity,代码行数:22,代码来源:Example1.cs


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