Пример #1
0
        public HotKeyManager()
        {
            FullScreenShot FSS = new FullScreenShot();
            Hotkeys.Add(FSS);

            DragScreenShot DSS = new DragScreenShot();
            Hotkeys.Add(DSS);

            HotKeyScreenShot HKSS0 = new HotKeyScreenShot(0);
            Hotkeys.Add(HKSS0);

            HotKeyScreenShot HKSS1 = new HotKeyScreenShot(1, Keys.Alt | Keys.D2, Keys.D2 | Keys.Alt | Keys.Control);
            Hotkeys.Add(HKSS1);

            HotKeyScreenShot HKSS2 = new HotKeyScreenShot(2, Keys.Alt | Keys.D3, Keys.D3 | Keys.Alt | Keys.Control);
            Hotkeys.Add(HKSS2);

            HotKeyScreenShot HKSS3 = new HotKeyScreenShot(3, Keys.Alt | Keys.D4, Keys.D4 | Keys.Alt | Keys.Control);
            Hotkeys.Add(HKSS3);

            WindowScreenShot WSS = new WindowScreenShot();
            Hotkeys.Add(WSS);

            foreach (SShot s in Hotkeys)
            {
                if (s is HotKeyScreenShot)
                    SaveHotKeySet(s as HotKeyScreenShot);
                else if (s is WindowScreenShot)
                    SaveHandleKeySet((WindowScreenShot)s);
                else
                    SaveKeySet(s);
            }
        }
Пример #2
0
 public static Rectangle GetRect(HotKeyScreenShot s)
 {
     string[] str = MainForm.Setting.iniSave.GetSetting("HotKeyRect", s.Code.ToString()).Split('|');
     return new Rectangle(Convert.ToInt32(str[0]), Convert.ToInt32(str[1]), Convert.ToInt32(str[2]), Convert.ToInt32(str[3]));
 }
Пример #3
0
 public static void SaveRect(HotKeyScreenShot s)
 {
     string str = s.Rect.X + "|" + s.Rect.Y + "|" + s.Rect.Width + "|" + s.Rect.Height;
     MainForm.Setting.iniSave.WriteSetting("HotKeyRect", s.Code.ToString(), str);
 }
Пример #4
0
 public static Keys[] GetHotKeySet(HotKeyScreenShot s)
 {
     string[] str = MainForm.Setting.iniSave.GetSetting("HotKey", s.Code.ToString()).Split('|');
     Keys k = (Keys)Enum.Parse(typeof(Keys), str[0]);
     Keys setK = (Keys)Enum.Parse(typeof(Keys), str[1]);
     return new Keys[] { k, setK };
 }
Пример #5
0
 public static void SaveHotKeySet(HotKeyScreenShot s)
 {
     MainForm.Setting.iniSave.WriteSetting("HotKey", s.Code.ToString(), s.Key.ToString() + "|" + s.SetKey.ToString());
 }