Ejemplo n.º 1
0
		/// <summary>
		/// Copies from another DataItem.
		/// </summary>
		public override void CopyFrom(PlotItem item) {
			base.CopyFrom(item);
			DataItem data = (DataItem)item;
			Length = data.Length;
			x = data.x.Clone(this); y = data.y.Clone(this);
			dx = data.dx.Clone(this); dy = data.dy.Clone(this);
			UpdateLinks();
			lines = data.lines;
			marks = data.marks;
		}
Ejemplo n.º 2
0
		/// <summary>
		/// Compiles the DataItem (the formulas for the DataColumns and the loadsource).
		/// </summary>
		/// <param name="load">Indicates if to load the code after compilation or to just evalueate
		/// the compilation errors.</param>
		public override void Compile(bool load) {
			base.Compile (load);
			if (compiled) {
				DataItem c = (DataItem)code;
				if (c != null) {
					bool t;
					t = x.deepCopy;
					x.deepCopy = false;
					c.x.CopyFrom(x);
					c.x.deepCopy = x.deepCopy = t;
					t = y.deepCopy;
					y.deepCopy = false;
					c.y.CopyFrom(y);
					c.y.deepCopy = y.deepCopy = t;
					t = dx.deepCopy;
					dx.deepCopy = false;
					c.dx.CopyFrom(dx);
					c.dx.deepCopy = dx.deepCopy = t;
					t = dy.deepCopy;
					dy.deepCopy = false;
					c.dy.CopyFrom(dy);
					c.dy.deepCopy = dy.deepCopy = t;
					x = c.x; y = c.y; dx = c.dx; dy = c.dy;
					x.parent = this; y.parent = this; dx.parent = this; dy.parent = this;
				}
			}
			UpdateLinks();
		}
Ejemplo n.º 3
0
		/// <summary>
		/// The Serialization routine of the class.
		/// </summary>
		public void GetObjectData(SerializationInfo info, StreamingContext context) {
			info.AddValue("color", color);
			info.AddValue("name", name);
			info.AddValue("model", model);
			info.AddValue("length", length);
			info.AddValue("loadsource", loadsource);
			info.AddValue("lines", lines);
			info.AddValue("marks", marks);
			bool xdeep = x.deepCopy, ydeep = y.deepCopy, dxdeep = dx.deepCopy, dydeep = dy.deepCopy;
			x.deepCopy = false; y.deepCopy = false; dx.deepCopy = false; dy.deepCopy = false;
			DataColumn rx = new DataColumn(this), ry = new DataColumn(this),
				rdx = new DataColumn(this), rdy = new DataColumn(this);
			rx.CopyFrom(x); ry.CopyFrom(y); rdx.CopyFrom(dx); rdy.CopyFrom(dy);
			info.AddValue("x", rx);
			info.AddValue("y", ry);
			info.AddValue("dx", rdx);
			info.AddValue("dy", rdy);
			x.deepCopy = xdeep; y.deepCopy = ydeep; dx.deepCopy = dxdeep; dy.deepCopy = dydeep;
		}
Ejemplo n.º 4
0
		private DataItem(SerializationInfo info, StreamingContext context): base() {
			color = (Color)info.GetValue("color", typeof(Color));
			name = info.GetString("name");
			model = (GraphModel)info.GetValue("model", typeof(GraphModel));
			length = info.GetInt32("length");
			loadsource = info.GetString("loadsource");
			lines = info.GetBoolean("lines");
			marks = info.GetBoolean("marks");
			x = (DataColumn)info.GetValue("x", typeof(DataColumn));
			y = (DataColumn)info.GetValue("y", typeof(DataColumn));
			dx = (DataColumn)info.GetValue("dx", typeof(DataColumn));
			dy = (DataColumn)info.GetValue("dy", typeof(DataColumn));
			UpdateLinks();
			x.deepCopy = y.deepCopy = dx.deepCopy = dy.deepCopy = true;
		}
Ejemplo n.º 5
0
		/// <summary>
		/// The default constructor.
		/// </summary>
		public DataItem() {
			x = new DataColumn(this);
			y = new DataColumn(this);
			dx = new DataColumn(this);
			dy = new DataColumn(this);
			Length = 0;
		}
Ejemplo n.º 6
0
		/// <summary>
		/// Creates either a deep or a shallow copy, depending on the value of the <c>deepCopy</c> field.
		/// </summary>
		/// <param name="parent">The parent <see cref="DataItem">DataItem</see> of the copy.</param>
		public virtual DataColumn Clone(DataItem parent) {
			DataColumn r = new DataColumn(parent);
			r.CopyFrom(this);
			return r;
		}
Ejemplo n.º 7
0
		/// <summary>
		/// Copies from another DataColumn with either a deep or shallow copy, depending on the value of
		/// the <c>deepCopy</c> field. 
		/// </summary>
		public void CopyFrom(DataColumn r) {
			base.CopyFrom(r);
			if (r.source != null) {	source = (string)r.source.Clone(); }
			x = r.x; y = r.y; dx = r.dx; dy = r.dy;
		}