示例#1
0
		public virtual void saveTo(BinaryWriter writer, PersistContext ctx)
		{
			ctx.saveReference(this, node, 1);
			writer.Write((int)type);
			writer.Write(attData);

			// in format revision 28 'percents' changed from Rectangle to RectangleF
			ctx.saveRect(percents);
		}
示例#2
0
		public virtual void loadFrom(BinaryReader reader, PersistContext ctx)
		{
			ctx.loadReference(this);
			type = (AttachTo)reader.ReadInt32();
			attData = reader.ReadInt32();

			// in format revision 28 'percents' changed from Rectangle to RectangleF
			if (ctx.FileVersion < 28)
			{
				Rectangle r = ctx.loadRect();
				percents = RectangleF.FromLTRB(r.Left, r.Top, r.Right, r.Bottom);
			}
			else
			{
				percents = ctx.loadRectF();
			}
		}
示例#3
0
		public virtual void loadFrom(BinaryReader reader, PersistContext ctx)
		{
			ctx.loadReference(this);

			if (ctx.FileVersion <= 21)
			{
				// not used any more
				float x = (float)reader.ReadDouble();
				float y = (float)reader.ReadDouble();
				int rx = reader.ReadInt32();
				int ry = reader.ReadInt32();
				relativePosition = new PointF(rx, ry);
			}

			incoming = reader.ReadBoolean();

			if (ctx.FileVersion > 21)
			{
				// in format revision 22 these become float:
				float rx = reader.ReadSingle();
				float ry = reader.ReadSingle();
				relativePosition = new PointF(rx, ry);
			}
		}
示例#4
0
		public override void saveTo(BinaryWriter writer, PersistContext ctx)
		{
			base.saveTo(writer, ctx);
			ctx.saveReference(this, selectedItems, 1);
			ctx.saveReference(this, selectedBoxes, 2);
			ctx.saveReference(this, selectedTables, 3);
			ctx.saveReference(this, selectedArrows, 4);

			writer.Write((int)style);

			// new in file format 12
			ctx.saveReference(this, selectedHosts, 5);
		}
示例#5
0
			public virtual void saveTo(BinaryWriter writer, PersistContext ctx)
			{
				writer.Write((double)height);
				ctx.saveReference(this, table, 1);
				ctx.saveReference(this, incomingArrows, 2);
				ctx.saveReference(this, outgoingArrows, 3);
				ctx.saveReference(this, relatedOneToMany, 4);
				ctx.saveReference(this, relatedManyToOne, 5);

				// new in save format 6
				ctx.saveAnchorPattern(anchorPattern);

				// new in save format 22
				writer.Write(header);
				writer.Write(expanded);
			}
示例#6
0
			public virtual void saveTo(BinaryWriter writer, PersistContext ctx)
			{
				writer.Write(InnerList.Count);
				for (int i = 0; i < InnerList.Count; ++i)
				{
					ctx.saveReference(this, (Cell)InnerList[i], i);
				}
			}
示例#7
0
			public virtual void saveTo(BinaryWriter writer, PersistContext ctx)
			{
				writer.Write(text);
				ctx.saveStringFormat(textFormat);
				ctx.saveReference(this, table, 1);

				// new in save format 6
				writer.Write((int)picturePos);
				ctx.saveImage(picture);

				// new in save format 14
				ctx.saveColor(textColor);
				ctx.saveReference(this, brush, 2);

				// new in save format 18
				writer.Write(toolTip);

				// new in save format 19
				writer.Write(hyperLink);

				// new in save format 22
				writer.Write(columnSpan);
				writer.Write(rowSpan);

				bool tagSerializable = false;
				if (tag != null)
					tagSerializable = tag.GetType().IsSerializable;
				writer.Write(tagSerializable);

				if (tagSerializable)
					ctx.saveTag(tag);
			}
