Пример #1
0
 /// <summary>
 /// Constructor that sets the color property to the specified value, and sets
 /// the remaining <see cref="LineBase"/> properties to default
 /// values as defined in the <see cref="Default"/> class.
 /// </summary>
 /// <param name="color">The color to assign to this new Line object</param>
 public LineBase(Color color)
 {
     _width             = Default.Width;
     _style             = Default.Style;
     _customDashes      = Default.CustomDashes;
     _dashOn            = Default.DashOn;
     _dashOff           = Default.DashOff;
     _isVisible         = Default.IsVisible;
     _color             = color.IsEmpty ? Default.Color : color;
     _isAntiAlias       = Default.IsAntiAlias;
     _gradientFill      = new Fill(Color.Red, Color.White);
     _gradientFill.Type = FillType.None;
 }
Пример #2
0
        /// <summary>
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">The LineBase object from which to copy</param>
        public LineBase(LineBase rhs)
        {
            _width        = rhs._width;
            _style        = rhs._style;
            _customDashes = rhs._customDashes;
            _dashOn       = rhs._dashOn;
            _dashOff      = rhs._dashOff;

            _isVisible = rhs._isVisible;
            _color     = rhs._color;

            _isAntiAlias  = rhs._isAntiAlias;
            _gradientFill = new Fill(rhs._gradientFill);
        }
Пример #3
0
        /// <summary>
        /// Constructor for deserializing objects
        /// </summary>
        /// <param name="info">A <see cref="SerializationInfo"/> instance that defines the
        /// serialized data
        /// </param>
        /// <param name="context">A <see cref="StreamingContext"/> instance that contains
        /// the serialized data
        /// </param>
        protected LineBase(SerializationInfo info, StreamingContext context)
        {
            // The schema value is just a file version parameter.  You can use it to make future versions
            // backwards compatible as new member variables are added to classes
            int sch = info.GetInt32("schema0");

            _width        = info.GetSingle("width");
            _style        = (DashStyle)info.GetValue("style", typeof(DashStyle));
            _customDashes = (CustomDashStyle)info.GetValue("customDashes", typeof(CustomDashStyle));
            _dashOn       = info.GetSingle("dashOn");
            _dashOff      = info.GetSingle("dashOff");
            _isVisible    = info.GetBoolean("isVisible");
            _isAntiAlias  = info.GetBoolean("isAntiAlias");
            _color        = (Color)info.GetValue("color", typeof(Color));
            _gradientFill = (Fill)info.GetValue("gradientFill", typeof(Fill));
        }
Пример #4
0
        /// <summary>
        /// Constructor for deserializing objects
        /// </summary>
        /// <param name="info">A <see cref="SerializationInfo"/> instance that defines the
        /// serialized data
        /// </param>
        /// <param name="context">A <see cref="StreamingContext"/> instance that contains
        /// the serialized data
        /// </param>
        protected LineBase( SerializationInfo info, StreamingContext context )
        {
            // The schema value is just a file version parameter.  You can use it to make future versions
            // backwards compatible as new member variables are added to classes
            int sch = info.GetInt32( "schema0" );

            _width = info.GetSingle( "width" );
            _style = (DashStyle)info.GetValue( "style", typeof( DashStyle ) );
            _customDashes = (CustomDashStyle) info.GetValue("customDashes", typeof(CustomDashStyle));
            _dashOn = info.GetSingle( "dashOn" );
            _dashOff = info.GetSingle( "dashOff" );
            _isVisible = info.GetBoolean( "isVisible" );
            _isAntiAlias = info.GetBoolean( "isAntiAlias" );
            _color = (Color)info.GetValue( "color", typeof( Color ) );
            _gradientFill = (Fill)info.GetValue( "gradientFill", typeof( Fill ) );
        }
Пример #5
0
        /// <summary>
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">The LineBase object from which to copy</param>
        public LineBase( LineBase rhs )
        {
            _width = rhs._width;
            _style = rhs._style;
            _customDashes = rhs._customDashes;
            _dashOn = rhs._dashOn;
            _dashOff = rhs._dashOff;

            _isVisible = rhs._isVisible;
            _color = rhs._color;

            _isAntiAlias = rhs._isAntiAlias;
            _gradientFill = new Fill( rhs._gradientFill );
        }
Пример #6
0
 /// <summary>
 /// Constructor that sets the color property to the specified value, and sets
 /// the remaining <see cref="LineBase"/> properties to default
 /// values as defined in the <see cref="Default"/> class.
 /// </summary>
 /// <param name="color">The color to assign to this new Line object</param>
 public LineBase( Color color )
 {
     _width = Default.Width;
     _style = Default.Style;
     _customDashes = Default.CustomDashes;
     _dashOn = Default.DashOn;
     _dashOff = Default.DashOff;
     _isVisible = Default.IsVisible;
     _color = color.IsEmpty ? Default.Color : color;
     _isAntiAlias = Default.IsAntiAlias;
     _gradientFill = new Fill( Color.Red, Color.White );
     _gradientFill.Type = FillType.None;
 }