Exemplo n.º 1
0
 public static MemoType Create(MemoTypeEnum v)
 {
     return(new MemoType
     {
         InnerValue = v
     });
 }
Exemplo n.º 2
0
        private Memo(MemoTypeEnum type, string textorhash)
        {
            CheckNotNull(textorhash, "textorhash cannot be null.");
            switch (type)
            {
            case MemoTypeEnum.MEMO_TEXT:
                Text = textorhash;
                Type = type;
                break;

            case MemoTypeEnum.MEMO_HASH:
                if (textorhash.Length != 32)
                {
                    throw new ArgumentException("Invalid hash.");
                }
                Hash = textorhash;
                Type = type;
                break;

            case MemoTypeEnum.MEMO_RETURN:
                if (textorhash.Length != 32)
                {
                    throw new ArgumentException("Invalid retHash.");
                }
                RetHash = textorhash;
                Type    = type;
                break;

            default:
                throw new ArgumentException("Invalid type.");
            }
        }
Exemplo n.º 3
0
        private Memo(MemoTypeEnum type, string textorhash)
        {
            CheckNotNull(textorhash, "字符哈希值不能是空");
            switch (type)
            {
            case MemoTypeEnum.MEMO_TEXT:
                Text = textorhash;
                Type = type;
                break;

            case MemoTypeEnum.MEMO_HASH:
                if (textorhash.Length != 32)
                {
                    throw new ArgumentException("无效地哈希值");
                }
                Hash = textorhash;
                Type = type;
                break;

            case MemoTypeEnum.MEMO_RETURN:
                if (textorhash.Length != 32)
                {
                    throw new ArgumentException("无效地哈希值");
                }
                RetHash = textorhash;
                Type    = type;
                break;

            default:
                throw new ArgumentException("无效地类型");
            }
        }
Exemplo n.º 4
0
 private Memo(long id)
 {
     Id   = id;
     Type = MemoTypeEnum.MEMO_ID;
 }
Exemplo n.º 5
0
 private Memo()
 {
     Type = MemoTypeEnum.MEMO_NONE;
 }
 public static MemoType Create(MemoTypeEnum v)
 {
   return new MemoType {
     InnerValue = v
   };
 }