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

C# NodeData类代码示例

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

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



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


示例16: Run

		protected IEnumerator Run (ExecutionMode mode)
		{
			WaitForSeconds frameDelay = new WaitForSeconds (1.0f / Frequency);

			do
			{
				// Start running the tree root - grabbing its node data yielded on the init frame
				IEnumerator rootRoutine = Root ();
				rootRoutine.MoveNext ();
				m_RootData = rootRoutine.Current as NodeData;

				// Keep running until we're disabled
				while (Application.isPlaying && enabled)
				{
					// Break out if the root was reset
					if (m_RootData != null && m_RootData.ShouldReset)
					{
						break;
					}

					// Break out if the tree breaks or completes with success or failure
					if (!rootRoutine.MoveNext () || Success.Equals (rootRoutine.Current) || Failure.Equals (rootRoutine.Current))
					{
						break;
					}

					yield return frameDelay;
				}

				// Reset the root
				if (m_RootData != null)
				{
					m_RootData.Reset ();
					rootRoutine.MoveNext ();
				}
			}
			while (mode == ExecutionMode.Continuous && Application.isPlaying && enabled);
		}
开发者ID:alfiesyukur,项目名称:PracticalAIinUnity,代码行数:38,代码来源:CoroutineTree.cs


示例17: radioButtonActWindow_Click

 private void radioButtonActWindow_Click(object sender, EventArgs e)
 {
   comboBoxCmdProperty.DropDownStyle = ComboBoxStyle.DropDownList;
   comboBoxSound.Enabled = true;
   comboBoxCmdProperty.Enabled = true;
   var node = getNode("COMMAND");
   var data = new NodeData("COMMAND", "WINDOW", "0");
   node.Tag = data;
   UpdateCombo(ref comboBoxCmdProperty, windowsListFiltered,
     GetFriendlyName(Enum.GetName(typeof (GUIWindow.Window), Convert.ToInt32(data.Value))));
   node.Text = "Window \"" + (string) comboBoxCmdProperty.SelectedItem + "\"";
   ((NodeData) node.Tag).Focus = checkBoxGainFocus.Checked;
   changedSettings = true;
 }
开发者ID:MediaPortal,项目名称:MediaPortal-1,代码行数:14,代码来源:HidInputMappingForm.cs


示例18: radioButtonAction_Click

 private void radioButtonAction_Click(object sender, EventArgs e)
 {
   textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = false;
   textBoxKeyChar.Text = textBoxKeyCode.Text = string.Empty;
   comboBoxCmdProperty.DropDownStyle = ComboBoxStyle.DropDownList;
   comboBoxSound.Enabled = true;
   comboBoxCmdProperty.Enabled = true;
   var node = getNode("COMMAND");
   var data = new NodeData("COMMAND", "ACTION", "7");
   node.Tag = data;
   UpdateCombo(ref comboBoxCmdProperty, actionList,
     GetFriendlyName(Enum.GetName(typeof (Action.ActionType), Convert.ToInt32(data.Value))));
   node.Text = "Action \"" + (string) comboBoxCmdProperty.SelectedItem + "\"";
   ((NodeData) node.Tag).Focus = checkBoxGainFocus.Checked;
   changedSettings = true;
 }
开发者ID:MediaPortal,项目名称:MediaPortal-1,代码行数:16,代码来源:HidInputMappingForm.cs


示例19: AddDefaultAttributeDtd

        private bool AddDefaultAttributeDtd(IDtdDefaultAttributeInfo defAttrInfo, bool definedInDtd, NodeData[] nameSortedNodeData)
        {
            if (defAttrInfo.Prefix.Length > 0)
            {
                _attrNeedNamespaceLookup = true;
            }

            string localName = defAttrInfo.LocalName;
            string prefix = defAttrInfo.Prefix;

            // check for duplicates
            if (nameSortedNodeData != null)
            {
                if (Array.BinarySearch<object>(nameSortedNodeData, defAttrInfo, DtdDefaultAttributeInfoToNodeDataComparer.Instance) >= 0)
                {
                    return false;
                }
            }
            else
            {
                for (int i = _index + 1; i < _index + 1 + _attrCount; i++)
                {
                    if ((object)_nodes[i].localName == (object)localName &&
                        (object)_nodes[i].prefix == (object)prefix)
                    {
                        return false;
                    }
                }
            }

            NodeData attr = AddDefaultAttributeInternal(defAttrInfo.LocalName, null, defAttrInfo.Prefix, defAttrInfo.DefaultValueExpanded,
                                                         defAttrInfo.LineNumber, defAttrInfo.LinePosition,
                                                         defAttrInfo.ValueLineNumber, defAttrInfo.ValueLinePosition, defAttrInfo.IsXmlAttribute);

            Debug.Assert(attr != null);

            if (DtdValidation)
            {
                if (_onDefaultAttributeUse != null)
                {
                    _onDefaultAttributeUse(defAttrInfo, this);
                }
                attr.typedValue = defAttrInfo.DefaultValueTyped;
            }
            return attr != null;
        }
开发者ID:chcosta,项目名称:corefx,代码行数:46,代码来源:XmlTextReaderImpl.cs


示例20: AddNamespace

        private void AddNamespace(string prefix, string uri, NodeData attr)
        {
            if (uri == XmlReservedNs.NsXmlNs)
            {
                if (Ref.Equal(prefix, _xmlNs))
                {
                    Throw(SR.Xml_XmlnsPrefix, (int)attr.lineInfo2.lineNo, (int)attr.lineInfo2.linePos);
                }
                else
                {
                    Throw(SR.Xml_NamespaceDeclXmlXmlns, prefix, (int)attr.lineInfo2.lineNo, (int)attr.lineInfo2.linePos);
                }
            }
            else if (uri == XmlReservedNs.NsXml)
            {
                if (!Ref.Equal(prefix, _xml) && !_v1Compat)
                {
                    Throw(SR.Xml_NamespaceDeclXmlXmlns, prefix, (int)attr.lineInfo2.lineNo, (int)attr.lineInfo2.linePos);
                }
            }
            if (uri.Length == 0 && prefix.Length > 0)
            {
                Throw(SR.Xml_BadNamespaceDecl, (int)attr.lineInfo.lineNo, (int)attr.lineInfo.linePos);
            }

            try
            {
                _namespaceManager.AddNamespace(prefix, uri);
            }
            catch (ArgumentException e)
            {
                ReThrow(e, (int)attr.lineInfo.lineNo, (int)attr.lineInfo.linePos);
            }
#if DEBUG
            if (prefix.Length == 0)
            {
                Debug.Assert(_xmlContext.defaultNamespace == uri);
            }
#endif
        }
开发者ID:chcosta,项目名称:corefx,代码行数:40,代码来源:XmlTextReaderImpl.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# NodeFactory类代码示例发布时间:2022-05-24
下一篇:
C# NodeContainer类代码示例发布时间: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