当前位置: 首页>>代码示例>>C#>>正文


C# ObjectIdentifier.ToNumerical方法代码示例

本文整理汇总了C#中ObjectIdentifier.ToNumerical方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectIdentifier.ToNumerical方法的具体用法?C# ObjectIdentifier.ToNumerical怎么用?C# ObjectIdentifier.ToNumerical使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ObjectIdentifier的用法示例。


在下文中一共展示了ObjectIdentifier.ToNumerical方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestConstructor

 public void TestConstructor()
 {
     ObjectIdentifier oid = new ObjectIdentifier(new byte[] { 0x2B, 0x06, 0x99, 0x37 });
     Assert.AreEqual(new uint[] { 1, 3, 6, 3255 }, oid.ToNumerical());
     var o = ObjectIdentifier.Create(new uint[] {1, 3, 6}, 3255);
     Assert.AreEqual(oid, o);
 }
开发者ID:bleissem,项目名称:sharpsnmplib,代码行数:7,代码来源:ObjectIdentifierTestFixture.cs

示例2: ValidateTable

 /// <summary>
 /// Validates if an <see cref="ObjectIdentifier"/> is a table.
 /// </summary>
 /// <param name="identifier">The object identifier.</param>
 /// <returns></returns>
 public bool ValidateTable(ObjectIdentifier identifier)
 {
     if (identifier == null)
     {
         throw new ArgumentNullException("identifier");
     }
         
     return IsTableId(identifier.ToNumerical());
 }
开发者ID:moljac,项目名称:MonoMobile.SharpSNMP,代码行数:14,代码来源:ObjectRegistryBase.cs

示例3: TestConstructor2

 public void TestConstructor2()
 {
     ObjectIdentifier oid = new ObjectIdentifier(new byte[] { 0x2B, 0x06, 0x01, 0x04, 0x01, 0x90, 0x72, 0x87, 0x68, 0x02 });
     Assert.AreEqual(new uint[] { 1, 3, 6, 1, 4, 1, 2162, 1000, 2 }, oid.ToNumerical());
 }
开发者ID:moljac,项目名称:MonoMobile.SharpSNMP,代码行数:5,代码来源:TestObjectIdentifier.cs

示例4: GetStringOf

        public static string GetStringOf(ObjectIdentifier id, IObjectRegistry objects)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }
            
            if (objects == null)
            {
                return id.ToString();
            }

            string result = objects.Tree.Search(id.ToNumerical()).AlternativeText;
            return string.IsNullOrEmpty(result) ? id.ToString() : result;
        }
开发者ID:moljac,项目名称:MonoMobile.SharpSNMP,代码行数:15,代码来源:SearchResult.cs

示例5: GetTextual

 public static string GetTextual(ObjectIdentifier id, IObjectRegistry registry)
 {
     if (id == null)
     {
         throw new ArgumentNullException("id");
     }
     
     IObjectRegistry objects = registry ?? ObjectRegistry.Default;
     return objects.Translate(id.ToNumerical());
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:10,代码来源:ObjectRegistry.cs

示例6: ValidateTable

 /// <summary>
 /// Validates if an <see cref="ObjectIdentifier"/> is a table.
 /// </summary>
 /// <param name="identifier">The object identifier.</param>
 /// <returns></returns>
 public bool ValidateTable(ObjectIdentifier identifier)
 {
     if (identifier == null)
     {
         throw new ArgumentNullException("identifier");
     }
     
     try
     {
         return IsTableId(identifier.ToNumerical());
     }
     catch (ArgumentOutOfRangeException)
     {
         // if no matching definition found, refuse to continue.
         return false;
     }
 }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:22,代码来源:ObjectRegistry.cs


注:本文中的ObjectIdentifier.ToNumerical方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。