示例#1
0
 public void OnUnload()
 {
     MyControl c = new MyControl ();
     EventArgs e = new EventArgs ();
     c.AdapterCallOnUnload (e);
     Assert.AreEqual (e, c.on_unload_arg, "OnUnload #1");
 }
示例#2
0
 public void Page()
 {
     MyControl c = new MyControl ();
     c.Page = new Page ();
     c.AdapterGetPage ();
     Assert.AreEqual (c.Page, c.AdapterGetPage (), "Page #1");
 }
示例#3
0
 public void OnPreRender()
 {
     MyControl c = new MyControl ();
     EventArgs e = new EventArgs ();
     c.AdapterCallOnPreRender (e);
     Assert.AreEqual (e, c.on_pre_render_arg, "OnPreRender #1");
 }
示例#4
0
 public void Dispose()
 {
     if (this._nextClipboardViewer.HasValue)
     {
         try
         {
             if (this._control != null)
             {
                 ClipboardMonitor.ChangeClipboardChain(this._control.Handle, this._nextClipboardViewer.Value);
             }
         }
         catch
         { }
         this._nextClipboardViewer = null;
     }
     if (this._control != null)
     {
         try
         { this._control.Dispose(); }
         catch
         { }
         this._control = null;
     }
     if (this._listener != null)
     {
         try
         {
             this._listener.Closed -= this.ListenerClosed;
         }
         catch
         { }
         this._listener = null;
     }
 }
            public MyGuiControlAssignKeyMessageBox(MyGuiInputDeviceEnum deviceType, MyControl controlBeingSet, MyStringId messageText) : base(
                    styleEnum: MyMessageBoxStyleEnum.Error,
                    buttonType: MyMessageBoxButtonsType.NONE,
                    messageText: MyTexts.Get(messageText),
                    messageCaption: MyTexts.Get(MySpaceTexts.SelectControl),
                    okButtonText: default(MyStringId),
                    cancelButtonText: default(MyStringId),
                    yesButtonText: default(MyStringId),
                    noButtonText: default(MyStringId),
                    callback: null,
                    timeoutInMiliseconds: 0,
                    focusedResult: ResultEnum.YES,
                    canHideOthers: true,
                    size: null)
            {
                DrawMouseCursor   = false;
                m_isTopMostScreen = false;
                m_controlBeingSet = controlBeingSet;
                m_deviceType      = deviceType;

                MyInput.Static.GetListOfPressedKeys(m_oldPressedKeys);
                MyInput.Static.GetListOfPressedMouseButtons(m_oldPressedMouseButtons);
                m_closeOnEsc = false;
                CanBeHidden  = true;
            }
示例#6
0
 public void OnInit()
 {
     MyControl c = new MyControl ();
     EventArgs e = new EventArgs ();
     c.AdapterCallOnInit (e);
     Assert.AreEqual (e, c.on_init_arg, "OnInit #1");
 }
示例#7
0
        public void When_DependencyProperty_FallbackValue_binding()
        {
            MyControl.MyPropertyProperty.ToString();

            var SUT = new MyControl();

            SUT.SetBinding(MyControl.MyPropertyProperty, new Binding("TargetValue")
            {
                FallbackValue = 42
            });

            Assert.AreEqual(42, SUT.MyProperty);

            var source = new Target2();

            source.TargetValue = 10;
            SUT.DataContext    = source;

            Assert.AreEqual(10, SUT.MyProperty);

            SUT.DataContext = null;

            Assert.AreEqual(42, SUT.MyProperty);

            SUT.DataContext = source;

            Assert.AreEqual(10, SUT.MyProperty);
        }
示例#8
0
		public void Render ()
		{
			MyControl c = new MyControl();
			MyHtmlTextWriter w = new MyHtmlTextWriter ();
			c.AdapterCallRender (w);
			Assert.IsTrue (c.render_called, "Render #1");
		}