示例#8
0
		public override void saveTo(BinaryWriter writer, PersistContext ctx)
		{
			base.saveTo(writer, ctx);

			ctx.saveReference(this, cells, 1);
			ctx.saveReference(this, rowsList, 2);
			ctx.saveReference(this, colsList, 3);
			writer.Write(currScrollRow);
			writer.Write(scrollable);
			ctx.saveColor(fillColor);
			ctx.saveColor(frameColor);
			writer.Write(caption);
			ctx.saveColor(captionColor);
			ctx.saveStringFormat(captionFormat);

			writer.Write((double)captionHeight);
			writer.Write((int)cellBorders);
			writer.Write(rowsCount);
			writer.Write((double)rowHeight);
			writer.Write(columnsCount);
			writer.Write((double)columnWidth);
			ctx.saveColor(textColor);
			writer.Write((int)picturePos);

			ctx.saveImage(picture);

			ctx.saveObject(pen);
			ctx.saveReference(this, brush, 4);

			writer.Write((int)selStyle);

			// new in save format 6
			ctx.saveAnchorPattern(rowAnchorPattern);
			writer.Write((long)enabledHandles);
			writer.Write((int)Style);

			// new in file format 8
			writer.Write((int)linkStyle);

			// new in file format 9
			ctx.saveAnchorPattern(anchorPattern);

			ctx.saveReference(this, incomingArrows, 5);
			ctx.saveReference(this, outgoingArrows, 6);

			// new in save format 14
			writer.Write(Expanded);
			writer.Write(Expandable);
			writer.Write(useStyledText);

			// new in save format 19
			writer.Write((int)customDraw);
			writer.Write((int)cellCustomDraw);

			// new in save format 22
			writer.Write(offsetHeaderRows);

			// new in save format 25
			ctx.saveReference(this, captionBackBrush, 7);
		}
示例#9
0
文件: GDI.cs 项目: ChrisMoreton/Test3
		public override void loadFrom(BinaryReader reader, PersistContext ctx)
		{
			base.loadFrom(reader, ctx);

			int b = reader.ReadInt32();
			if(b == 1)
			{
				_blend = new Blend();
				_blend.Factors = ctx.loadFloatArray();
				_blend.Positions = ctx.loadFloatArray();
			}
			else
			{
				_blend = null;
			}

			_linearColors[0] = ctx.loadColor();
			_linearColors[1] = ctx.loadColor();

			b = reader.ReadInt32();
			if(b == 1)
			{
				_interpolationColors = new ColorBlend();
				_interpolationColors.Colors = ctx.loadColorArray();
				_interpolationColors.Positions = ctx.loadFloatArray();
			}
			else
			{
				_interpolationColors = null;
			}

			_angle = (float)reader.ReadDouble();
		}
示例#10
0
文件: GDI.cs 项目: ChrisMoreton/Test3
		public override void saveTo(BinaryWriter writer, PersistContext ctx)
		{
			base.saveTo(writer, ctx);

			if(_blend != null)
			{
				writer.Write((int)1);
				ctx.saveFloatArray(_blend.Factors);
				ctx.saveFloatArray(_blend.Positions);
			}
			else
			{
				writer.Write((int)0);
			}

			ctx.saveColor(_linearColors[0]);
			ctx.saveColor(_linearColors[1]);
			
			if(_interpolationColors != null)
			{
				writer.Write((int)1);
				ctx.saveColorArray(_interpolationColors.Colors);
				ctx.saveFloatArray(_interpolationColors.Positions);
			}
			else
			{
				writer.Write((int)0);
			}

			writer.Write((double)_angle);
		}
示例#11
0
文件: GDI.cs 项目: ChrisMoreton/Test3
		public override void loadFrom(BinaryReader reader, PersistContext ctx)
		{
			base.loadFrom(reader, ctx);

			_hatchStyle = (HatchStyle)reader.ReadInt32();
			_foreColor = ctx.loadColor();
			_backColor = ctx.loadColor();
		}
示例#12
0
文件: GDI.cs 项目: ChrisMoreton/Test3
		public override void saveTo(BinaryWriter writer, PersistContext ctx)
		{
			base.saveTo(writer, ctx);

			writer.Write((int)_hatchStyle);
			ctx.saveColor(_foreColor);
			ctx.saveColor(_backColor);
		}
示例#13
0
文件: GDI.cs 项目: ChrisMoreton/Test3
		internal static void RestoreBrushes(IPersistObjFactory objFactory,
			BinaryReader reader, PersistContext ctx)
		{
			Brush brush;
			int count = reader.ReadInt32();

			for(int i = 0; i < count; i++)
			{
				brush = (Brush)ctx.loadObject();
				_brushes.Add(brush);
			}
		}
示例#14
0
文件: GDI.cs 项目: ChrisMoreton/Test3
		internal static void StoreBrushes(BinaryWriter writer, PersistContext ctx)
		{
			writer.Write(_brushes.Count);
			foreach(Brush br in _brushes)
				ctx.saveObject(br);
		}
