public void PropertyAutoSize ()
		{
			Control c = new Control ();
			EventWatcher ew = new EventWatcher (c);

			c.AutoSize = true;
			Assert.AreEqual (true, c.AutoSize, "B1");
			Assert.AreEqual ("AutoSizeChanged", ew.ToString (), "B2");

			ew.Clear ();
			c.AutoSize = true;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
		public void PropertyAllowDrop ()
		{
			Control c = new Control ();
			EventWatcher ew = new EventWatcher (c);

			c.AllowDrop = true;
			Assert.AreEqual (true, c.AllowDrop, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			c.AllowDrop = true;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
		public void PropertyAnchor ()
		{
			Control c = new Control ();
			EventWatcher ew = new EventWatcher (c);

			c.Anchor = AnchorStyles.Bottom;
			Assert.AreEqual (AnchorStyles.Bottom, c.Anchor, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			c.Anchor = AnchorStyles.Bottom;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
		public void PropertyMarqueeAnimationSpeed ()
		{
			ToolStripProgressBar tsi = new ToolStripProgressBar ();
			EventWatcher ew = new EventWatcher (tsi);

			tsi.MarqueeAnimationSpeed = 200;
			Assert.AreEqual (200, tsi.MarqueeAnimationSpeed, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			tsi.MarqueeAnimationSpeed = 200;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
		public void PropertyBackColor ()
		{
			ToolStripContentPanel tsp = new ToolStripContentPanel ();
			EventWatcher ew = new EventWatcher (tsp);

			tsp.BackColor = Color.Green;
			Assert.AreEqual (Color.Green, tsp.BackColor, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			tsp.BackColor = Color.Green;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
		public void PropertyBackColor ()
		{
			Control c = new Control ();
			EventWatcher ew = new EventWatcher (c);

			c.BackColor = Color.Aquamarine;
			Assert.AreEqual (Color.Aquamarine, c.BackColor, "B1");
			Assert.AreEqual ("BackColorChanged", ew.ToString (), "B2");

			ew.Clear ();
			c.BackColor = Color.Aquamarine;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
		public void PropertyAutoSize ()
		{
			ToolStripPanel tsp = new ToolStripPanel ();
			EventWatcher ew = new EventWatcher (tsp);

			tsp.AutoSize = false;
			Assert.AreEqual (false, tsp.AutoSize, "B1");
			Assert.AreEqual ("AutoSizeChanged", ew.ToString (), "B2");

			ew.Clear ();
			tsp.AutoSize = false;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
        public void PropertyLayoutStyle()
        {
            ToolStrip    ts = new ToolStrip();
            EventWatcher ew = new EventWatcher(ts);

            ts.LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow;
            Assert.AreEqual(ToolStripLayoutStyle.VerticalStackWithOverflow, ts.LayoutStyle, "B1");
            Assert.AreEqual("LayoutCompleted;LayoutStyleChanged", ew.ToString(), "B2");

            ew.Clear();
            ts.LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow;
            Assert.AreEqual(string.Empty, ew.ToString(), "B3");

            ew.Clear();
            ts.LayoutStyle = ToolStripLayoutStyle.Flow;
            Assert.AreEqual("LayoutCompleted;LayoutStyleChanged", ew.ToString(), "B4");
            Assert.AreEqual(typeof(FlowLayoutSettings), ts.LayoutSettings.GetType(), "B5");

            ew.Clear();
            ts.LayoutStyle = ToolStripLayoutStyle.Table;
            Assert.AreEqual("LayoutCompleted;LayoutStyleChanged", ew.ToString(), "B6");
            Assert.AreEqual(typeof(TableLayoutSettings), ts.LayoutSettings.GetType(), "B7");
        }
Exemple #9
0
        public void PropertyRenderMode()
        {
            ToolStripPanel tsp = new ToolStripPanel();
            EventWatcher   ew  = new EventWatcher(tsp);

            tsp.RenderMode = ToolStripRenderMode.System;
            Assert.AreEqual(ToolStripRenderMode.System, tsp.RenderMode, "B1");
            // I refuse to call the event twice like .Net does.
            //Assert.AreEqual ("RendererChanged;RendererChanged", ew.ToString (), "B2");

            ew.Clear();
            tsp.RenderMode = ToolStripRenderMode.System;
            //Assert.AreEqual ("RendererChanged", ew.ToString (), "B3");
        }
Exemple #10
0
        public void PropertyText()
        {
            ToolStripProgressBar tsi = new ToolStripProgressBar();
            EventWatcher         ew  = new EventWatcher(tsi);

            tsi.Text = "Hi";
            Assert.AreEqual("Hi", tsi.Text, "B1");
            Assert.AreEqual("Hi", tsi.ProgressBar.Text, "B2");
            Assert.AreEqual(string.Empty, ew.ToString(), "B3");

            ew.Clear();
            tsi.Text = "Hi";
            Assert.AreEqual(string.Empty, ew.ToString(), "B4");
        }
Exemple #11
0
        public void PropertyFont()
        {
            ToolStrip    ts = new ToolStrip();
            EventWatcher ew = new EventWatcher(ts);

            Font f = new Font("Arial", 12);

            ts.Font = f;
            Assert.AreSame(f, ts.Font, "B1");
            Assert.AreEqual("LayoutCompleted", ew.ToString(), "B2");

            ew.Clear();
            ts.Font = f;
            Assert.AreEqual(string.Empty, ew.ToString(), "B3");
        }
        public void PropertyOwner()
        {
            ToolStripItem tsi = new NullToolStripItem();
            EventWatcher  ew  = new EventWatcher(tsi);

            ToolStrip ts = new ToolStrip();

            tsi.Owner = ts;
            Assert.AreSame(ts, tsi.Owner, "B1");
            Assert.AreEqual("OwnerChanged", ew.ToString(), "B2");

            ew.Clear();
            tsi.Owner = ts;
            Assert.AreSame(string.Empty, ew.ToString(), "B3");
        }
        public void PropertyImage()
        {
            ToolStripItem tsi = new NullToolStripItem();
            EventWatcher  ew  = new EventWatcher(tsi);

            Image i = new Bitmap(1, 1);

            tsi.Image = i;
            Assert.AreSame(i, tsi.Image, "B1");
            Assert.AreEqual(string.Empty, ew.ToString(), "B2");

            ew.Clear();
            tsi.Image = i;
            Assert.AreSame(string.Empty, ew.ToString(), "B3");
        }
        public void PropertyBackgroundImage()
        {
            ToolStripControlHost tsi = new ToolStripControlHost(new Control());
            EventWatcher         ew  = new EventWatcher(tsi);

            Image i = new Bitmap(1, 1);

            tsi.BackgroundImage = i;
            Assert.AreSame(i, tsi.BackgroundImage, "B1");
            Assert.AreEqual(string.Empty, ew.ToString(), "B2");

            ew.Clear();
            tsi.BackgroundImage = i;
            Assert.AreSame(string.Empty, ew.ToString(), "B3");
        }
        public void PropertyFont()
        {
            ToolStripControlHost tsi = new ToolStripControlHost(new Control());
            EventWatcher         ew  = new EventWatcher(tsi);

            Font f = new Font("Arial", 12);

            tsi.Font = f;
            Assert.AreSame(f, tsi.Font, "B1");
            Assert.AreEqual(string.Empty, ew.ToString(), "B2");

            ew.Clear();
            tsi.Font = f;
            Assert.AreEqual(string.Empty, ew.ToString(), "B3");
        }
        public void PropertySite()
        {
            ToolStripControlHost tsi = new ToolStripControlHost(new Control());
            EventWatcher         ew  = new EventWatcher(tsi);

            ISite i = new Form().Site;

            tsi.Site = i;
            Assert.AreSame(i, tsi.Site, "B1");
            Assert.AreEqual(string.Empty, ew.ToString(), "B2");

            ew.Clear();
            tsi.Site = i;
            Assert.AreSame(string.Empty, ew.ToString(), "B3");
        }
        public void PropertyLines()
        {
            ToolStripTextBox tsi = new ToolStripTextBox();
            EventWatcher     ew  = new EventWatcher(tsi);

            string[] lines = new string[] { "Apple", "Banana" };
            tsi.Lines = lines;

            Assert.AreEqual(lines, tsi.Lines, "B1");
            Assert.AreEqual(string.Empty, ew.ToString(), "B2");

            ew.Clear();
            tsi.Lines = lines;
            Assert.AreEqual(string.Empty, ew.ToString(), "B3");
        }
        public void PropertySelectedText()
        {
            ToolStripTextBox tsi = new ToolStripTextBox();
            EventWatcher     ew  = new EventWatcher(tsi);

            tsi.Text         = "Crumbelievable";
            tsi.SelectedText = "lie";

            Assert.AreEqual(string.Empty, tsi.SelectedText, "B1");
            Assert.AreEqual("ModifiedChanged", ew.ToString(), "B2");

            ew.Clear();
            tsi.SelectedText = "lie";
            Assert.AreEqual(string.Empty, ew.ToString(), "B3");
        }
Exemple #19
0
        public void PropertyRenderer()
        {
            ToolStrip    ts = new ToolStrip();
            EventWatcher ew = new EventWatcher(ts);

            ToolStripProfessionalRenderer pr = new ToolStripProfessionalRenderer();

            ts.Renderer = pr;
            Assert.AreSame(pr, ts.Renderer, "B1");
            Assert.AreEqual("LayoutCompleted;RendererChanged", ew.ToString(), "B2");
            Assert.AreEqual(ToolStripRenderMode.Custom, ts.RenderMode, "B4");

            ew.Clear();
            ts.Renderer = pr;
            Assert.AreEqual(string.Empty, ew.ToString(), "B3");
        }
        public void PropertySelectedItem()
        {
            ToolStripComboBox tsi = new ToolStripComboBox();
            EventWatcher      ew  = new EventWatcher(tsi);

            tsi.Items.Add("A");
            tsi.Items.Add("B");

            tsi.SelectedItem = "B";
            Assert.AreEqual("B", tsi.SelectedItem, "B1");
            Assert.AreEqual("SelectedIndexChanged", ew.ToString(), "B2");

            ew.Clear();
            tsi.SelectedItem = "B";
            Assert.AreEqual(string.Empty, ew.ToString(), "B3");
        }
		public void PropertyRenderer ()
		{
			ToolStripContentPanel tsp = new ToolStripContentPanel ();
			EventWatcher ew = new EventWatcher (tsp);

			ToolStripProfessionalRenderer pr = new ToolStripProfessionalRenderer ();

			tsp.Renderer = pr;
			Assert.AreSame (pr, tsp.Renderer, "B1");
			Assert.AreEqual (ToolStripRenderMode.Custom, tsp.RenderMode, "B1-2");
			// I refuse to call the event twice like .Net does.
			//Assert.AreEqual ("RendererChanged;RendererChanged", ew.ToString (), "B2");

			ew.Clear ();
			tsp.Renderer = pr;
			//Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
Exemple #22
0
        public void PropertyRenderer()
        {
            ToolStripContentPanel tsp = new ToolStripContentPanel();
            EventWatcher          ew  = new EventWatcher(tsp);

            ToolStripProfessionalRenderer pr = new ToolStripProfessionalRenderer();

            tsp.Renderer = pr;
            Assert.AreSame(pr, tsp.Renderer, "B1");
            Assert.AreEqual(ToolStripRenderMode.Custom, tsp.RenderMode, "B1-2");
            // I refuse to call the event twice like .Net does.
            //Assert.AreEqual ("RendererChanged;RendererChanged", ew.ToString (), "B2");

            ew.Clear();
            tsp.Renderer = pr;
            //Assert.AreEqual (string.Empty, ew.ToString (), "B3");
        }
        public void PropertyAutoCompleteCustomSource()
        {
            ToolStripTextBox tsi = new ToolStripTextBox();
            EventWatcher     ew  = new EventWatcher(tsi);

            AutoCompleteStringCollection acsc = new AutoCompleteStringCollection();

            acsc.AddRange(new string[] { "Apple", "Banana" });

            tsi.AutoCompleteCustomSource = acsc;
            Assert.AreSame(acsc, tsi.AutoCompleteCustomSource, "B1");
            Assert.AreEqual(string.Empty, ew.ToString(), "B2");

            ew.Clear();
            tsi.AutoCompleteCustomSource = acsc;
            Assert.AreEqual(string.Empty, ew.ToString(), "B3");
        }
Exemple #24
0
        public void PropertyMaximumSize()
        {
            Control c = new Control();

            c.Size = new Size(10, 10);

            // Chaning MaximumSize below Size forces a size change
            EventWatcher ew = new EventWatcher(c);

            c.MaximumSize = new Size(5, 5);
            Assert.AreEqual(new Size(5, 5), c.MaximumSize, "B1");
            Assert.AreEqual("Layout;Resize;SizeChanged;ClientSizeChanged", ew.ToString(), "B2");

            // Changing MaximumSize when Size is already smaller or equal doesn't raise any events
            ew.Clear();
            c.MaximumSize = new Size(5, 5);
            Assert.AreEqual(string.Empty, ew.ToString(), "B3");
        }
        public void PropertyForeColor()
        {
            ToolStripControlHost tsi = new ToolStripControlHost(new Control());
            EventWatcher         ew  = new EventWatcher(tsi);

            tsi.ForeColor = Color.BurlyWood;
            Assert.AreEqual(Color.BurlyWood, tsi.ForeColor, "B1");
            Assert.AreEqual(string.Empty, ew.ToString(), "B2");

            ew.Clear();
            tsi.ForeColor = Color.BurlyWood;
            Assert.AreEqual(string.Empty, ew.ToString(), "B3");

            // CausesValidation initially comes from hosted control
            tsi = new ToolStripControlHost(new Button());
            Assert.AreEqual(SystemColors.ControlText, tsi.ForeColor, "B4");

            tsi = new ToolStripControlHost(new TextBox());
            Assert.AreEqual(SystemColors.WindowText, tsi.ForeColor, "B5");
        }
        public void PropertyBackColor()
        {
            ToolStripControlHost tsi = new ToolStripControlHost(new Control());
            EventWatcher         ew  = new EventWatcher(tsi);

            tsi.BackColor = Color.BurlyWood;
            Assert.AreEqual(Color.BurlyWood, tsi.BackColor, "B1");
            Assert.AreEqual(string.Empty, ew.ToString(), "B2");

            ew.Clear();
            tsi.BackColor = Color.BurlyWood;
            Assert.AreEqual(string.Empty, ew.ToString(), "B3");

            // BackColor initially comes from hosted control
            tsi = new ToolStripControlHost(new Button());
            Assert.AreEqual(SystemColors.Control, tsi.BackColor, "B4");

            tsi = new ToolStripControlHost(new TextBox());
            Assert.AreEqual(SystemColors.Window, tsi.BackColor, "B5");

            tsi = new ToolStripControlHost(new ProgressBar());
            Assert.AreEqual(SystemColors.Control, tsi.BackColor, "B6");
        }
Exemple #27
0
		public void PropertyCheckState ()
		{
			ToolStripButton tsi = new ToolStripButton ();
			EventWatcher ew = new EventWatcher (tsi);

			tsi.CheckState = CheckState.Checked;
			Assert.AreEqual (CheckState.Checked, tsi.CheckState, "B1");
			Assert.AreEqual ("CheckedChanged;CheckStateChanged", ew.ToString (), "B2");

			ew.Clear ();
			tsi.CheckState = CheckState.Checked;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
Exemple #28
0
		public void PropertyAutoToolTip ()
		{
			ToolStripButton tsi = new ToolStripButton ();
			EventWatcher ew = new EventWatcher (tsi);

			tsi.AutoToolTip = true;
			Assert.AreEqual (true, tsi.AutoToolTip, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			tsi.AutoToolTip = true;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
Exemple #29
0
		public void PropertyCheckOnClick ()
		{
			ToolStripButton tsi = new ToolStripButton ();
			EventWatcher ew = new EventWatcher (tsi);

			tsi.CheckOnClick = true;
			Assert.AreEqual (true, tsi.CheckOnClick, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			tsi.CheckOnClick = true;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
		public void PropertySite ()
		{
			ToolStripControlHost tsi = new ToolStripControlHost (new Control ());
			EventWatcher ew = new EventWatcher (tsi);

			ISite i = new Form ().Site;
			tsi.Site = i;
			Assert.AreSame (i, tsi.Site, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			tsi.Site = i;
			Assert.AreSame (string.Empty, ew.ToString (), "B3");
		}
		public void PropertyRightToLeft ()
		{
			ToolStripControlHost tsi = new ToolStripControlHost (new Control ());
			EventWatcher ew = new EventWatcher (tsi);

			tsi.RightToLeft = RightToLeft.Yes;
			Assert.AreEqual (RightToLeft.Yes, tsi.RightToLeft, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			tsi.RightToLeft = RightToLeft.Yes;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
Exemple #32
0
		public void PropertyLayoutStyle ()
		{
			ToolStrip ts = new ToolStrip ();
			EventWatcher ew = new EventWatcher (ts);

			ts.LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow;
			Assert.AreEqual (ToolStripLayoutStyle.VerticalStackWithOverflow, ts.LayoutStyle, "B1");
			Assert.AreEqual ("LayoutCompleted;LayoutStyleChanged", ew.ToString (), "B2");

			ew.Clear ();
			ts.LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
		public void PropertySize ()
		{
			ToolStripControlHost tsi = new ToolStripControlHost (new Control ());
			EventWatcher ew = new EventWatcher (tsi);

			tsi.Size = new Size (42, 42);
			Assert.AreEqual (new Size (42, 42), tsi.Size, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			tsi.Size = new Size (42, 42);
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
		public void PropertyOrientation ()
		{
			ToolStripPanel tsp = new ToolStripPanel ();
			EventWatcher ew = new EventWatcher (tsp);

			tsp.Orientation = Orientation.Vertical;
			Assert.AreEqual (Orientation.Vertical, tsp.Orientation, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			tsp.Orientation = Orientation.Vertical;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
		public void PropertyRowMargin ()
		{
			ToolStripPanel tsp = new ToolStripPanel ();
			EventWatcher ew = new EventWatcher (tsp);

			tsp.RowMargin = new Padding (4);
			Assert.AreEqual (new Padding (4), tsp.RowMargin, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			tsp.RowMargin = new Padding (4);
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
Exemple #36
0
		public void PropertyCausesValidation ()
		{
			ToolStrip ts = new ToolStrip ();
			EventWatcher ew = new EventWatcher (ts);

			ts.CausesValidation = true;
			Assert.AreEqual (true, ts.CausesValidation, "B1");
			Assert.AreEqual ("CausesValidationChanged", ew.ToString (), "B2");

			ew.Clear ();
			ts.CausesValidation = true;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
		public void PropertyBackColor ()
		{
			ToolStripControlHost tsi = new ToolStripControlHost (new Control ());
			EventWatcher ew = new EventWatcher (tsi);

			tsi.BackColor = Color.BurlyWood;
			Assert.AreEqual (Color.BurlyWood, tsi.BackColor, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			tsi.BackColor = Color.BurlyWood;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
			
			// BackColor initially comes from hosted control
			tsi = new ToolStripControlHost (new Button ());
			Assert.AreEqual (SystemColors.Control, tsi.BackColor, "B4");

			tsi = new ToolStripControlHost (new TextBox ());
			Assert.AreEqual (SystemColors.Window, tsi.BackColor, "B5");

			tsi = new ToolStripControlHost (new ProgressBar ());
			Assert.AreEqual (SystemColors.Control, tsi.BackColor, "B6");
		}
Exemple #38
0
		public void PropertyCursor ()
		{
			ToolStrip ts = new ToolStrip ();
			EventWatcher ew = new EventWatcher (ts);

			ts.Cursor = Cursors.Cross;
			Assert.AreEqual (Cursors.Cross, ts.Cursor, "B1");
			Assert.AreEqual ("CursorChanged", ew.ToString (), "B2");

			ew.Clear ();
			ts.Cursor = Cursors.Cross;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
Exemple #39
0
		public void PropertyFont ()
		{
			ToolStrip ts = new ToolStrip ();
			EventWatcher ew = new EventWatcher (ts);

			Font f = new Font ("Arial", 12);
			
			ts.Font = f;
			Assert.AreSame (f, ts.Font, "B1");
			Assert.AreEqual ("LayoutCompleted", ew.ToString (), "B2");

			ew.Clear ();
			ts.Font = f;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
Exemple #40
0
		public void PropertyForeColor ()
		{
			ToolStrip ts = new ToolStrip ();
			EventWatcher ew = new EventWatcher (ts);

			ts.ForeColor = Color.BurlyWood;
			Assert.AreEqual (Color.BurlyWood, ts.ForeColor, "B1");
			Assert.AreEqual ("ForeColorChanged", ew.ToString (), "B2");

			ew.Clear ();
			ts.ForeColor = Color.BurlyWood;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
Exemple #41
0
		public void PropertyGripMargin ()
		{
			ToolStrip ts = new ToolStrip ();
			EventWatcher ew = new EventWatcher (ts);

			ts.GripMargin = new Padding (6);
			Assert.AreEqual (new Padding (6), ts.GripMargin, "B1");
			Assert.AreEqual ("LayoutCompleted", ew.ToString (), "B2");

			ew.Clear ();
			ts.GripMargin = new Padding (6);
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
Exemple #42
0
		public void PropertyGripStyle ()
		{
			ToolStrip ts = new ToolStrip ();
			EventWatcher ew = new EventWatcher (ts);

			ts.GripStyle = ToolStripGripStyle.Hidden;
			Assert.AreEqual (ToolStripGripStyle.Hidden, ts.GripStyle, "B1");
			Assert.AreEqual ("LayoutCompleted", ew.ToString (), "B2");

			ew.Clear ();
			ts.GripStyle = ToolStripGripStyle.Hidden;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
		public void PropertyRenderMode ()
		{
			ToolStripPanel tsp = new ToolStripPanel ();
			EventWatcher ew = new EventWatcher (tsp);

			tsp.RenderMode = ToolStripRenderMode.System;
			Assert.AreEqual (ToolStripRenderMode.System, tsp.RenderMode, "B1");
			// I refuse to call the event twice like .Net does.
			//Assert.AreEqual ("RendererChanged;RendererChanged", ew.ToString (), "B2");

			ew.Clear ();
			tsp.RenderMode = ToolStripRenderMode.System;
			//Assert.AreEqual ("RendererChanged", ew.ToString (), "B3");
		}
		public void PropertyText ()
		{
			ToolStripControlHost tsi = new ToolStripControlHost (new Control ());
			EventWatcher ew = new EventWatcher (tsi);

			tsi.Text = "Text";
			Assert.AreEqual ("Text", tsi.Text, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			tsi.Text = "Text";
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
Exemple #45
0
		public void PropertyRenderer ()
		{
			ToolStrip ts = new ToolStrip ();
			EventWatcher ew = new EventWatcher (ts);

			ToolStripProfessionalRenderer pr = new ToolStripProfessionalRenderer ();

			ts.Renderer = pr;
			Assert.AreSame (pr, ts.Renderer, "B1");
			Assert.AreEqual ("LayoutCompleted;RendererChanged", ew.ToString (), "B2");
			Assert.AreEqual (ToolStripRenderMode.Custom, ts.RenderMode, "B4");
			
			ew.Clear ();
			ts.Renderer = pr;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
		public void PropertyDock ()
		{
			ToolStripPanel tsp = new ToolStripPanel ();
			EventWatcher ew = new EventWatcher (tsp);

			tsp.Dock = DockStyle.Left;
			Assert.AreEqual (DockStyle.Left, tsp.Dock, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			tsp.Dock = DockStyle.Left;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
		public void PropertyLocked ()
		{
			ToolStripPanel tsp = new ToolStripPanel ();
			EventWatcher ew = new EventWatcher (tsp);

			tsp.Locked = true;
			Assert.AreEqual (true, tsp.Locked, "B1");
			Assert.AreEqual (string.Empty, ew.ToString (), "B2");

			ew.Clear ();
			tsp.Locked = true;
			Assert.AreEqual (string.Empty, ew.ToString (), "B3");
		}
Exemple #48
0
		public void PropertyRenderMode ()
		{
			ToolStrip ts = new ToolStrip ();
			EventWatcher ew = new EventWatcher (ts);

			ts.RenderMode = ToolStripRenderMode.System;
			Assert.AreEqual (ToolStripRenderMode.System, ts.RenderMode, "B1");
			Assert.AreEqual ("LayoutCompleted;RendererChanged", ew.ToString (), "B2");

			ew.Clear ();
			ts.RenderMode = ToolStripRenderMode.System;
			Assert.AreEqual ("LayoutCompleted;RendererChanged", ew.ToString (), "B3");
		}