123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- using System;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.ComponentModel;
- using System.Drawing.Design;
- using System.Windows.Forms;
- using System.Windows.Forms.Design;
- namespace GraEditor.BaseDef
- {
- [Serializable]
- public struct FontData
- {
- public FontData(Font font)
- {
- this.Name = font.Name;
- this.Size = font.SizeInPoints;
- this.Style = font.Style;
-
- }
- public string Name;
- public float Size;
- public FontStyle Style;
- public bool IsEmpty()
- {
- return Name.Length == 0 || Size <= 0;
- }
- }
-
- public class PenExt
- {
-
-
-
-
-
-
-
- public PenExt()
- {
- this.color = Color.Black;
- _penObj = new Pen(Color.Black, 1);
- }
-
- public PenExt(Color c)
- {
- this.color = c;
- }
-
- public PenExt(Color c,int w,DashStyle s)
- :this(c)
- {
- this.width = w;
- this.dashStyle = s;
- }
-
- private Pen _penObj;
- public Pen Pen
- {
- get
- {
- _penObj.Color = this.Color;
- _penObj.Width = this.Width;
- _penObj.DashStyle = this.dashStyle;
- return _penObj;
- }
- set
- {
- if(value == null)
- return;
- color = value.Color;
- width = value.Width;
- dashStyle = value.DashStyle;
- }
- }
-
- protected Color color;
-
- public Color Color
- {
- get { return color; }
- set
- {
- if( value == color)
- return;
- color = value;
- }
- }
-
- protected float width;
-
- public float Width
- {
- get { return width; }
- set
- {
- if( value == width)
- return;
- width = value;
- }
- }
- protected DashStyle dashStyle;
-
- public DashStyle DashStyle
- {
- get { return dashStyle; }
- set
- {
- if(value == dashStyle)
- return;
- if(dashStyle == DashStyle.Custom)
- return;
- dashStyle = value;
- }
- }
- }
- }
|