Org.BouncyCastle.Asn1.Cmp.InfoTypeAndValue.GetInstance C# (CSharp) Method

GetInstance() public static method

public static GetInstance ( object obj ) : InfoTypeAndValue
obj object
return InfoTypeAndValue
        public static InfoTypeAndValue GetInstance(object obj)
        {
            if (obj is InfoTypeAndValue)
                return (InfoTypeAndValue)obj;

            if (obj is Asn1Sequence)
                return new InfoTypeAndValue((Asn1Sequence)obj);

            throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj");
        }

Usage Example

示例#1
0
 public virtual InfoTypeAndValue[] ToInfoTypeAndValueArray()
 {
     InfoTypeAndValue[] result = new InfoTypeAndValue[content.Count];
     for (int i = 0; i != result.Length; ++i)
     {
         result[i] = InfoTypeAndValue.GetInstance(content[i]);
     }
     return(result);
 }
All Usage Examples Of Org.BouncyCastle.Asn1.Cmp.InfoTypeAndValue::GetInstance