本文整理汇总了C#中Oid类的典型用法代码示例。如果您正苦于以下问题:C# Oid类的具体用法?C# Oid怎么用?C# Oid使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Oid类属于命名空间,在下文中一共展示了Oid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Pkcs9ContentType
internal Pkcs9ContentType (string contentType)
{
(this as AsnEncodedData).Oid = new Oid (oid, friendlyName);
_contentType = new Oid (contentType);
RawData = Encode ();
_encoded = null;
}
示例2: CreateTestProject
private static void CreateTestProject(bool useOAuthEndpoints)
{
V1Connector connector;
if (useOAuthEndpoints)
{
connector = V1Connector.WithInstanceUrl(ConfigurationManager.AppSettings.Get("V1Url"))
.WithUserAgentHeader("IntegrationTests", "1.0")
.WithAccessToken(ConfigurationManager.AppSettings.Get("V1AccessToken"))
.UseOAuthEndpoints()
.Build();
}
else
{
connector = V1Connector.WithInstanceUrl(ConfigurationManager.AppSettings.Get("V1Url"))
.WithUserAgentHeader("IntegrationTests", "1.0")
.WithAccessToken(ConfigurationManager.AppSettings.Get("V1AccessToken"))
.Build();
}
var services = new Services(connector);
var assetType = services.Meta.GetAssetType("Scope");
var nameAttribute = assetType.GetAttributeDefinition("Name");
var projectId = services.GetOid("Scope:0");
var newAsset = services.New(assetType, projectId);
newAsset.SetAttributeValue(nameAttribute, TestProjectName);
services.Save(newAsset);
_testProjectId = newAsset.Oid.Momentless;
}
示例3: SearchIntermediaNodeDataEventArgs
/// <summary>
/// Initializes a new instance of the 'SearchIntermediaNodeDataEventArgs' class.
/// </summary>
/// <param name="parentNodeOid">Parent node Oid.</param>
/// <param name="nodeId">Node identifier.</param>
/// <param name="completeOidPath">Oids list and its Ids of the complete path for a node.</param>
public SearchIntermediaNodeDataEventArgs(Oid parentNodeOid, string nodeId, List<KeyValuePair<string, Oid>> completeOidPath)
{
mParentNodeOid = parentNodeOid;
mNodeId = nodeId;
mCompleteOidPath = completeOidPath;
mLastBlock = true;
}
示例4: ObjectViewModel
public ObjectViewModel(object obj, FieldViewModel parentView, int arrayIndex, bool encodedOid, SessionBase session)
: base(parentView, true)
{
m_session = session;
if (encodedOid)
{
if (obj.GetType() == typeof(UInt64))
{
m_objectId = (UInt64)obj;
m_objectAsString = "[" + arrayIndex.ToString() + "] " + new Oid(m_objectId).ToString();
}
else
{
Oid oid = new Oid(parentView.ParentId);
oid = new Oid(oid.Database, (UInt32)obj);
m_objectId = oid.Id;
m_objectAsString = "[" + arrayIndex.ToString() + "] " + new OidShort(oid.IdShort).ToString();
}
}
else
{
IOptimizedPersistable pObj = obj as IOptimizedPersistable;
if (pObj == null)
session.GlobalObjWrapperGet(obj, out pObj);
if (pObj != null)
m_objectId = pObj.Id;
m_session = session;
if (pObj != null && pObj.WrappedObject != obj)
m_objectAsString = "[" + arrayIndex.ToString() + "] " + pObj.WrappedObject.ToString() + " " + new Oid(pObj.Id);
else
m_objectAsString = "[" + arrayIndex.ToString() + "] " + obj.ToString();
}
}
示例5: GetData
/// <summary>
/// Fills and return a DataSet processing the data set file and starting with the oid.
/// </summary>
/// <param name="oid">Oid of the instance.</param>
/// <param name="dataSetFile">Path of the data set file.</param>
/// <returns>A DataSet object with the suitable data.</returns>
public static DataSet GetData(Oid oid, string dataSetFile)
{
DataSet lDataSet = new DataSet();
try
{
lDataSet.ReadXmlSchema(dataSetFile);
}
catch (Exception e)
{
object[] lArgs = new object[1];
lArgs[0] = dataSetFile;
string lErrorMessage = CultureManager.TranslateStringWithParams(LanguageConstantKeys.L_ERROR_DATASET_GENERICLOAD, LanguageConstantValues.L_ERROR_DATASET_GENERICLOAD, lArgs);
Exception newException = new Exception(lErrorMessage, e);
throw newException;
}
// Analize the Tables in the DataSet.
DataTable lStartingClass = GetDataTable(lDataSet, oid.ClassName);
string lDisplaySet = GetDisplaySet(lStartingClass);
DataTable rootInstance = Logics.Logic.ExecuteQueryInstance(Logics.Logic.Agent, oid, lDisplaySet);
// Add data to DataSet.
lStartingClass.Merge(rootInstance);
// Process Table relationships.
ProcessTableRelationships(lDataSet, lStartingClass, oid);
return lDataSet;
}
示例6: GetNextNodeDataBlockEventArgs
/// <summary>
/// Initializes a new instance of the 'GetNextNodeDataBlockEventArgs' class.
/// </summary>
/// <param name="nodeId">Node identifier.</param>
/// <param name="lastOid">Last Oid.</param>
/// <param name="completeOidPath">Oids list and its Ids of the complete path for a node.</param>
public GetNextNodeDataBlockEventArgs(string nodeId, Oid lastOid, List<KeyValuePair<string, Oid>> completeOidPath)
{
NodeId = nodeId;
mLastOid = lastOid;
mCompleteOidPath = completeOidPath;
mLastBlock = true;
}
示例7: LookupUnknownOid
public static void LookupUnknownOid()
{
Oid oid = new Oid(Bogus_Name);
Assert.Equal(Bogus_Name, oid.Value);
Assert.Null(oid.FriendlyName);
}
示例8: TestDecode
public void TestDecode()
{
const string hex = "4a7067c30a57000000008ecb";
var oid = new Oid(hex);
Assert.AreEqual(hex, oid.ToString());
}
示例9: LookupOidByFriendlyName_Ctor
public static void LookupOidByFriendlyName_Ctor(string oidValue, string friendlyName)
{
Oid oid = new Oid(friendlyName);
Assert.Equal(oidValue, oid.Value);
Assert.Equal(friendlyName, oid.FriendlyName);
}
示例10: TestFollowNonReference
public void TestFollowNonReference(){
var id = new Oid("BAD067c30a57000000008ecb");
var rf = new DBRef("refs", id);
var target = DB.FollowReference(rf);
Assert.IsNull(target, "FollowReference returned wasn't null");
}
示例11: X509KeyUsageExtension
public X509KeyUsageExtension (X509KeyUsageFlags keyUsages, bool critical)
{
_oid = new Oid (oid, friendlyName);
base.Critical = critical;
_keyUsages = GetValidFlags (keyUsages);
RawData = Encode ();
}
示例12: Pkcs9AttributeObject
public Pkcs9AttributeObject (Oid oid, byte[] encodedData)
{
if (oid == null)
throw new ArgumentNullException ("oid");
base.Oid = oid;
RawData = encodedData;
}
示例13: PublicKey
public PublicKey(Oid oid, AsnEncodedData parameters, AsnEncodedData keyValue)
{
_oid = new Oid(oid);
EncodedParameters = new AsnEncodedData(parameters);
EncodedKeyValue = new AsnEncodedData(keyValue);
return;
}
示例14: TestStrStrConstructor
public static void TestStrStrConstructor()
{
Oid oid;
// No validation at all.
oid = new Oid((string)null, (string)null);
Assert.Equal(null, oid.FriendlyName);
Assert.Equal(null, oid.Value);
// Can omit friendly-name - FriendlyName property demand-computes it.
oid = new Oid(SHA1_Oid, (string)null);
Assert.Equal(SHA1_Name, oid.FriendlyName);
Assert.Equal(SHA1_Oid, oid.Value);
oid = new Oid(SHA1_Oid, "BOGUS-NAME");
Assert.Equal("BOGUS-NAME", oid.FriendlyName);
Assert.Equal(SHA1_Oid, oid.Value);
// Can omit oid, Value property does no on-demand conversion.
oid = new Oid((string)null, SHA1_Name);
Assert.Equal(SHA1_Name, oid.FriendlyName);
Assert.Equal(null, oid.Value);
oid = new Oid("BOGUS-OID", SHA1_Name);
Assert.Equal(SHA1_Name, oid.FriendlyName);
Assert.Equal("BOGUS-OID", oid.Value);
return;
}
示例15: TestFormatJ
public void TestFormatJ()
{
const string hex = "4a7067c30a57000000008ecb";
var oid = new Oid(hex);
Assert.AreEqual("\"" + hex + "\"", oid.ToString("J"));
}