示例#1
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);
            }
        }
示例#2
0
文件: SafeModel.cs 项目: burstas/rmps
 /// <summary>
 /// 徽标
 /// </summary>
 /// <returns></returns>
 public LogoAtt InitLogo()
 {
     LogoAtt logo = new LogoAtt { Order = "徽标" };
     logo.Id = (_Key.AttIndex++).ToString();
     _AttList.Add(logo);
     return logo;
 }
示例#3
0
文件: UcLogoAtt.cs 项目: burstas/rmps
        public bool ShowData(Att att)
        {
            _Att = att as LogoAtt;

            if (_Att != null)
            {
                TbData.Text = _Att.Data;
                if (_Att.SmallIcon == null)
                {
                    if (!CharUtil.IsValidateHash(_Att.Text))
                    {
                        _Att.SmallIcon = BeanUtil.NaN16;
                    }
                    else
                    {
                        _Att.SmallIcon = _Att.LoadImage(_DataModel.KeyDir, _Att.GetSpec(LogoAtt.SPEC_LOGO_DIR), _Att.Text, CApp.IMG_KEY_EDIT_EXT, BeanUtil.NaN16);
                    }
                }
                PbLogo.Image = _Att.SmallIcon;
            }

            return true;
        }