示例#1
0
        /// <summary>
        /// 解析一个 id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static IdModel Parser(long id)
        {
            IdParser idParser = IdParserFactory.GetInstance(id);
            IdModel  model    = new IdModel();

            idParser.DoParser(id, ref model);
            return(model);
        }
示例#2
0
        public static IdParser GetInstance(long id)
        {
            int sign = IdParser.GetSign(id);

            switch (sign)
            {
            case 1:
                return(Sign1IdParser);

            case 2:
                return(Sign2IdParser);

            default: throw new ArgumentException("未知的协议号");
            }
        }