Exemplo n.º 1
0
 /// <summary>
 /// 构造方法
 /// </summary>
 public MBorad()
 {
     this.cp = new GdiPlusPaint();
     //this.cp = new GdiPaint();
     this.SizeChanged += new EventHandler(CBorad_SizeChanged);
     this.graphics     = this.CreateGraphics();
     this.Paint       += new PaintEventHandler(CBoard_Paint);
     this.MouseMove   += new MouseEventHandler(CBoard_MouseMove);
     this.MouseDown   += new MouseEventHandler(CBoard_MouseDown);
     this.MouseUp     += new MouseEventHandler(CBoard_MouseUp);
     this.MouseEnter  += new EventHandler(CBorad_MouseEnter);
     this.MouseLeave  += new EventHandler(CBoard_MouseLeave);
     this.MouseWheel  += new MouseEventHandler(CBoard_MouseWheel);
     args              = new MPaintEventArgs(cp, this);
 }
Exemplo n.º 2
0
 protected new void Dispose(bool Disposing)
 {
     if (!IsDisposed)
     {
         if (Disposing)
         {
             //清理托管资源
             if (cp != null)
             {
                 cp.Dispose();
                 cp = null;
             }
             if (objectsNeedToBeDraw != null)
             {
                 foreach (var v in objectsNeedToBeDraw)
                 {
                 }
             }
         }
         //清理非托管资源
     }
     IsDisposed = true;
 }
Exemplo n.º 3
0
 /// <summary>
 /// 构造方法
 /// </summary>
 /// <param name="g"></param>
 /// <param name="advancedSearch"></param>
 public MPaintEventArgs(MPaint cp, MBorad advancedSearch)
 {
     this.cPaint = cp;
     this.board  = advancedSearch;
 }