示例#1
0
 public static bool IsValid(string value)
 {
     if (Uuid.IsValid(value))
     {
         return(true);
     }
     if (IsoOid.IsValid(value))
     {
         return(true);
     }
     return(InternetId.IsValid(value));
 }
示例#2
0
文件: UID.cs 项目: nickvane/OpenEHR
        public static Uid Create(string value)
        {
            Check.Require(!string.IsNullOrEmpty(value), "value must not be null or empty.");

            Uid result = null;

            if (Uuid.IsValid(value))
                result = new Uuid(value);
            else if (IsoOid.IsValid(value))
                result = new IsoOid(value);
            else if (InternetId.IsValid(value))
                result = new InternetId(value);

            Check.Ensure(result != null, "value must be either an UUID, INTERNET_ID, or ISO_OID " + value);

            return result;
        }
示例#3
0
        public static Uid Create(string value)
        {
            Check.Require(!string.IsNullOrEmpty(value), "value must not be null or empty.");

            Uid result = null;

            if (Uuid.IsValid(value))
            {
                result = new Uuid(value);
            }
            else if (IsoOid.IsValid(value))
            {
                result = new IsoOid(value);
            }
            else if (InternetId.IsValid(value))
            {
                result = new InternetId(value);
            }

            Check.Ensure(result != null, "value must be either an UUID, INTERNET_ID, or ISO_OID " + value);

            return(result);
        }