Exemplo n.º 1
0
 public override void SetupPen(Pen pen, LineBase line, PointPair dataValue)
 {
     if(callback(dataValue))
         DefaultSetup(line, pen);
     else
         pen.DashStyle = DashStyle.Solid;
 }
Exemplo n.º 2
0
 /// <overloads>Constructors for the <see cref="LineObj"/> object</overloads>
 /// <summary>
 /// A constructor that allows the position, color, and size of the
 /// <see cref="LineObj"/> to be pre-specified.
 /// </summary>
 /// <param name="color">An arbitrary <see cref="System.Drawing.Color"/> specification
 /// for the arrow</param>
 /// <param name="x1">The x position of the starting point that defines the
 /// line.  The units of this position are specified by the
 /// <see cref="Location.CoordinateFrame"/> property.</param>
 /// <param name="y1">The y position of the starting point that defines the
 /// line.  The units of this position are specified by the
 /// <see cref="Location.CoordinateFrame"/> property.</param>
 /// <param name="x2">The x position of the ending point that defines the
 /// line.  The units of this position are specified by the
 /// <see cref="Location.CoordinateFrame"/> property.</param>
 /// <param name="y2">The y position of the ending point that defines the
 /// line.  The units of this position are specified by the
 /// <see cref="Location.CoordinateFrame"/> property.</param>
 public LineObj(Color color, double x1, double y1, double x2, double y2)
     : base(x1, y1, x2 - x1, y2 - y1)
 {
     _line = new LineBase(color);
     this.Location.AlignH = AlignH.Left;
     this.Location.AlignV = AlignV.Top;
 }
Exemplo n.º 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 LineObj(SerializationInfo info, StreamingContext context) : base(info, 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("schema2");

            _line = (LineBase)info.GetValue("line", typeof(LineBase));
        }
Exemplo n.º 4
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;
     DashOn       = rhs.DashOn;
     DashOff      = rhs.DashOff;
     IsVisible    = rhs.IsVisible;
     Color        = rhs.Color;
     IsAntiAlias  = rhs.IsAntiAlias;
     GradientFill = new Fill(rhs.GradientFill);
 }
Exemplo n.º 5
0
 public override void SetupPen(Pen pen, LineBase line, PointPair dataValue)
 {
     if (callback(dataValue))
     {
         DefaultSetup(line, pen);
     }
     else
     {
         pen.DashStyle = DashStyle.Solid;
     }
 }
Exemplo n.º 6
0
 public override void SetupPen(Pen pen, LineBase line, PointPair dataValue)
 {
     if (dataValue != null && (dataValue.X < DisabledMin || dataValue.X > DisabledMax))
     {
         DefaultSetup(line, pen);
     }
     else
     {
         pen.DashStyle = DashStyle.Solid;
     }
 }
Exemplo n.º 7
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;
            _dashOn  = rhs._dashOn;
            _dashOff = rhs._dashOff;

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

            _isAntiAlias  = rhs._isAntiAlias;
            _gradientFill = new Fill(rhs._gradientFill);
        }
Exemplo n.º 8
0
        protected void DefaultSetup(LineBase line, Pen pen)
        {
            float dashOff = line.DashOff;
            float dashOn = line.DashOn;

            if (dashOff > 1e-10 && dashOn > 1e-10)
            {
                pen.DashStyle = DashStyle.Custom;
                float[] pattern = new float[2];
                pattern[0] = dashOn;
                pattern[1] = dashOff;
                pen.DashPattern = pattern;
            }
            else
                pen.DashStyle = DashStyle.Solid;
        }
Exemplo n.º 9
0
 /// <summary>
 /// Local dispose method
 /// </summary>
 /// <param name="bDisposing">if disposing is required</param>
 override protected void Dispose(bool bDisposing)
 {
     if (!m_bDisposed)
     {
         if (bDisposing)
         {
             if (_line != null)
             {
                 _line.Dispose();
                 _line = null;
             }
         }
         m_bDisposed = true;
         base.Dispose(bDisposing);
     }
 }