示例#9
0
        public void When_DependencyProperty_FallbackValue_VisibilityStringConversion_binding()
        {
            MyControl.MyPropertyProperty.ToString();

            var SUT    = new MyControl();
            var source = new Target2();

            Assert.AreEqual(Visibility.Visible, SUT.MyVisibilityProperty);

            SUT.SetBinding(MyControl.MyVisibilityPropertyProperty, new Binding("Object")
            {
                FallbackValue = "Collapsed"
            });
            Assert.AreEqual(Visibility.Collapsed, SUT.MyVisibilityProperty);

            SUT.DataContext = source;
            Assert.AreEqual(Visibility.Visible, SUT.MyVisibilityProperty);

            source.Object = 10;
            Assert.AreEqual(Visibility.Collapsed, SUT.MyVisibilityProperty);

            source.Object = Visibility.Visible;
            Assert.AreEqual(Visibility.Visible, SUT.MyVisibilityProperty);

            SUT.DataContext = null;
            Assert.AreEqual(Visibility.Collapsed, SUT.MyVisibilityProperty);
        }
示例#10
0
        public void When_DependencyProperty_TargetNullValue_binding()
        {
            var tomato = SolidColorBrushHelper.Tomato;

            MyControl.MyPropertyProperty.ToString();

            var SUT = new MyControl();

            SUT.SetBinding(MyControl.MyBrushPropertyProperty, new Binding("Brush")
            {
                TargetNullValue = tomato
            });

            var source = new Target2();

            SUT.DataContext = source;

            source.Brush = null;
            Assert.AreEqual(tomato, SUT.MyBrushProperty);

            source.Brush = SolidColorBrushHelper.Olive;
            Assert.AreEqual(SolidColorBrushHelper.Olive.Color, (SUT.MyBrushProperty as SolidColorBrush)?.Color);

            source.Brush = null;
            Assert.AreEqual(tomato, SUT.MyBrushProperty);
        }
示例#11
0
 public void RenderChildren()
 {
     MyControl c = new MyControl ();
     MyHtmlTextWriter w = new MyHtmlTextWriter ();
     c.AdapterCallRenderChildren (w);
     Assert.IsTrue (c.render_children_called, "RenderChildren #1");
 }
示例#12
0
        public static void Browser_OnInit(Page p)
        {
            MyControl c = new MyControl ();
            p.Controls.Add (c);

            Assert.AreEqual (p.Request.Browser, c.AdapterGetBrowser (), "Browser #1");
        }
示例#13
0
        private void flp_DragDrop(object sender, DragEventArgs e)
        {
            MyControl ctrl = (MyControl)e.Data.GetData(typeof(MyControl));
            var       flp  = sender as FlowLayoutPanel;

            PrebaciIgraca(flp, ctrl);
        }
示例#14
0
 private void LoadPlayers(Team_Statistics x, string f_code)
 {
     {
         foreach (var player in x.Starting_Eleven)
         {
             var control = new MyControl();
             control.Controls["lblName"].Text     = player.Name ?? MISSING_DATA;
             control.Controls["lblNumber"].Text   = player.Shirt_Number.ToString();
             control.Controls["lblPosition"].Text = player.Position ?? MISSING_DATA;
             control.Controls["lblCaptain"].Text  = player.Captain == true ? Resources.Pozitivno : Resources.Negativno;
             SetPlayerPicture(control, player.Name);
             flpIgraci.Controls.Add(control);
         }
         foreach (var sub in x.Substitutes)
         {
             var control = new MyControl();
             control.Controls["lblName"].Text     = sub.Name ?? MISSING_DATA;
             control.Controls["lblNumber"].Text   = sub.Shirt_Number.ToString();
             control.Controls["lblPosition"].Text = sub.Position ?? MISSING_DATA;
             control.Controls["lblCaptain"].Text  = sub.Captain == true ? Resources.Pozitivno : Resources.Negativno;
             SetPlayerPicture(control, sub.Name);
             flpIgraci.Controls.Add(control);
         }
     }
 }
