Example #1
0
        public void BehaviorKeyboardShortcuts()
        {
            ExposeProtectedMethods tsmi = new ExposeProtectedMethods();

            tsmi.ShortcutKeys = Keys.Control | Keys.D;

            Message m = new Message();

            Assert.AreEqual(false, tsmi.PublicProcessCmdKey(ref m, Keys.D), "A1");
            Assert.AreEqual(false, tsmi.PublicProcessCmdKey(ref m, Keys.Control), "A2");
            Assert.AreEqual(true, tsmi.PublicProcessCmdKey(ref m, Keys.Control | Keys.D), "A3");
            Assert.AreEqual(false, tsmi.PublicProcessCmdKey(ref m, Keys.A), "A4");
            Assert.AreEqual(false, tsmi.PublicProcessCmdKey(ref m, Keys.Control | Keys.A), "A5");

            tsmi.ShowShortcutKeys = false;
            Assert.AreEqual(true, tsmi.PublicProcessCmdKey(ref m, Keys.Control | Keys.D), "A6");

            tsmi.ShortcutKeyDisplayString = "Moose";
            Assert.AreEqual(true, tsmi.PublicProcessCmdKey(ref m, Keys.Control | Keys.D), "A7");
        }
		public void BehaviorKeyboardShortcuts ()
		{
			ExposeProtectedMethods tsmi = new ExposeProtectedMethods ();
			tsmi.ShortcutKeys = Keys.Control | Keys.D;

			Message m = new Message ();
			Assert.AreEqual (false, tsmi.PublicProcessCmdKey (ref m, Keys.D), "A1");
			Assert.AreEqual (false, tsmi.PublicProcessCmdKey (ref m, Keys.Control), "A2");
			Assert.AreEqual (true, tsmi.PublicProcessCmdKey (ref m, Keys.Control | Keys.D), "A3");
			Assert.AreEqual (false, tsmi.PublicProcessCmdKey (ref m, Keys.A), "A4");
			Assert.AreEqual (false, tsmi.PublicProcessCmdKey (ref m, Keys.Control | Keys.A), "A5");
			
			tsmi.ShowShortcutKeys = false;
			Assert.AreEqual (true, tsmi.PublicProcessCmdKey (ref m, Keys.Control | Keys.D), "A6");
			
			tsmi.ShortcutKeyDisplayString = "Moose";
			Assert.AreEqual (true, tsmi.PublicProcessCmdKey (ref m, Keys.Control | Keys.D), "A7");
		}