本文整理汇总了C#中NodeType类的典型用法代码示例。如果您正苦于以下问题:C# NodeType类的具体用法?C# NodeType怎么用?C# NodeType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NodeType类属于命名空间,在下文中一共展示了NodeType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NetworkNode
/// <summary>
/// Constructs with the provided node ID, type and activation function ID.
/// </summary>
public NetworkNode(uint id, NodeType nodeType, int activationFnId)
{
_id = id;
_nodeType = nodeType;
_activationFnId = activationFnId;
_auxState = null;
}
示例2: should_get_node
public void should_get_node(NodeType type)
{
var parent = new Node { NodeType = type };
var child = new Node("hai");
parent.Add(child, x => { });
parent.GetNode("hai").ShouldEqual(child);
}
示例3: Update
public void Update(NodeType nextType)
{
if (nextType == nodeType)
{
return;
}
switch(nextType)
{
case NodeType.Sequence:
mInternalNode = new BirdNest.Nodes.Sequence();
break;
case NodeType.Selector:
mInternalNode = new BirdNest.Nodes.Selector();
break;
case NodeType.Parallel:
mInternalNode = new BirdNest.Nodes.Parallel();
break;
case NodeType.UsePlan:
mInternalNode = new BirdNest.Nodes.UsePlanNode(this);
break;
default:
mInternalNode = null;
return;
}
nodeType = nextType;
}
示例4: QuadNode
public QuadNode(NodeType nodeType, int nodeSize, int nodeDepth, QuadNode parent, QuadTree parentTree, int positionIndex)
{
NodeType = nodeType;
_nodeSize = nodeSize;
_nodeDepth = nodeDepth;
_positionIndex = positionIndex;
_parent = parent;
_parentTree = parentTree;
//Add the 9 vertices
AddVertices();
Bounds = new BoundingBox(_parentTree.Vertices[VertexTopLeft.Index].Position,
_parentTree.Vertices[VertexBottomRight.Index].Position);
if (nodeSize >= 4)
AddChildren();
//Make call to UpdateNeighbors from the parent node.
//This will update all neighbors recursively for the
//children as well. This ensures all nodes are created
//prior to updating neighbors.
if (_nodeDepth == 1)
{
AddNeighbors();
VertexTopLeft.Activated = true;
VertexTopRight.Activated = true;
VertexCenter.Activated = true;
VertexBottomLeft.Activated = true;
VertexBottomRight.Activated = true;
}
}
示例5: 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;
}
示例6: NodeGreetingMessageVerifier
public NodeGreetingMessageVerifier(NodeType localNodeType, NodeType expectedRemoteNodeType, params NodeType[] allowOtherRemoteNoteTypes)
{
_expectedRemoteNodeTypes = new HashSet<NodeType> { expectedRemoteNodeType };
if (allowOtherRemoteNoteTypes != null) _expectedRemoteNodeTypes.UnionWith(allowOtherRemoteNoteTypes);
_greetingMessage = new NodeGreetingMessage(localNodeType);
}
示例7: XmlNodeInformation
public XmlNodeInformation(string contentValue, int depth, CommonNamespaces commonNamespaces)
{
m_contentValue = contentValue;
iDepth = depth;
nodeType = NodeType.content;
m_commonNamespaces = commonNamespaces;
}
示例8: Find
public override INode Find(INodeResolver resolver, string uri, NodeType nodeType, FileSystemOptions options)
{
var address = LayeredNodeAddress.Parse(uri);
if (address.Port >= 0 || address.UserName != "" || address.Password != "" || address.ServerName != "")
{
throw new MalformedUriException(uri, "Network & Authentication information not permitted");
}
if (nodeType.Is(typeof(IFile)))
{
var uri2 = address.InnerUri;
if (StringUriUtils.ContainsQuery(uri2))
{
uri2 += "&shadow=true";
}
else
{
uri2 += "?shadow=true";
}
return resolver.Resolve(uri2, nodeType);
}
return resolver.Resolve(address.InnerUri);
}
示例9: CreateNode
protected override INode CreateNode(INodeAddress address, NodeType nodeType)
{
if (!address.IsRoot)
{
var parent = (IDirectory)this.Resolve(address.Parent, NodeType.Directory);
if (parent is ImaginaryDirectory)
{
var retval = ((ImaginaryDirectory)parent).GetImaginaryChild(address.Name, nodeType);
if (retval != null)
{
return retval;
}
}
}
if (nodeType == NodeType.Directory)
{
return new ImaginaryDirectory(this, address);
}
else if (nodeType == NodeType.File)
{
return new ImaginaryFile(this, address);
}
throw new NotSupportedException(String.Format("{0}:{1}", address, nodeType));
}
示例10: GetNameToValueCollectionFromElementForType
/// <summary>
/// Gets the type of the name to value collection from element for.
/// </summary>
/// <param name="mainDocumentPart">The main document part.</param>
/// <param name="elementName">Name of the element.</param>
/// <param name="forNodeType">Type of for node.</param>
/// <returns></returns>
public Dictionary<string, string> GetNameToValueCollectionFromElementForType(MainDocumentPart mainDocumentPart, string elementName, NodeType forNodeType)
{
Dictionary<string, string> nameToValueCollection = new Dictionary<string, string>();
CustomXmlPart customXmlPart = this.customXmlPartCore.GetCustomXmlPart(mainDocumentPart);
if (customXmlPart != null)
{
XElement element = this.customXmlPartCore.GetFirstElementFromCustomXmlPart(customXmlPart, elementName);
if (element != null)
{
if (forNodeType == NodeType.Element)
{
foreach (XElement elem in element.Elements())
{
nameToValueCollection.Add(elem.Name.LocalName, elem.Nodes().Where(node => node.NodeType == XmlNodeType.Element).FirstOrDefault().ToString());
}
}
else if (forNodeType == NodeType.Attribute)
{
foreach (XAttribute attr in element.Attributes())
{
nameToValueCollection.Add(attr.Name.LocalName, attr.Value);
}
}
}
}
return nameToValueCollection;
}
示例11: AddGeoTreeNode
public void AddGeoTreeNode(NodeType mapNodeType, List<GeoNodePara> clutterNodeParas)
{
if (clutterNodeParas.Count != 0)
{
List<GeoTreeNode> treeNode = new List<GeoTreeNode>();
foreach (GeoNodePara para in clutterNodeParas)
{
GeoTreeNode item = this.GetGeoFolderNodeByName(this.m_DynamicNodeCollection, mapNodeType, para.FolderName);
if (item == null)
{
item = new GeoTreeNode(para.FolderName, LayerIDCreator.GetExclusiveID(), mapNodeType, CheckedState.Checked);
this.m_DynamicNodeCollection.Add(item);
treeNode.Add(item);
}
GeoTreeNode node2 = new GeoTreeNode(para.LayerName, para.LayerId, mapNodeType, CheckedState.Checked);
foreach (KeyValuePair<int, string> pair in para.ClutterIdNameDict)
{
int tag = (para.LayerId << 0x10) + ((short) pair.Key);
GeoTreeNode node3 = new GeoTreeNode(pair.Value, tag, mapNodeType, CheckedState.Checked);
node2.ChildrenNodes.Add(node3);
}
item.ChildrenNodes.Add(node2);
}
if (this.OnAddModelNodeEvent != null)
{
this.OnAddModelNodeEvent(treeNode);
}
}
}
示例12: NodeValue
//Constructor
public NodeValue(string name, Object value, NodeType type)
: base(name, Node.EmptyNodes)
{
_type = type;
_value = value;
_desc = "Value";
}
示例13: BaseNode
public BaseNode(string nodename)
{
NodeType = NodeType.Base;
this.Text = nodename;
this.ImageIndex = DataConvert.GetInt32(IconType.VsTemplates);
this.SelectedImageIndex = DataConvert.GetInt32(IconType.VsTemplates);
}
示例14: addClassInfoGraphNode
IClassInfoGraphNode addClassInfoGraphNode(ObjectSpace objectSpace, IMemberInfo memberInfo, NodeType nodeType) {
var classInfoGraphNode =(IClassInfoGraphNode)objectSpace.CreateObject(TypesInfo.Instance.ClassInfoGraphNodeType);
classInfoGraphNode.Name = memberInfo.Name;
classInfoGraphNode.TypeName = getSerializedType(memberInfo).Name;
classInfoGraphNode.NodeType=nodeType;
return classInfoGraphNode;
}
示例15: DoGetChildren
public override IEnumerable<INode> DoGetChildren(NodeType nodeType, Predicate<INode> acceptNode)
{
foreach (string key in Environment.GetEnvironmentVariables().Keys)
{
yield return GetImaginaryChild(key, NodeType.File);
}
}