本文整理汇总了C#中NodeId类的典型用法代码示例。如果您正苦于以下问题:C# NodeId类的具体用法?C# NodeId怎么用?C# NodeId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NodeId类属于命名空间,在下文中一共展示了NodeId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPeersTask
public GetPeersTask(DhtEngine engine, NodeId infohash)
{
_engine = engine;
_infoHash = infohash;
_closestNodes = new SortedList<NodeId, NodeId>(Bucket.MaxCapacity);
ClosestActiveNodes = new SortedList<NodeId, Node>(Bucket.MaxCapacity*2);
}
示例2: Initialize
/// <summary>
/// Sets the nodes in the control.
/// </summary>
public void Initialize(Session session, ExpandedNodeId nodeId)
{
if (session == null) throw new ArgumentNullException("session");
Clear();
if (nodeId == null)
{
return;
}
m_session = session;
m_nodeId = (NodeId)nodeId;
INode node = m_session.NodeCache.Find(m_nodeId);
if (node != null && (node.NodeClass & (NodeClass.Variable | NodeClass.Object)) != 0)
{
AddReferences(ReferenceTypeIds.HasTypeDefinition, BrowseDirection.Forward);
AddReferences(ReferenceTypeIds.HasModellingRule, BrowseDirection.Forward);
}
AddAttributes();
AddProperties();
}
示例3: ResponseMessage
protected ResponseMessage(NodeId id, BEncodedValue transactionId)
: base(ResponseType)
{
Properties.Add(ReturnValuesKey, new BEncodedDictionary());
Parameters.Add(IdKey, id.BencodedString());
TransactionId = transactionId;
}
示例4: DataAddress
public DataAddress(BlockId blockId, int dataId)
{
// TODO: Check for overflow?
long[] blockAddr = blockId.ReferenceAddress;
blockAddr[1] |= dataId & 0x0FFFF;
value = new NodeId(blockAddr);
}
示例5: AnnouncePeer
public AnnouncePeer(NodeId id, NodeId infoHash, BEncodedNumber port, BEncodedString token)
: base(id, QueryName, responseCreator)
{
Parameters.Add(InfoHashKey, infoHash.BencodedString());
Parameters.Add(PortKey, port);
Parameters.Add(TokenKey, token);
}
示例6: Show
/// <summary>
/// Displays the address space with the specified view
/// </summary>
public void Show(Session session, NodeId startId)
{
if (session == null) throw new ArgumentNullException("session");
if (m_session != null)
{
m_session.SessionClosing -= m_SessionClosing;
}
m_session = session;
m_session.SessionClosing += m_SessionClosing;
Browser browser = new Browser(session);
browser.BrowseDirection = BrowseDirection.Both;
browser.ContinueUntilDone = true;
browser.ReferenceTypeId = ReferenceTypeIds.References;
BrowseCTRL.Initialize(browser, startId);
UpdateNavigationBar();
Show();
BringToFront();
}
示例7: Initialize
/// <summary>
/// Initializes the calculation stream.
/// </summary>
/// <param name="aggregateId">The aggregate function to apply.</param>
/// <param name="startTime">The start time.</param>
/// <param name="endTime">The end time.</param>
/// <param name="processingInterval">The processing interval.</param>
/// <param name="stepped">Whether to use stepped interpolation.</param>
/// <param name="configuration">The aggregate configuration.</param>
protected void Initialize(
NodeId aggregateId,
DateTime startTime,
DateTime endTime,
double processingInterval,
bool stepped,
AggregateConfiguration configuration)
{
AggregateId = aggregateId;
StartTime = startTime;
EndTime = endTime;
ProcessingInterval = processingInterval;
Stepped = stepped;
Configuration = configuration;
TimeFlowsBackward = (endTime < startTime);
if (processingInterval == 0)
{
if (endTime == DateTime.MinValue || startTime == DateTime.MinValue)
{
throw new ArgumentException("Non-zero processingInterval required.", "processingInterval");
}
ProcessingInterval = Math.Abs((endTime - startTime).TotalMilliseconds);
}
m_values = new LinkedList<DataValue>();
}
示例8: CreateItems
private List<DiagnosticListViewItem> CreateItems(Session session)
{
List<DiagnosticListViewItem> items = new List<DiagnosticListViewItem>();
NodeId serverNode = new NodeId(Objects.Server);
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.EnabledFlag", 0, false, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.ServerDiagnosticsSummary", 0, true, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.ServerDiagnosticsSummary.CumulatedSessionCount", 1, false, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.ServerDiagnosticsSummary.CumulatedSubscriptionCount", 1, false, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.ServerDiagnosticsSummary.CurrentSessionCount", 1, false, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.ServerDiagnosticsSummary.CurrentSubscriptionCount", 1, false, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.ServerDiagnosticsSummary.PublishingRateCount", 1, false, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.ServerDiagnosticsSummary.RejectedRequestsCount", 1, false, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.ServerDiagnosticsSummary.RejectedSessionCount", 1, false, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.ServerDiagnosticsSummary.SamplingRateCount", 1, false, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.ServerDiagnosticsSummary.SecurityRejectedRequestsCount", 1, false, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.ServerDiagnosticsSummary.SecurityRejectedSessionCount", 1, false, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.ServerDiagnosticsSummary.ServerViewCount", 1, false, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.ServerDiagnosticsSummary.SessionAbortCount", 1, false, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.ServerDiagnosticsSummary.SessionTimeoutCount", 1, false, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.SamplingRateDiagnosticsArray", 0, true, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.SubscriptionDiagnosticsArray", 0, true, true));
items.Add(new DiagnosticListViewItem(serverNode,"ServerDiagnostics.SessionDiagnosticsSummary", 0, false, false));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.SessionDiagnosticsSummary.SessionDiagnosticsArray", 1, true, true));
items.Add(new DiagnosticListViewItem(serverNode, "ServerDiagnostics.SessionDiagnosticsSummary.SessionSecurityDiagnosticsArray", 1, true, true));
return items;
}
示例9: GetAttributeValue
/// <summary cref="IFilterTarget.GetAttributeValue" />
public virtual object GetAttributeValue(
FilterContext context,
NodeId typeDefinitionId,
IList<QualifiedName> relativePath,
uint attributeId,
NumericRange indexRange)
{
if (context == null) throw new ArgumentNullException("context");
// read the attribute value.
DataValue dataValue = ReadAttributeValue(
context,
typeDefinitionId,
relativePath,
attributeId,
indexRange);
if (StatusCode.IsBad(dataValue.StatusCode))
{
return dataValue.StatusCode;
}
// return the value.
return dataValue.Value;
}
示例10: Show
/// <summary>
/// Displays the dialog.
/// </summary>
public void Show(Session session, NodeId objectId, NodeId methodId)
{
if (session == null) throw new ArgumentNullException("session");
if (methodId == null) throw new ArgumentNullException("methodId");
if (m_session != null)
{
m_session.SessionClosing -= m_SessionClosing;
}
m_session = session;
m_session.SessionClosing += m_SessionClosing;
m_objectId = objectId;
m_methodId = methodId;
InputArgumentsCTRL.Update(session, methodId, true);
OutputArgumentsCTRL.Update(session, methodId, false);
Node target = session.NodeCache.Find(objectId) as Node;
Node method = session.NodeCache.Find(methodId) as Node;
if (target != null && method != null)
{
Text = String.Format("Call {0}.{1}", target, method);
}
Show();
BringToFront();
}
示例11: IsInView
/// <summary cref="IFilterTarget.IsInView" />
public bool IsInView(
FilterContext context,
NodeId viewId)
{
// events instances are not in any view.
return false;
}
示例12: GetPeersTask
public GetPeersTask(DhtEngine engine, NodeId infohash)
{
this.engine = engine;
this.infoHash = infohash;
this.closestNodes = new SortedList<NodeId, NodeId>(Bucket.MaxCapacity);
this.queriedNodes = new SortedList<NodeId, Node>(Bucket.MaxCapacity * 2);
}
示例13: NodeIdCompareToTestMethod
public void NodeIdCompareToTestMethod()
{
NodeId _property = new NodeId(VariableTypes.PropertyType);
Assert.AreNotSame(_property, VariableTypeIds.PropertyType);
int _res = _property.CompareTo(VariableTypeIds.PropertyType);
Assert.AreEqual<int>(0, _res);
}
示例14: SessionDiagnosticsDlg
public SessionDiagnosticsDlg(Session session, NodeId sessionNodeId)
{
InitializeComponent();
List<DiagnosticListViewItem> list = CreateItems(session, sessionNodeId);
serverDiagnosticCtrl1.LoadItems(session, list);
}
示例15: IsTypeOf
/// <summary cref="IFilterTarget.IsTypeOf" />
public bool IsTypeOf(
FilterContext context,
NodeId typeDefinitionId)
{
if (context == null) throw new ArgumentNullException("context");
return context.TypeTree.IsTypeOf(TypeDefinitionId, typeDefinitionId);
}