示例#15
0
 public MyToolWindow()
     : base(null)
 {
     Caption          = Properties.Resources.WindowTitle;
     BitmapResourceID = 0x12d;
     BitmapIndex      = 2;
     control          = new MyControl(this);
 }
示例#16
0
 public void PageAdapter()
 {
     MyControl c = new MyControl ();
     PageAdapter pa = new MyPageAdapter ();
     c.Page = new MyPage (pa);
     c.AdapterGetPageAdapter ();
     Assert.AreEqual (c.Page.PageAdapter, c.AdapterGetPageAdapter (), "PageAdapter #1");
 }
示例#17
0
            public ControlWithDescription(MyGameControlEnums control1, MyGameControlEnums control2)
            {
                MyControl c1 = MyGuiManager.GetInput().GetGameControl(control1);
                MyControl c2 = MyGuiManager.GetInput().GetGameControl(control2);

                Control     = new StringBuilder().Append(c1.GetControlButtonStringBuilder(MyGuiInputDeviceEnum.Keyboard)).Append(", ").Append(c2.GetControlButtonStringBuilder(MyGuiInputDeviceEnum.Keyboard));
                Description = new StringBuilder().Append(MyTextsWrapper.Get(c1.GetControlName())).Append(" / ").Append(MyTextsWrapper.Get(c2.GetControlName()));
            }
 private MyGuiScreenMessageBox MakeControlIsAlreadyAssignedDialog(MyControl controlAlreadySet, StringBuilder controlButtonName)
 {
     return(MyGuiSandbox.CreateMessageBox(
                buttonType: MyMessageBoxButtonsType.YES_NO,
                messageText: new StringBuilder(string.Format(MyTexts.GetString(MyCommonTexts.ControlAlreadyAssigned),
                                                             controlButtonName,
                                                             MyTexts.Get(controlAlreadySet.GetControlName()))),
                messageCaption: MyTexts.Get(MyCommonTexts.CanNotAssignControl)));
 }
            private void OverwriteAssignment(MyControl controlAlreadySet, MyMouseButtonsEnum button)
            {
                Debug.Assert(controlAlreadySet != null);
                Debug.Assert(m_deviceType == MyGuiInputDeviceEnum.Mouse);
                Debug.Assert(controlAlreadySet.GetMouseControl() == button);

                controlAlreadySet.SetControl(MyMouseButtonsEnum.None);
                m_controlBeingSet.SetControl(button);
            }
 public void Start()
 {
     // ID must be set here.
     _myControlId = 1;
     MyControl myControl = new MyControl();
     myControl.Start(_myControlId);
     
     GridContainer.Children.Add(myControl);
 }
示例#21
0
    private void UpdateVariables()
    {
        _pullSpeed              = SettingsComponent.gl_PullSpeed;
        _distanceFromDetach     = SettingsComponent.gl_distanceFromDetach;
        _legalWallShootingRange = SettingsComponent.gl_minimumHookRange;

        _shootHook   = new MyControl("ShootGrapplingHook" + SettingsComponent.ControllerSuffix);
        _releaseHook = new MyControl("ReleaseGrapplingHook" + SettingsComponent.ControllerSuffix);
    }
 private void ShowControlIsAlreadyAssigned(MyControl control)
 {
     MyGuiManager.AddScreen(new MyGuiScreenMessageBox(MyMessageBoxType.ERROR,
                                                      new StringBuilder(string.Format(MyTextsWrapper.Get(MyTextsWrapperEnum.ControlAlreadyAssigned).ToString(), control.GetControlButtonName(m_deviceType), MyTextsWrapper.Get(control.GetControlName()).ToString())),
                                                      MyTextsWrapper.Get(MyTextsWrapperEnum.CanNotAssignControl), MyTextsWrapperEnum.Yes, MyTextsWrapperEnum.No,
                                                      delegate(MyGuiScreenMessageBoxCallbackEnum r)
     {
         AssignAlreadyAssignedCommand(r, control);
     }));
 }
            public ControlWithDescription(MyStringId control)
            {
                MyControl c = MyInput.Static.GetGameControl(control);

                BoundButtons = null;
                c.AppendBoundButtonNames(ref BoundButtons, unassignedText: MyInput.Static.GetUnassignedName());
                Description = MyTexts.Get(c.GetControlDescription() ?? c.GetControlName());
                LeftFont    = MyFontEnum.Red;
                RightFont   = MyFontEnum.White;
            }
