public static MemoType Create(MemoTypeEnum v) { return(new MemoType { InnerValue = v }); }
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."); } }
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("无效地类型"); } }
private Memo(long id) { Id = id; Type = MemoTypeEnum.MEMO_ID; }
private Memo() { Type = MemoTypeEnum.MEMO_NONE; }
public static MemoType Create(MemoTypeEnum v) { return new MemoType { InnerValue = v }; }