Exemplo n.º 10
0
 /// <summary>
 /// Local dispose method
 /// </summary>
 /// <param name="bDisposing">if disposing is required</param>
 override protected void Dispose(bool bDisposing)
 {
     if (!m_bDisposed)
     {
         if (bDisposing)
         {
             if (_line != null)
             {
                 _line.Dispose();
                 _line = null;
             }
         }
         m_bDisposed = true;
         base.Dispose(bDisposing);
     }
 }
Exemplo n.º 11
0
        protected void DefaultSetup(LineBase line, Pen pen)
        {
            float dashOff = line.DashOff;
            float dashOn  = line.DashOn;

            if (dashOff > 1e-10 && dashOn > 1e-10)
            {
                pen.DashStyle = DashStyle.Custom;
                float[] pattern = new float[2];
                pattern[0]      = dashOn;
                pattern[1]      = dashOff;
                pen.DashPattern = pattern;
            }
            else
            {
                pen.DashStyle = DashStyle.Solid;
            }
        }
Exemplo n.º 12
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The <see cref="LineObj"/> object from which to copy</param>
		public LineObj( LineObj rhs ) : base( rhs )
		{
			_line = new LineBase( rhs._line );
		}
Exemplo n.º 13
0
 public override void SetupPen(Pen pen, LineBase line, PointPair dataValue)
 {
     DefaultSetup(line, pen);
 }
Exemplo n.º 14
0
 public abstract void SetupPen(Pen pen, LineBase line, PointPair dataValue);
Exemplo n.º 15
0
 public abstract void SetupPen(Pen pen, LineBase line, PointPair dataValue);
Exemplo n.º 16
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">The <see cref="LineObj"/> object from which to copy</param>
 public LineObj(LineObj rhs) : base(rhs)
 {
     _line = new LineBase(rhs._line);
 }
Exemplo n.º 17
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 );
        }
Exemplo n.º 18
0
		/// <overloads>Constructors for the <see cref="LineObj"/> object</overloads>
		/// <summary>
		/// A constructor that allows the position, color, and size of the
		/// <see cref="LineObj"/> to be pre-specified.
		/// </summary>
		/// <param name="color">An arbitrary <see cref="System.Drawing.Color"/> specification
		/// for the arrow</param>
		/// <param name="x1">The x position of the starting point that defines the
		/// line.  The units of this position are specified by the
		/// <see cref="Location.CoordinateFrame"/> property.</param>
		/// <param name="y1">The y position of the starting point that defines the
		/// line.  The units of this position are specified by the
		/// <see cref="Location.CoordinateFrame"/> property.</param>
		/// <param name="x2">The x position of the ending point that defines the
		/// line.  The units of this position are specified by the
		/// <see cref="Location.CoordinateFrame"/> property.</param>
		/// <param name="y2">The y position of the ending point that defines the
		/// line.  The units of this position are specified by the
		/// <see cref="Location.CoordinateFrame"/> property.</param>
		public LineObj( Color color, double x1, double y1, double x2, double y2 )
			: base( x1, y1, x2 - x1, y2 - y1 )
		{
			_line = new LineBase( color );
			this.Location.AlignH = AlignH.Left;
			this.Location.AlignV = AlignV.Top;
		}
Exemplo n.º 19
0
 public override void SetupPen(Pen pen, LineBase line, PointPair dataValue)
 {
     if (dataValue != null && ( dataValue.X < DisabledMin || dataValue.X > DisabledMax))
     {
         DefaultSetup(line, pen);
     }
     else
     {
         pen.DashStyle = DashStyle.Solid;
     }
 }
Exemplo n.º 20
0
 internal virtual void OnBeforeDrawEvent(LineBase obj, int i)
 {
     BeforeDrawEvent?.Invoke(this, obj, i);
 }
Exemplo n.º 21
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 LineObj( SerializationInfo info, StreamingContext context ) : base( info, 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( "schema2" );

			_line = (LineBase)info.GetValue( "line", typeof( LineBase ) );
		}
Exemplo n.º 22
0
 public override void SetupPen(Pen pen, LineBase line, PointPair dataValue)
 {
     DefaultSetup(line, pen);
 }