本文整理汇总了C#中NodeId类的典型用法代码示例。如果您正苦于以下问题:C# NodeId类的具体用法?C# NodeId怎么用?C# NodeId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NodeId类属于命名空间,在下文中一共展示了NodeId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:haroldma,项目名称:Universal.Torrent,代码行数:7,代码来源:GetPeersTask.cs
示例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();
}
开发者ID:yuriik83,项目名称:UA-.UWP-Universal-Windows-Platform,代码行数:28,代码来源:AttributeListCtrl.cs
示例3: ResponseMessage
protected ResponseMessage(NodeId id, BEncodedValue transactionId)
: base(ResponseType)
{
Properties.Add(ReturnValuesKey, new BEncodedDictionary());
Parameters.Add(IdKey, id.BencodedString());
TransactionId = transactionId;
}
开发者ID:mrscylla,项目名称:octotorrent,代码行数:7,代码来源:ResponseMessage.cs
示例4: DataAddress
public DataAddress(BlockId blockId, int dataId)
{
// TODO: Check for overflow?
long[] blockAddr = blockId.ReferenceAddress;
blockAddr[1] |= dataId & 0x0FFFF;
value = new NodeId(blockAddr);
}
开发者ID:erpframework,项目名称:cloudb,代码行数:7,代码来源:DataAddress.cs
示例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);
}
开发者ID:rajkosto,项目名称:DayZeroLauncher,代码行数:7,代码来源:AnnouncePeer.cs
示例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();
}
开发者ID:OPCFoundation,项目名称:UA-.NET,代码行数:28,代码来源:BrowseDlg.cs
示例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>();
}
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:37,代码来源:AggregateCalculator.cs
示例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;
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:27,代码来源:ServerDiagnosticsDlg.cs
示例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;
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:26,代码来源:BaseEvent.cs
示例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();
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:33,代码来源:CallMethodDlg.cs
示例11: IsInView
/// <summary cref="IFilterTarget.IsInView" />
public bool IsInView(
FilterContext context,
NodeId viewId)
{
// events instances are not in any view.
return false;
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:8,代码来源:BaseEvent.cs
示例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);
}
开发者ID:senditu,项目名称:simpletorrent,代码行数:7,代码来源:GetPeersTask.cs
示例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);
}
开发者ID:yuriik83,项目名称:OPC-UA-OOI,代码行数:7,代码来源:NodeIdUnitTest.cs
示例14: SessionDiagnosticsDlg
public SessionDiagnosticsDlg(Session session, NodeId sessionNodeId)
{
InitializeComponent();
List<DiagnosticListViewItem> list = CreateItems(session, sessionNodeId);
serverDiagnosticCtrl1.LoadItems(session, list);
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:7,代码来源:SessionDiagnosticsDlg.cs
示例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);
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:9,代码来源:BaseEvent.cs
示例16: AggregateCalculator
/// <summary>
/// Creates a default aggregator.
/// </summary>
protected AggregateCalculator(NodeId aggregateId)
{
AggregateConfiguration configuration = new AggregateConfiguration();
configuration.TreatUncertainAsBad = false;
configuration.PercentDataBad = 100;
configuration.PercentDataGood = 100;
configuration.UseSlopedExtrapolation = false;
Initialize(aggregateId, DateTime.UtcNow, DateTime.MaxValue, 1000, false, configuration);
}
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:12,代码来源:AggregateCalculator.cs
示例17: QueryMessage
protected QueryMessage(NodeId id, BEncodedString queryName, BEncodedDictionary queryArguments, ResponseCreator responseCreator)
: base(QueryType)
{
Properties.Add(QueryNameKey, queryName);
Properties.Add(QueryArgumentsKey, queryArguments);
Parameters.Add(IdKey, id.BencodedString());
ResponseCreator = responseCreator;
}
开发者ID:mrscylla,项目名称:octotorrent,代码行数:9,代码来源:QueryMessage.cs
示例18: Initialize
/// <summary>
/// Initializes the control.
/// </summary>
public void Initialize(Session session, NodeId typeId)
{
ItemsLV.Items.Clear();
AdjustColumns();
if (session == null)
{
return;
}
ILocalNode root = session.NodeCache.Find(typeId) as ILocalNode;
if (root == null)
{
return;
}
m_session = session;
SortedDictionary<string,InstanceDeclaration> instances = new SortedDictionary<string,InstanceDeclaration>();
InstanceDeclaration declaration = new InstanceDeclaration();
declaration.Instance = root;
declaration.DisplayPath = Utils.Format("({0})", root.NodeClass);
declaration.Description = Utils.Format("{0}", root.Description);
declaration.DataType = "NodeId";
IVariableBase variable = root as IVariableBase;
if (variable != null)
{
INode dataType = m_session.NodeCache.Find(variable.DataType);
if (dataType != null)
{
declaration.DataType = Utils.Format("{0}", dataType);
}
if (variable.ValueRank >= 0)
{
declaration.DataType += "[]";
}
}
instances.Add(declaration.DisplayPath, declaration);
CollectInstances(root, String.Empty, instances);
foreach (InstanceDeclaration instance in instances.Values)
{
AddItem(instance);
}
AdjustColumns();
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:59,代码来源:TypeHierarchyListCtrl.cs
示例19: Create
/// <summary>
/// Creates the session.
/// </summary>
public void Create(
EndpointDescription endpoint,
ApplicationDescription client,
byte[] clientCertificate,
string sessionName,
double sessionTimeout,
out NodeId sessionId,
out NodeId authenticationToken,
out byte[] serverNonce,
out double revisedSessionTimeout)
{
lock (m_lock)
{
// save the secure channel id.
m_secureChannelId = null;
if (OperationContext.Current != null)
{
m_secureChannelId = OperationContext.Current.Channel.SessionId;
}
m_endpoint = endpoint;
m_client = client;
m_sessionName = sessionName;
if (clientCertificate != null)
{
m_clientCertificate = new X509Certificate2(clientCertificate);
}
// Create a public and a private identifier for the session. The public identifier is visible in the
// address space and audit logs. The private identifier is only used by the client to identify itself
// when it sends a request. Clients and servers that do not keep the authentication token will be vulnerable
// to session hijacking when using transports such as SSL to implement the secure channel. It is not an
// issue for applications that use WS-Secure Conversation.
// create a guid for a session id. use it for an authentication token as well.
m_sessionId = new NodeId(System.Guid.NewGuid(), 1);
m_authenticationToken = authenticationToken = sessionId = m_sessionId;
// set a reasonable session timeout.
m_sessionTimeout = sessionTimeout;
if (m_sessionTimeout < 30000)
{
m_sessionTimeout = 30000;
}
revisedSessionTimeout = m_sessionTimeout;
// create a server nonce.
m_serverNonce = serverNonce = new byte[32];
RNGCryptoServiceProvider random = new RNGCryptoServiceProvider();
random.GetBytes(m_serverNonce);
}
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:59,代码来源:Session.cs
示例20: IsRelatedTo
/// <summary cref="IFilterTarget.IsRelatedTo" />
public virtual bool IsRelatedTo(
FilterContext context,
NodeId source,
NodeId targetTypeId,
NodeId referenceTypeId,
int hops)
{
// events instances do not have any relationships to other nodes.
return false;
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:11,代码来源:BaseEvent.cs
注:本文中的NodeId类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论