示例#15
0
文件: GDI.cs 项目: ChrisMoreton/Test3
		public virtual void loadFrom(BinaryReader reader, PersistContext ctx)
		{
			reader.ReadInt32();
			_refCount = 0;
		}
示例#16
0
			public virtual void saveTo(BinaryWriter writer, PersistContext ctx)
			{
				ctx.saveReference(this, table, 1);
				writer.Write((double)width);
				writer.Write((int)columnStyle);
			}
示例#17
0
			public virtual void loadFrom(BinaryReader reader, PersistContext ctx)
			{
				ctx.loadReference(this);
				width = (float)reader.ReadDouble();
				columnStyle = (ColumnStyle)reader.ReadInt32();
			}
示例#18
0
文件: GDI.cs 项目: ChrisMoreton/Test3
		public override void saveTo(BinaryWriter writer, PersistContext ctx)
		{
			base.saveTo(writer, ctx);

			ctx.saveColor(_color);
		}
示例#19
0
		public override void loadFrom(BinaryReader reader, PersistContext ctx)
		{
			base.loadFrom(reader, ctx);
			hasHeaderRows = false;

			hasSpanningCells = false;
			ctx.loadReference(this);	// load cells
			ctx.loadReference(this);	// load rows
			ctx.loadReference(this);	// load columns
			currScrollRow = reader.ReadInt32();
			scrollable = reader.ReadBoolean();
			setScrollable(scrollable);
			fillColor = ctx.loadColor();
			frameColor = ctx.loadColor();
			caption = reader.ReadString();
			captionColor = ctx.loadColor();
			captionFormat = ctx.loadStringFormat();

			captionHeight = (float)reader.ReadDouble();
			cellBorders = (CellFrameStyle)reader.ReadInt32();
			rowsCount = reader.ReadInt32();
			rowHeight = (float)reader.ReadDouble();
			columnsCount = reader.ReadInt32();
			columnWidth = (float)reader.ReadDouble();
			textColor = ctx.loadColor();
			picturePos = (ImageAlign)reader.ReadInt32();

			picture = ctx.loadImage();

			pen.Width = PenWidth;
			pen.Color = frameColor;
			pen.DashStyle = PenDashStyle;
			brush.Release();
			brush = new SolidBrush(fillColor);
			brush.AddRef();

			if (ctx.FileVersion > 3)
			{
				pen = (Pen)ctx.loadObject();
				ctx.loadReference(this);

				selStyle = (HandlesStyle)reader.ReadInt32();

				if (ctx.FileVersion > 5)
				{
					// new in save format 6
					rowAnchorPattern = ctx.loadAnchorPattern();
					enabledHandles = (Handles)reader.ReadInt64();
					style = (TableStyle)reader.ReadInt32();

					if (ctx.FileVersion > 7)
					{
						// new in file format 8
						linkStyle = (TableLinkStyle)reader.ReadInt32();

						if (ctx.FileVersion > 8)
						{
							// new in save format 9
							anchorPattern = ctx.loadAnchorPattern();

							// Load table arrows
							ctx.loadReference(this);
							ctx.loadReference(this);

							if (ctx.FileVersion > 13)
							{
								// new in save format 14
								setExpanded(reader.ReadBoolean());
								setExpandable(reader.ReadBoolean());
								useStyledText = reader.ReadBoolean();

								if (ctx.FileVersion > 18)
								{
									// new in save format 19
									customDraw = (CustomDraw)reader.ReadInt32();
									cellCustomDraw = (CustomDraw)reader.ReadInt32();

									if (ctx.FileVersion > 21)
									{
										// new in save format 22
										offsetHeaderRows = reader.ReadBoolean();

										if (ctx.FileVersion > 24)
										{
											// new in save format 25
											ctx.loadReference(this);	// captionBackBrush
										}
									}
								}
							}
						}
					}
				}
			}

			resetCoveredCells();
			updateText();
			layoutText();
		}
示例#20
0
文件: GDI.cs 项目: ChrisMoreton/Test3
		public override void loadFrom(BinaryReader reader, PersistContext ctx)
		{
			base.loadFrom(reader, ctx);

			_color = ctx.loadColor();
		}
