예제 #1
0
 internal static void StoreBrushes(BinaryWriter writer, PersistContext ctx)
 {
     writer.Write(_brushes.Count);
     foreach (Brush br in _brushes)
     {
         ctx.saveObject(br);
     }
 }
예제 #2
0
        public virtual void saveTo(BinaryWriter writer, PersistContext ctx)
        {
            ctx.saveReference(this, prevPoints, 1);
            ctx.saveRect(prevRect);
            writer.Write(attachments.Count);
            for (int i = 0; i < attachments.Count; ++i)
            {
                Attachment atch = (Attachment)attachments[i];
                ctx.saveObject(atch);
            }
            ctx.saveReference(this, mainObj, 2);

            writer.Write(visible);

            bool tagSerializable = false;

            if (tag != null)
            {
                tagSerializable = tag.GetType().IsSerializable;
            }
            writer.Write(tagSerializable);

            if (tagSerializable)
            {
                ctx.saveTag(tag);
            }

            // new in save format 17
            writer.Write(autoDeleteItems);

            // new in save format 21
            writer.Write(expandable);

            // new in save format 22
            writer.Write(followMasterRotation);
        }
예제 #3
0
파일: Table.cs 프로젝트: ChrisMoreton/Test3
		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);
		}
예제 #4
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);
		}
예제 #5
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;
		}
예제 #6
0
파일: Group.cs 프로젝트: ChrisMoreton/Test3
		public virtual void saveTo(BinaryWriter writer, PersistContext ctx)
		{
			ctx.saveReference(this, prevPoints, 1);
			ctx.saveRect(prevRect);
			writer.Write(attachments.Count);
			for (int i = 0; i < attachments.Count; ++i)
			{
				Attachment atch = (Attachment)attachments[i];
				ctx.saveObject(atch);
			}
			ctx.saveReference(this, mainObj, 2);

			writer.Write(visible);

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

			if (tagSerializable)
				ctx.saveTag(tag);

			// new in save format 17
			writer.Write(autoDeleteItems);

			// new in save format 21
			writer.Write(expandable);

			// new in save format 22
			writer.Write(followMasterRotation);
		}
예제 #7
0
파일: Arrow.cs 프로젝트: ChrisMoreton/Test3
		public override void saveTo(BinaryWriter writer, PersistContext ctx)
		{
			base.saveTo(writer, ctx);

			writer.Write((int)style);
			ctx.saveColor(penColor);
			ctx.saveReference(this, orgnLink, 1);
			ctx.saveReference(this, destLink, 2);
			writer.Write(segmentCount);
			writer.Write(text);
			ctx.saveColor(textColor);
			writer.Write((int)arrowHead);
			writer.Write((int)arrowBase);
			writer.Write((int)arrowInterm);
			writer.Write((double)headSize);
			writer.Write((double)baseSize);
			writer.Write((double)intermSize);
			ctx.saveColor(fillColor);
			writer.Write(dynamic);
			writer.Write((int)cascadeOrientation);
			writer.Write(cascadeStartHorizontal);
			writer.Write(reflexive);
			ctx.saveReference(this, points, 3);
			ctx.saveReference(this, null, 4);

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

			// new in file format 5
			writer.Write(allowMoveStart);
			writer.Write(allowMoveEnd);
			writer.Write(orgnAnchor);
			writer.Write(destAnchor);

			// new in file format 8
			writer.Write(autoRoute);
			writer.Write(retainForm);
			writer.Write((int)textStyle);

			// new in file format 10
			ctx.saveObject(headPen);

			// new in file format 17
			writer.Write((int)customDraw);

			// new in file format 20
			writer.Write(snapToNodeBorder);
			writer.Write((int)selStyle);

			// new in file format 26
			writer.Write(hyperLink);

			// new in file format 29
			writer.Write(drawCrossings);
		}
예제 #8
0
파일: Box.cs 프로젝트: ChrisMoreton/Test3
		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);
		}
예제 #9
0
		public virtual void saveTo(BinaryWriter writer, PersistContext ctx)
		{
			int num = 0;

			// save outline
			num = elements.GetLength(0);
			writer.Write(num);
			for (int i = 0; i < num; ++i)
				ctx.saveObject(elements[i]);

			// new in save format 6

			// save decorations
			if (decorations != null)
			{
				num = decorations.GetLength(0);
				writer.Write(num);
				for (int i = 0; i < num; ++i)
					ctx.saveObject(decorations[i]);
			}
			else
			{
				writer.Write((int)0);
			}

			// save text region
			if (textArea != null)
			{
				num = textArea.GetLength(0);
				writer.Write(num);
				for (int i = 0; i < num; ++i)
					ctx.saveObject(textArea[i]);
			}
			else
			{
				writer.Write((int)0);
			}
		}