public FrameEditorPresenter(Frame frame, Modello modello) { Debug.Assert(null != modello); _editor = new DoubleBufferControl() { Dock = DockStyle.Fill }; _modelloFrame = modello; _frame = frame; AttachHandlers(); }
//Load Form private void frmMain_Load(object sender, EventArgs e) { this.tmpConfig.Init(this.sAppPath); this.tmpController.ProgressChanged += new Controller.EventHandler(tmpController_ProgressChanged); this.tmpController.Completed += new Controller.EventHandler(tmpController_Completed); this.tmpController.Init(); this.tmpGetIpAdress.Completed += new GetIpAdress.EventHandler(tmpGetIpAdress_Completed); this.tmpGetIpAdress.Init(); this.SetControls(); this.Text = String.Format("{0}{1}", this.Text, File.GetLastWriteTime(Application.ExecutablePath)); DoubleBufferControl.Buffer(this.lbController, true); this.GetMaps(); this.cbConsole.SelectedIndex = 0; }
public void DoubleBufferedStyleTest () { DoubleBufferControl c = new DoubleBufferControl (); TestControlStyle.CheckStyles (c, "#A1", ControlStyles.UserPaint, ControlStyles.StandardClick, ControlStyles.Selectable, ControlStyles.StandardDoubleClick, ControlStyles.AllPaintingInWmPaint, ControlStyles.UseTextForAccessibility); c.IsDoubleBuffered = true; TestControlStyle.CheckStyles (c, "#A2", ControlStyles.UserPaint, ControlStyles.StandardClick, ControlStyles.Selectable, ControlStyles.StandardDoubleClick, ControlStyles.AllPaintingInWmPaint, ControlStyles.UseTextForAccessibility, ControlStyles.OptimizedDoubleBuffer); c.IsDoubleBuffered = false; TestControlStyle.CheckStyles (c, "#A3", ControlStyles.UserPaint, ControlStyles.StandardClick, ControlStyles.Selectable, ControlStyles.StandardDoubleClick, ControlStyles.AllPaintingInWmPaint, ControlStyles.UseTextForAccessibility); c = new DoubleBufferControl (); foreach (ControlStyles style in Enum.GetValues (typeof(ControlStyles))) { c.SetControlStyle (style, false); } TestControlStyle.CheckStyles (c, "#B1"); c.IsDoubleBuffered = true; TestControlStyle.CheckStyles (c, "#B2", ControlStyles.OptimizedDoubleBuffer, ControlStyles.AllPaintingInWmPaint); c.IsDoubleBuffered = false; TestControlStyle.CheckStyles (c, "#B3", ControlStyles.AllPaintingInWmPaint); }
public void DoubleBufferedTest () { DoubleBufferControl c = new DoubleBufferControl (); Assert.IsFalse (c.IsDoubleBuffered, "#A1"); Assert.IsTrue (c.GetControlStyle (ControlStyles.AllPaintingInWmPaint), "#A2"); Assert.IsFalse (c.GetControlStyle (ControlStyles.DoubleBuffer), "#A3"); Assert.IsFalse (c.GetControlStyle (ControlStyles.OptimizedDoubleBuffer), "#A4"); Assert.IsTrue (c.GetControlStyle (ControlStyles.UserPaint), "#A5"); c.SetControlStyle (ControlStyles.OptimizedDoubleBuffer, true); Assert.IsTrue (c.IsDoubleBuffered, "#B1"); Assert.IsTrue (c.GetControlStyle (ControlStyles.AllPaintingInWmPaint), "#B2"); Assert.IsFalse (c.GetControlStyle (ControlStyles.DoubleBuffer), "#B3"); Assert.IsTrue (c.GetControlStyle (ControlStyles.OptimizedDoubleBuffer), "#B4"); Assert.IsTrue (c.GetControlStyle (ControlStyles.UserPaint), "#A5"); c.SetControlStyle (ControlStyles.AllPaintingInWmPaint, false); c.SetControlStyle (ControlStyles.UserPaint, false); Assert.IsTrue (c.IsDoubleBuffered, "#C1"); Assert.IsFalse (c.GetControlStyle (ControlStyles.AllPaintingInWmPaint), "#C2"); Assert.IsFalse (c.GetControlStyle (ControlStyles.DoubleBuffer), "#C3"); Assert.IsTrue (c.GetControlStyle (ControlStyles.OptimizedDoubleBuffer), "#C4"); Assert.IsFalse (c.GetControlStyle (ControlStyles.UserPaint), "#C5"); c.SetControlStyle (ControlStyles.OptimizedDoubleBuffer, false); Assert.IsFalse (c.IsDoubleBuffered, "#D1"); Assert.IsFalse (c.GetControlStyle (ControlStyles.AllPaintingInWmPaint), "#D2"); Assert.IsFalse (c.GetControlStyle (ControlStyles.DoubleBuffer), "#D3"); Assert.IsFalse (c.GetControlStyle (ControlStyles.OptimizedDoubleBuffer), "#D4"); Assert.IsFalse (c.GetControlStyle (ControlStyles.UserPaint), "#D5"); c.SetControlStyle (ControlStyles.DoubleBuffer, true); Assert.IsFalse (c.IsDoubleBuffered, "#E1"); Assert.IsFalse (c.GetControlStyle (ControlStyles.AllPaintingInWmPaint), "#E2"); Assert.IsTrue (c.GetControlStyle (ControlStyles.DoubleBuffer), "#E3"); Assert.IsFalse (c.GetControlStyle (ControlStyles.OptimizedDoubleBuffer), "#E4"); Assert.IsFalse (c.GetControlStyle (ControlStyles.UserPaint), "#E5"); c.SetControlStyle (ControlStyles.DoubleBuffer, false); Assert.IsFalse (c.IsDoubleBuffered, "#F1"); Assert.IsFalse (c.GetControlStyle (ControlStyles.AllPaintingInWmPaint), "#F2"); Assert.IsFalse (c.GetControlStyle (ControlStyles.DoubleBuffer), "#F3"); Assert.IsFalse (c.GetControlStyle (ControlStyles.OptimizedDoubleBuffer), "#F4"); Assert.IsFalse (c.GetControlStyle (ControlStyles.UserPaint), "#F5"); c.IsDoubleBuffered = true; Assert.IsTrue (c.IsDoubleBuffered, "#G1"); Assert.IsTrue (c.GetControlStyle (ControlStyles.AllPaintingInWmPaint), "#G2"); Assert.IsFalse (c.GetControlStyle (ControlStyles.DoubleBuffer), "#G3"); Assert.IsTrue (c.GetControlStyle (ControlStyles.OptimizedDoubleBuffer), "#G4"); Assert.IsFalse (c.GetControlStyle (ControlStyles.UserPaint), "#G5"); c.SetControlStyle (ControlStyles.AllPaintingInWmPaint, true); c.SetControlStyle (ControlStyles.OptimizedDoubleBuffer, true); c.SetControlStyle (ControlStyles.DoubleBuffer, true); c.SetControlStyle (ControlStyles.UserPaint, true); c.IsDoubleBuffered = false; Assert.IsFalse (c.IsDoubleBuffered, "#H1"); Assert.IsTrue (c.GetControlStyle (ControlStyles.AllPaintingInWmPaint), "#H2"); Assert.IsTrue (c.GetControlStyle (ControlStyles.DoubleBuffer), "#H3"); Assert.IsFalse (c.GetControlStyle (ControlStyles.OptimizedDoubleBuffer), "#H4"); Assert.IsTrue (c.GetControlStyle (ControlStyles.UserPaint), "#H5"); }