示例#21
0
			public virtual void loadFrom(BinaryReader reader, PersistContext ctx)
			{
				toolTip = "";
				hyperLink = "";

				text = reader.ReadString();
				textFormat = ctx.loadStringFormat();
				ctx.loadReference(this);

				if (ctx.FileVersion > 5)
				{
					// new in save format 6
					picturePos = (ImageAlign)reader.ReadInt32();
					picture = ctx.loadImage();

					if (ctx.FileVersion > 13)
					{
						// new in save format 14
						textColor = ctx.loadColor();
						ctx.loadReference(this);	// brush

						if (ctx.FileVersion > 17)
						{
							// new in save format 18
							toolTip = reader.ReadString();

							if (ctx.FileVersion > 18)
							{
								// new in save format 19
								hyperLink = reader.ReadString();

								if (ctx.FileVersion > 21)
								{
									// new in save format 22
									columnSpan = reader.ReadInt32();
									rowSpan = reader.ReadInt32();

									tag = null;
									bool tagAvailable = reader.ReadBoolean();
									if (tagAvailable)
										tag = ctx.loadTag();
								}
							}
						}
					}
				}

				txOptions = new Text.LayoutOptions();
				txLayout = new Text.Layout();
			}
示例#22
0
文件: GDI.cs 项目: ChrisMoreton/Test3
		public override void saveTo(BinaryWriter writer, PersistContext ctx)
		{
			base.saveTo(writer, ctx);

			ctx.saveImage(_image);
			writer.Write((int)_wrapMode);
		}
示例#23
0
			public virtual void loadFrom(BinaryReader reader, PersistContext ctx)
			{
				int count = reader.ReadInt32();
				InnerList.Capacity = count;
				for (int i = 0; i < count; ++i)
				{
					InnerList.Add(null);
					ctx.loadReference(this);
				}
			}
示例#24
0
文件: GDI.cs 项目: ChrisMoreton/Test3
		public override void loadFrom(BinaryReader reader, PersistContext ctx)
		{
			base.loadFrom(reader, ctx);

			_image = ctx.loadImage();
			_wrapMode = (WrapMode)reader.ReadInt32();
		}
示例#25
0
			public virtual void loadFrom(BinaryReader reader, PersistContext ctx)
			{
				height = (float)reader.ReadDouble();
				ctx.loadReference(this);
				ctx.loadReference(this);
				ctx.loadReference(this);
				ctx.loadReference(this);
				ctx.loadReference(this);

				if (ctx.FileVersion > 5)
				{
					// new in save format 6
					anchorPattern = ctx.loadAnchorPattern();

					if (ctx.FileVersion > 21)
					{
						// new in save format 22
						header = reader.ReadBoolean();
						expanded = reader.ReadBoolean();
					}
				}
			}
示例#26
0
		public virtual void saveTo(BinaryWriter writer, PersistContext ctx)
		{
			writer.Write(List.Count);
			for (int i = 0; i < List.Count; ++i)
			{
				writer.Write((double)this[i].X);
				writer.Write((double)this[i].Y);
			}
		}
示例#27
0
		public override void loadFrom(BinaryReader reader, PersistContext ctx)
		{
			base.loadFrom(reader, ctx);
			ctx.loadReference(this);
			ctx.loadReference(this);
			ctx.loadReference(this);
			ctx.loadReference(this);
			style = (SelectionStyle)reader.ReadInt32();

			if (ctx.FileVersion >= 12)
			{
				// new in file format 12
				ctx.loadReference(this);	// selectedHosts
			}
		}
示例#28
0
		public virtual void loadFrom(BinaryReader reader, PersistContext ctx)
		{
			int count = reader.ReadInt32();
			InnerList.Capacity = count;
			for (int i = 0; i < count; ++i)
			{
				float x, y;
				x = (float)reader.ReadDouble();
				y = (float)reader.ReadDouble();
				InnerList.Add(new PointF(x, y));
			}
		}
示例#29
0
		public virtual void saveTo(BinaryWriter writer, PersistContext ctx)
		{
			ctx.saveReference(this, arrow, 1);
			writer.Write(incoming);

			// in format revision 22 these become float:
			writer.Write(relativePosition.X);
			writer.Write(relativePosition.Y);
		}
示例#30
0
		public virtual void saveTo(BinaryWriter writer, PersistContext ctx)
		{
			writer.Write(List.Count);
			for (int i = 0; i < List.Count; ++i)
			{
				ctx.saveReference(this, (ChartObject)List[i], i);
			}
		}