示例#24
0
 public void OnTriggerEnter(Collider other)
 {
     if (other.tag == Player)
     {
         myControl = other.GetComponent <MyControl>();
         other.SendMessage("displayTipMessage", "SPEEEEEEED!");
         myControl.SpeedBonusEffect.Play();
         this.SpeedBonusBall.Stop();
         isOn = true;
     }
 }
示例#25
0
 public ClipboardMonitor(Form listener)
 {
     if (listener == null)
     {
         throw new ArgumentNullException("listener");
     }
     this._listener = listener;
     this._listener.Closed += this.ListenerClosed;
     this._control = new MyControl(this);
     this._nextClipboardViewer = ClipboardMonitor.SetClipboardViewer(this._control.Handle);
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            String         connectionString = WebConfigurationManager.ConnectionStrings["DBLENGUAJES"].ToString();
            ClientBusiness clientBusiness   = new ClientBusiness(connectionString);

            String clientName = (String)Session["name"];

            LinkedList <Item> cart = clientBusiness.getCart(clientName, Util.getAppDate());

            if (cart.Count == 0)
            {
                cartHolder.Controls.Add(new LiteralControl("<h2 class=\"text-center bg-warning\">"));
                cartHolder.Controls.Add(new LiteralControl("No hay articulos en el carrito"));
                cartHolder.Controls.Add(new LiteralControl("<h2>"));
                return;
            }

            cartHolder.Controls.Add(new LiteralControl("<table class=\"table table-hover text-center\">"));

            cartHolder.Controls.Add(new LiteralControl(MyControl.TableHeader("Nombre")));
            cartHolder.Controls.Add(new LiteralControl(MyControl.TableHeader("Precio")));
            cartHolder.Controls.Add(new LiteralControl(
                                        MyControl.TableHeader("Cantidad a comprar")
                                        ));

            foreach (Item item in cart)
            {
                cartHolder.Controls.Add(new LiteralControl("<tr>"));

                cartHolder.Controls.Add(new LiteralControl(MyControl.TableItem(item.Name)));
                cartHolder.Controls.Add(new LiteralControl(MyControl.TableItem("¢" + item.Price.ToString())));


                TextBox tbQuantity = new TextBox();
                tbQuantity.ID       = item.Code.ToString();
                tbQuantity.TextMode = TextBoxMode.Number;
                tbQuantity.Text     = "0";
                tbQuantity.CssClass = "form-control";

                this.textboxes.AddLast(tbQuantity);

                cartHolder.Controls.Add(new LiteralControl("<td>"));
                cartHolder.Controls.Add(tbQuantity);
                cartHolder.Controls.Add(new LiteralControl("</td>"));

                cartHolder.Controls.Add(new LiteralControl("</tr>"));
            }

            cartHolder.Controls.Add(new LiteralControl("</table>"));

            cartHolder.Controls.Add(new LiteralControl("\n <button type=\"button\" class=\"btn btn-primary\" data-target=\"#checkModal\" data-toggle=\"modal\">"));
            cartHolder.Controls.Add(new LiteralControl("Comprar"));
            cartHolder.Controls.Add(new LiteralControl("</button>"));
        }
        public void RemovedControlDoesNotActiveteTheWorkItem()
        {
            TestableRootWorkItem workItem    = new TestableRootWorkItem();
            MyControl            testControl = new MyControl();

            workItem.Items.Add(testControl);

            workItem.Items.Remove(testControl);

            testControl.FireEnter();
            Assert.IsFalse(workItem.Status == WorkItemStatus.Active);
        }
