コード例 #1
0
        public void Dupes()
        {
            string         Storage = _TestSingleTon.TESTDATABASE;
            List <KeyData> Hotkeys = new List <KeyData>();

            Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguida"));
            HotKeyConfig hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType);

            hotKeyConfig.GetConfigPanel();
            Assert.AreEqual(0, hotKeyConfig.Duplicates, "1");

            Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidb"));
            hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType);
            hotKeyConfig.GetConfigPanel();
            Assert.AreEqual(1, hotKeyConfig.Duplicates, "2");


            Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.X, Constants.BLANK, false, "dualscreenguidc"));
            hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType);
            hotKeyConfig.GetConfigPanel();
            Assert.AreEqual(1, hotKeyConfig.Duplicates, "2b");

            Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.C, Constants.BLANK, false, "dualscreenguidd"));
            Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.C, Constants.BLANK, false, "dualscreenguide"));

            hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType);
            hotKeyConfig.GetConfigPanel();
            Assert.AreEqual(2, hotKeyConfig.Duplicates, "3");
        }
コード例 #2
0
        public static void SaveHotkeyConfig(HotKeyConfig cfg)
        {
            var sw = new StreamWriter(new FileStream(AppDomain.CurrentDomain.BaseDirectory + "cfg", FileMode.Truncate));

            sw.WriteLine(cfg.enabled.ToString() + ";" + cfg.hotkeyIndex.ToString());
            sw.Close();
        }
コード例 #3
0
        public void BlankDatabase()
        {
            string         Storage = CoreUtilities.Constants.BLANK;
            List <KeyData> Hotkeys = new List <KeyData>();

            Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguida"));
            HotKeyConfig hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType);
        }
コード例 #4
0
        public void AssureNoDamageDone()
        {
            // lame test but you never know. Makes sure that nothing is lost after creating the panel in the original hotkeys
            string Storage=_TestSingleTon.TESTDATABASE;
            List<KeyData> Hotkeys = new List<KeyData>();
            Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguida"));
            Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidb"));
            Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidc"));
            Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidd"));

            int count = Hotkeys.Count;
            HotKeyConfig hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType);
            hotKeyConfig.GetConfigPanel();

            Assert.AreEqual(count, Hotkeys.Count);
        }
コード例 #5
0
        public void AssureNoDamageDone()
        {
            // lame test but you never know. Makes sure that nothing is lost after creating the panel in the original hotkeys
            string         Storage = _TestSingleTon.TESTDATABASE;
            List <KeyData> Hotkeys = new List <KeyData>();

            Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguida"));
            Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidb"));
            Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidc"));
            Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidd"));

            int          count        = Hotkeys.Count;
            HotKeyConfig hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType);

            hotKeyConfig.GetConfigPanel();

            Assert.AreEqual(count, Hotkeys.Count);
        }
コード例 #6
0
        public void Dupes()
        {
            string Storage=_TestSingleTon.TESTDATABASE;
            List<KeyData> Hotkeys = new List<KeyData>();
            Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguida"));
            HotKeyConfig hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType);
            hotKeyConfig.GetConfigPanel();
            Assert.AreEqual(0, hotKeyConfig.Duplicates,"1");

            Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidb"));
            hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType);
            hotKeyConfig.GetConfigPanel();
            Assert.AreEqual(1, hotKeyConfig.Duplicates,"2");

            Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.X, Constants.BLANK, false, "dualscreenguidc"));
            hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType);
            hotKeyConfig.GetConfigPanel();
            Assert.AreEqual(1, hotKeyConfig.Duplicates,"2b");

            Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.C, Constants.BLANK, false, "dualscreenguidd"));
            Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.C, Constants.BLANK, false, "dualscreenguide"));

            hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType);
            hotKeyConfig.GetConfigPanel();
            Assert.AreEqual(2, hotKeyConfig.Duplicates,"3");
        }
コード例 #7
0
 public void BlankDatabase()
 {
     string Storage=CoreUtilities.Constants.BLANK;
     List<KeyData> Hotkeys = new List<KeyData>();
     Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguida"));
     HotKeyConfig hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType);
 }