示例#1
0
文件: SafeModel.cs 项目: burstas/rmps
 /// <summary>
 /// 向导初始化
 /// </summary>
 /// <returns></returns>
 public GuidAtt InitGuid()
 {
     GuidAtt guid = new GuidAtt { Order = "模板" };
     guid.Text = DateTime.Now.ToString(CApp.DATEIME_FORMAT);
     guid.Id = (_Key.AttIndex++).ToString();
     _AttList.Add(guid);
     return guid;
 }
示例#2
0
文件: SafeModel.cs 项目: burstas/rmps
        public void Decode(string key, int sec, IList<Att> list)
        {
            // 查询数据是否为空
            if (string.IsNullOrEmpty(key))
            {
                return;
            }
            key = _UserModel.Decode(key, sec);

            // Guid
            GuidAtt guid = new GuidAtt();
            guid.Text = _Key.RegTime;
            guid.Data = _Key.LibId;
            list.Add(guid);

            // MetaItem
            MetaAtt meta = new MetaAtt();
            meta.Text = _Key.Title;
            meta.Data = _Key.MetaKey;
            list.Add(meta);

            // LogoItem
            LogoAtt logo = new LogoAtt();
            logo.Text = _Key.IcoName;
            logo.Data = _Key.IcoMemo;
            logo.SetSpec(LogoAtt.SPEC_LOGO_DIR, _Key.IcoPath);
            logo.LargeIcon = _Key.Icon;
            list.Add(logo);

            // HintItem
            HintAtt hint = new HintAtt();
            hint.Text = _Key.Gtd == null ? "<无提醒>" : _Key.Gtd.Subject;
            hint.Data = _Key.GtdMemo;
            hint.Gtd = _Key.Gtd;
            hint.Icon = _Key.GtdIcon;
            list.Add(hint);

            // AutoItem
            AutoAtt auto = new AutoAtt();
            auto.Text = _Key.Window;
            auto.Data = _Key.Script;
            list.Add(auto);

            // 处理每一个数据
            string[] arr = key.Split(Att.SP_SQL_EE);
            int i = 0;
            int j = arr.Length - 1;
            while (i < j)
            {
                string[] tmp = arr[i].Split(Att.SP_SQL_KV);
                if (tmp.Length < 5)
                {
                    return;
                }

                if (!CharUtil.IsValidateLong(tmp[1]))
                {
                    return;
                }
                Att item = Att.GetInstance(int.Parse(tmp[1]), tmp[3], tmp[4]);
                item.Id = tmp[0];
                item.Name = tmp[2];
                item.Order = (++i).ToString();
                item.DecodeSpec(tmp, 5);
                list.Add(item);
            }
        }