示例#28
0
    public void MyMethod()
    {
        //...
        var control = new MyControl(123);

        if (string.IsNullOrEmpty(error))
        {
            return;
        }
        control.text = error;
        //...
    }
示例#29
0
        static async Task Main(string[] args)
        {
            Console.WriteLine(SynchronizationContext.Current?.ToString() ?? "null");
            MyControl my = new MyControl();

            Console.WriteLine(SynchronizationContext.Current?.ToString() ?? "null");

            var   task = Task.Run(() => { });
            await task;

            Thread.Sleep(-1);
        }
示例#30
0
        protected override void InitInput()
        {
            base.InitInput();

            // Add signals render mode toggle control
            MyGuiDescriptor helper = new MyGuiDescriptor(MyCommonTexts.ControlName_ToggleSignalsMode, MyCommonTexts.ControlName_ToggleSignalsMode_Tooltip);

            MyGuiGameControlsHelpers.Add(MyControlsSpace.TOGGLE_SIGNALS, helper);
            MyControl control = new MyControl(MyControlsSpace.TOGGLE_SIGNALS, helper.NameEnum, MyGuiControlTypeEnum.Systems1, null, MyKeys.H, description: helper.DescriptionEnum);

            MyInput.Static.AddDefaultControl(MyControlsSpace.TOGGLE_SIGNALS, control);
        }
示例#31
0
 public void ShowOpaqueLayer()
 {
     if (MyControl.InvokeRequired)
     {
         MyFunc f = ShowOpaqueLayer;
         MyControl.Invoke(f, null);
     }
     else
     {
         cmd.ShowOpaqueLayer(MyControl, Alpha, IsShowLoadingImage);
     }
 }
        private void RefreshButtonTexts(List <MyGuiControlButton> buttons)
        {
            StringBuilder tmp = null;

            foreach (var button in buttons)
            {
                var data = (ControlButtonData)button.UserData;
                data.Control.AppendBoundButtonNames(ref tmp, data.Device);
                MyControl.AppendUnknownTextIfNeeded(ref tmp, MyTexts.GetString(MyCommonTexts.UnknownControl_None));
                button.Text = tmp.ToString();
                tmp.Clear();
            }
        }
示例#33
0
    private MethodThatAddsAControl()              //includes includes InitializeComponent as well as several others called at later
    {
        //create a MyControl object and add it to MyForm
        MyControl newControl = new MyControl(this);

        //other initialization as needed
        this.Controls.Add(newControl);             //this will raise MyControl::pForm_ControlAdded

        //create a MyControl object and add it to MyPanel1
        MyControl newControl = new MyControl(MyPanel1);  //pass panel reference

        MyPanel1.Controls.Add(newControl);               //this will raise MyControl::pPanel_ControlAdded
    }
示例#34
0
文件: MainForm.cs 项目: mono/gert
	public MainForm ()
	{
		// 
		// _myControl
		// 
		_myControl = new MyControl ();
		_myControl.Dock = DockStyle.Fill;
		Controls.Add (_myControl);
		// 
		// MainForm
		// 
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #82549";
		Load += new EventHandler (MainForm_Load);
	}
