本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例5: Node
public Node(string prop_name, object val, comparison c)
{
data = new NodeData()
{
value = val,
prop = prop_name,
comp = c
};
}
示例6: NodeBuilder
public NodeBuilder(NodeToken token)
{
_token = token;
_token.NodeData = null;
_data = new NodeData(_token.NodeTypeId, _token.ContentListTypeId)
{
IsShared = false,
SharedData = null,
};
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}