Esempio n. 1
0
 /// <summary>
 /// 用于保存搜索关键字,暂未完成
 /// </summary>
 /// <param name="str"></param>
 public static void SaveKeyword(string str)
 {
     if (!string.IsNullOrEmpty(str) && str != "Use keyword to search")
     {
         listOfRecentKeyword.Add(str);
         mKeywordRecent.Insert(str, str);
     }
 }
Esempio n. 2
0
        public void AddHotKey(UserControls.HotKeyVisualItem HKVI)
        {
            int Set = -1;

            if (!EnableHotKey)
            {
                Set = 0;
            }
            else
            {
                if (data.HotKey.KeyValue != HKVI.KeyValue || data.HotKey.ModifiersValue != HKVI.ModifiersValue)
                {
                    Set = 1;
                }
            }
            if (Set > 0)
            {
                int id = 0;
                if (Set == 0)
                {
                    id = ++Anything_wpf_main_.cls.HotKey.CurrentID;
                }
                else if (Set == 1)
                {
                    id = this.data.HotKey.ID;
                }

                HotKeyItem hki = new HotKeyItem(this, HKVI.KeyValue, HKVI.ModifiersValue, id, HotKeyItem.HotKeyParentType.Item);

                this.HotKey = hki;

                if (Manage.CheckAndRegisterHotKey(hki))
                {
                    objDB.Insert("HotKey", data.HotKey.KeyValue.ToString() + "," + data.HotKey.ModifiersValue.ToString() + "," + data.HotKey.ID.ToString());
                }
                EnableHotKey = true;
            }
        }
Esempio n. 3
0
        private void CreateDB()
        {
            objDB = Manage.mMAIN.CreateChildDB(data.ID, true);
            objDB.Insert("ID", data.ID);
            objDB.Insert("Name", data.Name);
            objDB.Insert("Icon", data.Icon.Length.ToString());
            objDB.Insert("Path", data.Path);
            objDB.Insert("Arguments", data.Arguments);
            objDB.Insert("Runas", data.RunAs.ToString());
            objDB.Insert("Autorun", data.AutoRun.ToString());
            objDB.Insert("Levels", data.Levels.ToString());
            objDB.Insert("WorkingDirectory", data.WorkingDirectory);
            objDB.Insert("TagName", data.tagName);
            if (data.HotKey == null)
            {
                data.HotKey = new HotKeyItem(this, System.Windows.Forms.Keys.None, 0, 0, HotKeyItem.HotKeyParentType.Item);
            }

            if (data.HotKey.KeyValue != System.Windows.Forms.Keys.None)
            {
                objDB.Insert("HotKey", data.HotKey.KeyValue.ToString() + "," + data.HotKey.ModifiersValue.ToString() + "," + data.HotKey.ID.ToString());
            }
            else
            {
                objDB.Insert("HotKey", ",,");
            }

            objDB.Insert("EnableHotKey", data.EnableHotKey.ToString());

            if (!Directory.Exists(Manage.IconPath))
            {
                Directory.CreateDirectory(Manage.IconPath);
            }

            try
            {
                using (BinaryWriter bw = new BinaryWriter(new FileStream(Manage.IconPath + data.ID + ".ib", FileMode.Create)))
                {
                    bw.Write(data.Icon);
                    bw.Flush();
                    bw.Close();
                }
            }
            catch
            {
            }
        }