示例#35
0
文件: Connect.cs 项目: niaher/Crool
        /// <summary>Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.</summary>
        /// <param name='application'>Root object of the host application.</param>
        /// <param name='connectMode'>Describes how the Add-in is being loaded.</param>
        /// <param name='addInInst'>Object representing this Add-in.</param>
        /// <seealso class='IDTExtensibility2' />
        public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
        {
            this.InitializeConfig();

            this._ApplicationObject = (DTE2)application;
            this._AddInInstance = (EnvDTE.AddIn)addInInst;

            try
            {
                // ctlProgID - the ProgID for your user control.
                // asmPath - the path to your user control DLL.
                // guidStr - a unique GUID for the user control.
                const string CtlProgId = "Crool.AddIn.Controls.MyControl";
                string asmPath = Assembly.GetExecutingAssembly().Location;
                const string GuidStr = "{1FD0E084-B116-4A94-9E85-0BE6A3DC3181}";

                var toolWins = (Windows2)this._ApplicationObject.Windows;

                // Create the new tool window, adding your user control.
                object objTemp = null;
                Window toolWin = toolWins.CreateToolWindow2(this._AddInInstance, asmPath, CtlProgId, "Crool Window", GuidStr, ref objTemp);

                this._UserControl = (MyControl)objTemp;
                this._UserControl.Application = this._ApplicationObject;
                this._UserControl.Initialize();

                // The tool window must be visible before you do anything
                // with it, or you will get an error.
                toolWin.Visible = true;

                // Set the new tool window's height and width.
                toolWin.Height = 600;
                toolWin.Width = 400;
                toolWin.IsFloating = false;
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show("Exception: " + ex.Message);
            }
        }
示例#36
0
		public void OnInit ()
		{
			MyControl c = new MyControl ();
			EventArgs e = new EventArgs ();
			c.AdapterCallOnInit (e);
			Assert.AreEqual (e, c.on_init_arg, "OnInit #1");
		}
示例#37
0
文件: BindingTest.cs 项目: dfr0/moon
		public static void SetAttached(DependencyObject o, MyControl value)
		{
			o.SetValue(AttachedProperty, value);
		}
示例#38
0
		public void CreateChildControls ()
		{
			MyControl c = new MyControl ();
			c.AdapterCallCreateChildControls ();
			Assert.IsTrue (c.create_child_controls_called, "CreateChildControls #1");
		}
示例#39
0
		public static void Browser_OnInit (Page p) 
		{
			MyControl c = new MyControl ();
			p.Controls.Add (c);

			Assert.AreEqual (p.Request.Browser, c.AdapterGetBrowser (), "Browser #1");
		}
示例#40
0
		public void PageAdapter ()
		{
			MyControl c = new MyControl ();
			PageAdapter pa = new MyPageAdapter ();
			c.Page = new MyPage (pa);
			c.AdapterGetPageAdapter ();
			Assert.AreEqual (c.Page.PageAdapter, c.AdapterGetPageAdapter (), "PageAdapter #1");
		}
示例#41
0
		public void Page ()
		{
			MyControl c = new MyControl ();
			c.Page = new Page ();
			c.AdapterGetPage ();
			Assert.AreEqual (c.Page, c.AdapterGetPage (), "Page #1");
		}
示例#42
0
		public void MnemonicCalledWhenCanSelectFalse ()
		{
			MyForm f = new MyForm ();
			f.ShowInTaskbar = false;
			
			MyControl c = new MyControl ();
			
			f.Controls.Add (c);
			f.Show ();
			
			Assert.AreEqual (false, c.CanSelect, "A1");
			f.PublicProcessMnemonic ('b');
			
			Assert.AreEqual (true, c.mnemonic_called, "A2");
			f.Dispose ();
		}
示例#43
0
		public void OnPreRender ()
		{
			MyControl c = new MyControl ();
			EventArgs e = new EventArgs ();
			c.AdapterCallOnPreRender (e);
			Assert.AreEqual (e, c.on_pre_render_arg, "OnPreRender #1");
		}
