Beispiel #1
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);
			}
Beispiel #2
0
		/// <summary>
		/// Saves the flowchart document into a stream
		/// </summary>
		public void SaveToStream(Stream stream, bool clearDirty)
		{
			PersistContext ctx = new PersistContext(stream, this);
			ctx.writeHeader();

			// write properties
			DocInfoVer1 docInfo1 = new DocInfoVer1(this);
			DocInfoVer2 docInfo2 = new DocInfoVer2(this);
			ctx.saveObject(docInfo1);
			ctx.saveObject(docInfo2);

			ctx.saveStringFormat(textFormat);
			ctx.saveFont(Font);
			ctx.saveImage(BackgroundImage);

			// write collections
			ctx.saveObject(zOrder);
			ctx.saveObject(groups);
			ctx.saveObject(selection);

			ctx.saveReference(this, activeObject, 1);

			ctx.saveObject(shapeTemplate);

			Brush.StoreBrushes(new BinaryWriter(stream), ctx);
			ctx.saveObject(boxPen);
			ctx.saveObject(arrowPen);
			ctx.saveObject(tablePen);
			ctx.saveReference(this, boxBrush, 2);
			ctx.saveReference(this, arrowBrush, 3);
			ctx.saveReference(this, tableBrush, 4);

			ctx.writer.Write((int)boxSelStyle);
			ctx.writer.Write((int)tableSelStyle);

			// new in save format 5
			ctx.writer.Write(allowLinksRepeat);

			// new in save format 6
			ctx.writer.Write(PolyTextLayout);
			ctx.writer.Write(ShapeOrientation);

			// new in save format 8
			ctx.writer.Write(routeArrows);
			ctx.writer.Write(arrowsRetainForm);
			ctx.writer.Write((int)arrowTextStyle);
			ctx.writer.Write((int)tableLinkStyle);

			// new in save format 12
			ctx.writer.Write((int)measureUnit);
			ctx.saveRect(docExtentsMin);

			// new in save format 14
			ctx.writer.Write((int)expandBtnPos);

			ctx.writer.Write((int)Orientation.Auto);	// not used anymore
			ctx.writer.Write((int)Orientation.Auto); // not used anymore

			ctx.writer.Write(enableStyledText);
			ctx.writer.Write(usePolyTextLt);
			ctx.saveReference(this, brush, 5);

			// new in save format 17
			ctx.writer.Write(arrowText);
			ctx.writer.Write(boxText);
			ctx.writer.Write((int)arrowCrossings);
			ctx.writer.Write((int)gridStyle);
			ctx.writer.Write(crossRadius);

			// new in save format 20
			ctx.saveReference(this, exteriorBrush, 6);
			ctx.writer.Write(arrowsSnapToBorders);
			ctx.writer.Write((int)arrowSelStyle);

			// new in save format 21
			bool tagSerializable = false;
			if (Tag != null)
				tagSerializable = Tag.GetType().IsSerializable;
			ctx.writer.Write(tagSerializable);

			if (tagSerializable)
				ctx.saveTag(Tag);

			// new in save format 27
			ctx.writer.Write(roundedArrows);
			ctx.writer.Write(roundedArrowsRadius);

			// write the chart objects
			ctx.writeReferencedObjects();

			if (clearDirty)
				Dirty = false;
		}
Beispiel #3
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);
		}
Beispiel #4
0
		public override void saveTo(BinaryWriter writer, PersistContext ctx)
		{
			base.saveTo(writer, ctx);

			writer.Write(Expanded);
			writer.Write(Expandable);
			writer.Write((long)enabledHandles);
			writer.Write((int)style);
			ctx.saveColor(fillColor);
			ctx.saveColor(frameColor);
			writer.Write((int)ImageAlign);
			writer.Write(text);
			ctx.saveColor(textColor);
			ctx.saveStringFormat(textFormat);
			writer.Write(transparent);

			ctx.saveReference(this, incomingArrows, 1);
			ctx.saveReference(this, outgoingArrows, 2);
			writer.Write((int)0/*anchorIncoming*/);
			writer.Write((int)0/*anchorOutgoing*/);
			writer.Write((int)customDraw);

			ctx.saveImage(image);

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

			writer.Write((int)selStyle);

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

			// new in save format 6
			writer.Write(PolyTextLayout);
			writer.Write((double)shapeRotation);

			if (shapeTemplate != null)
			{
				writer.Write((int)0);
				writer.Write(shapeTemplate.Id);
				if (shapeTemplate.Id == "")
				{
					ctx.saveObject(shapeTemplate);
					ctx.saveObject(shapeData);
				}
			}
			else
			{
				writer.Write((int)-1);
			}

			// new in save format 13
			// now in Node: writer.Write(hyperLink);

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

			// new in save format 22
			writer.Write(rotationAngle);
			writer.Write(rotateContents);
		}