예제 #1
0
 void _font_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.Name.IndexOf("Font.") == -1)
     {
         e.Name = "Font." + e.Name;
     }
     _font = sender as FontWrapper;
     base.OnPropertyChanged(this, e);
 }
예제 #2
0
 public ShapeFontBase(SignType signType)
     : base(signType)
 {
     _font                        = new FontWrapper();
     _textEffect                  = new TextEffect();
     _font.PropertyChanged       += new EventHandler <PropertyChangedEventArgs>(_font_PropertyChanged);
     _textEffect.PropertyChanged += new EventHandler <PropertyChangedEventArgs>(_textEffect_PropertyChanged);
     _foreColor                   = SignTypeHandler.ConvertColor(Color.BlueViolet, SignType);
     //_foreColor = Color.BlueViolet;
 }
예제 #3
0
 private void Deserialized(StreamingContext ctx)
 {
     if (_font == null)
     {
         _font                        = new FontWrapper();
         _textEffect                  = new TextEffect();
         _font.PropertyChanged       += new EventHandler <PropertyChangedEventArgs>(_font_PropertyChanged);
         _textEffect.PropertyChanged += new EventHandler <PropertyChangedEventArgs>(_textEffect_PropertyChanged);
     }
     InitEvent();
 }
예제 #4
0
 protected override void Dispose(bool disposing)
 {
     base.Dispose(disposing);
     if (_font != null)
     {
         _font.PropertyChanged       -= this._font_PropertyChanged;
         _textEffect.PropertyChanged -= this._textEffect_PropertyChanged;
         _font.Name  = null;
         _font       = null;
         _textEffect = null;
     }
 }
예제 #5
0
 public override void InitEvent()
 {
     if (_font == null)
     {
         _font = new FontWrapper();
     }
     _font.PropertyChanged += new EventHandler <PropertyChangedEventArgs>(_font_PropertyChanged);
     if (_textEffect == null)
     {
         _textEffect = new TextEffect();
     }
     _textEffect.PropertyChanged += new EventHandler <PropertyChangedEventArgs>(_textEffect_PropertyChanged);
 }
예제 #6
0
        public static FontWrapper GetFontMeasureStringSize(
            string text
            , FontWrapper font
            , RectangleF bounds
            , StringFormat stringFormat
            , bool wordWrap
            , Graphics graphics)
        {
            Font tmp = GetFontMeasureStringSize(text, font.ToFont(), bounds, stringFormat, wordWrap, graphics);

            font.FromFont(tmp);
            return(font);
        }
예제 #7
0
        public override void FromTo(ShapeBase shape)
        {
            if (shape == null)
            {
                return;
            }
            base.FromTo(shape);

            ShapeFontBase shapeFont = shape as ShapeFontBase;

            if (shapeFont != null)
            {
                FontWrapper oldFont = _font;
                if (_font.IsHasEvent)
                {
                    _font = shapeFont._font.Copy();
                    _font.PropertyChanged += new EventHandler <PropertyChangedEventArgs>(_font_PropertyChanged);
                }
                else
                {
                    _font = shapeFont._font.Copy();
                }

                _backColor = shapeFont._backColor;
                _foreColor = shapeFont._foreColor;
                if (shapeFont.TextEffect.IsHasEvent)
                {
                    _textEffect = shapeFont.TextEffect.Copy();
                    _textEffect.PropertyChanged += new EventHandler <PropertyChangedEventArgs>(_textEffect_PropertyChanged);
                }
                else
                {
                    _textEffect = shapeFont.TextEffect.Copy();
                }
            }
        }