示例#44
0
		[Test]  // bug #81397
		public void TestDockingWithCustomDisplayRectangle ()
		{
			MyControl mc = new MyControl ();
			mc.Size = new Size (200, 200);
			
			Control c = new Control ();
			c.Dock = DockStyle.Fill;
			
			mc.Controls.Add (c);
			
			Form f = new Form ();
			f.ShowInTaskbar = false;
			
			f.Controls.Add (mc);
			f.Show ();
			
			Assert.AreEqual (new Point (20, 20), c.Location, "A1");
			Assert.AreEqual (new Size (160, 160), c.Size, "A2");
			
			f.Dispose ();
		}
示例#45
0
		public void OnUnload ()
		{
			MyControl c = new MyControl ();
			EventArgs e = new EventArgs ();
			c.AdapterCallOnUnload (e);
			Assert.AreEqual (e, c.on_unload_arg, "OnUnload #1");
		}
示例#46
0
文件: BindingTest.cs 项目: dfr0/moon
		public void AttachedProperty_ClashWithCLRProperty_sl3()
		{
			// Check to ensure we do *not* use the type converter
			// declared on the CLR property as this is an attached DP.
			var dp = AttachedDPPropertyClash.AttachedProperty;
			var value = new MyControl();
			var source = new AttachedDPPropertyClash();
			var target = new Rectangle ();
			source.SetValue(dp, value);

			BindingOperations.SetBinding(target, Rectangle.DataContextProperty, new Binding("Attached") { Mode = BindingMode.TwoWay, Source = source });
			Assert.AreSame (source.GetValue (dp), target.DataContext, "#1");

			target.DataContext = 123;
			Assert.AreSame(value, source.GetValue(dp), "#2");
		}
示例#47
0
		public void MethodPreProcessMessage ()
		{
			bool testing_callstack = false;

			MyControl c = new MyControl ();
			Message m = new Message ();
			m.HWnd = c.Handle;
			m.Msg = WM_KEYDOWN;
			m.WParam = (IntPtr)Keys.Down;
			m.LParam = IntPtr.Zero;

			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (false, c.PreProcessMessage (ref m), "A1");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());

			c.SetState (State.OnPreviewKeyDown);
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (false, c.PreProcessMessage (ref m), "A2");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());

			c.SetState (State.ProcessCmdKey);
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (true, c.PreProcessMessage (ref m), "A3");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());

			c.SetState (State.IsInputKey);
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (false, c.PreProcessMessage (ref m), "A4");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());

			c.SetState (State.ProcessDialogKey);
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (true, c.PreProcessMessage (ref m), "A5");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());


			m.Msg = WM_CHAR;
			c.SetState (State.None);
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (false, c.PreProcessMessage (ref m), "A6");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());

			c.SetState (State.IsInputChar);
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (false, c.PreProcessMessage (ref m), "A7");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());

			c.SetState (State.ProcessDialogChar);
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (true, c.PreProcessMessage (ref m), "A8");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());


			m.Msg = WM_SYSCHAR;
			c.SetState (State.None);
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (false, c.PreProcessMessage (ref m), "A9");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());

			c.SetState (State.IsInputChar);
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (false, c.PreProcessMessage (ref m), "A10");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());

			c.SetState (State.ProcessDialogChar);
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (true, c.PreProcessMessage (ref m), "A11");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());


			m.Msg = WM_KEYUP;
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (false, c.PreProcessMessage (ref m), "A12");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());

			c.SetState (State.OnPreviewKeyDown);
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (false, c.PreProcessMessage (ref m), "A13");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());

			c.SetState (State.ProcessCmdKey);
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (false, c.PreProcessMessage (ref m), "A14");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());

			c.SetState (State.IsInputKey);
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (false, c.PreProcessMessage (ref m), "A15");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());

			c.SetState (State.ProcessDialogKey);
			if (testing_callstack) Console.WriteLine ("Start");
			Assert.AreEqual (false, c.PreProcessMessage (ref m), "A16");
			if (testing_callstack) Console.WriteLine ("End {0}\n", m.WParam.ToString ());
		}