本文整理汇总了C#中Oid.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Oid.Equals方法的具体用法?C# Oid.Equals怎么用?C# Oid.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oid
的用法示例。
在下文中一共展示了Oid.Equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOidParentNodes
/// <summary>
/// Returns the Parent node Oid of the specifies node
/// </summary>
/// <param name="nodeId"></param>
/// <param name="oid"></param>
/// <returns></returns>
public List<Oid> GetOidParentNodes(string nodeId, Oid oid)
{
List<Oid> lOidList = new List<Oid>();
TreeNode[] lNodes = mTreeViewIT.Nodes.Find(nodeId, true);
// Locate the node with the same Oid
foreach (TreeNode node in lNodes)
{
if (node.Tag == null)
{
// It is a grouping node
Oid parentOid = GetOidParentNode(node);
if (oid.Equals(parentOid))
{
lOidList.Add(parentOid);
}
}
else
{
InstanceNodeInfo instanceNodeInfo = node.Tag as InstanceNodeInfo;
if (instanceNodeInfo != null)
{
if (instanceNodeInfo.InstanceOid.Equals(oid))
{
// Get the Oid of the parent node
Oid parentOid = GetOidParentNode(node);
if (parentOid != null)
{
lOidList.Add(parentOid);
}
}
}
}
}
return lOidList;
}
示例2: TestOidInEquality
public void TestOidInEquality()
{
var val = new Oid("4a7067c30a57000000008ecb");
var other = new Oid("5a7067c30a57000000008ecb");
Oid nilo = null;
Assert.IsFalse(val == null);
Assert.IsFalse(nilo == val);
Assert.IsFalse(val == nilo);
Assert.IsFalse(val == other);
Assert.IsFalse(val.Equals(other));
Assert.IsTrue(val != null);
Assert.IsTrue(val != other);
}
示例3: OidEqualSelf
public void OidEqualSelf()
{
Oid o = new Oid(Meta.GetAssetType("Story"), 5, null);
Assert.IsTrue(o.Equals(o));
}
示例4: TestOidEquality
public void TestOidEquality()
{
var val = new Oid("4a7067c30a57000000008ecb");
var other = new Oid("4a7067c30a57000000008ecb");
Assert.IsTrue(val.Equals(other), "Equals(Oid) did not work");
Assert.IsTrue(val == other, "== operator did not work");
Assert.IsTrue(val == val, "Objects should be equal to itself.");
}
示例5: OidNotNull
public void OidNotNull()
{
Oid o = new Oid(Meta.GetAssetType("Story"), 5, null);
Assert.IsFalse(o.Equals(null));
}