Ejemplo n.º 1
0
 /// <ToBeCompleted></ToBeCompleted>
 public void LoadInnerObjects(string propertyName, IRepositoryReader reader, int version)
 {
     if (propertyName == null)
     {
         throw new ArgumentNullException("propertyName");
     }
     if (reader == null)
     {
         throw new ArgumentNullException("reader");
     }
     if (propertyName == "ConnectionPointMappings")
     {
         // load ConnectionPoint mappings
         reader.BeginReadInnerObjects();
         while (reader.BeginReadInnerObject())
         {
             ControlPointId connectionPointId = reader.ReadInt32();
             TerminalId     terminalId        = reader.ReadInt32();
             // The following is the essence of MapTerminal without the checks.
             if (connectionPointMappings.ContainsKey(connectionPointId))
             {
                 connectionPointMappings[connectionPointId] = terminalId;
             }
             else
             {
                 connectionPointMappings.Add(connectionPointId, terminalId);
             }
             reader.EndReadInnerObject();
         }
         reader.EndReadInnerObjects();
     }
 }
Ejemplo n.º 2
0
 /// <ToBeCompleted></ToBeCompleted>
 public virtual void LoadFields(IRepositoryReader reader, int version)
 {
     if (reader == null)
     {
         throw new ArgumentNullException("reader");
     }
     shapePropertyId = reader.ReadInt32();
     modelPropertyId = reader.ReadInt32();
 }
Ejemplo n.º 3
0
 /// <override></override>
 protected override void LoadFieldsCore(IRepositoryReader reader, int version)
 {
     base.LoadFieldsCore(reader, version);
     gluePointPos.X = reader.ReadInt32();
     gluePointPos.Y = reader.ReadInt32();
     if (version >= 3)
     {
         maintainOrientation = reader.ReadBool();
     }
 }
Ejemplo n.º 4
0
        /// <override></override>
        protected override void LoadFieldsCore(IRepositoryReader reader, int version)
        {
            template = reader.ReadTemplate();
            int x = reader.ReadInt32();
            int y = reader.ReadInt32();

            MoveTo(x, y);
            ZOrder = reader.ReadInt32();
            Layers = (LayerIds)reader.ReadInt32();
            angle  = reader.ReadInt32();
        }
Ejemplo n.º 5
0
        /// <override></override>
        protected override void LoadFieldsCore(IRepositoryReader reader, int version)
        {
            _template = reader.ReadTemplate();
            int x = reader.ReadInt32();
            int y = reader.ReadInt32();

            MoveTo(x, y);
            ZOrder             = reader.ReadInt32();
            SupplementalLayers = (LayerIds)reader.ReadInt32();
            _angle             = reader.ReadInt32();
            if (version >= 5)
            {
                _data = reader.ReadString();
            }
        }
Ejemplo n.º 6
0
 /// <override></override>
 protected override void LoadFieldsCore(IRepositoryReader reader, int version)
 {
     base.LoadFieldsCore(reader, version);
     integerValue = reader.ReadInt32();
     floatValue   = reader.ReadFloat();
     stringValue  = reader.ReadString();
 }
Ejemplo n.º 7
0
 /// <override></override>
 public override void LoadFields(IRepositoryReader reader, int version)
 {
     base.LoadFields(reader, version);
     mappingType = (MappingType)reader.ReadInt32();
     intercept   = reader.ReadFloat();
     slope       = reader.ReadFloat();
 }
Ejemplo n.º 8
0
        private IStyle ReadStyle(IRepositoryReader reader)
        {
            IStyle          result;
            MappedStyleType mappedStyleType = (MappedStyleType)reader.ReadInt32();

            switch (mappedStyleType)
            {
            case MappedStyleType.CapStyle:
                result = reader.ReadCapStyle(); break;

            case MappedStyleType.CharacterStyle:
                result = reader.ReadCharacterStyle(); break;

            case MappedStyleType.ColorStyle:
                result = reader.ReadColorStyle(); break;

            case MappedStyleType.FillStyle:
                result = reader.ReadFillStyle(); break;

            case MappedStyleType.LineStyle:
                result = reader.ReadLineStyle(); break;

            case MappedStyleType.ParagraphStyle:
                result = reader.ReadParagraphStyle(); break;

            case MappedStyleType.Unassigned:
                // Skip value - it does not matter what we read here
                reader.ReadColorStyle();                                // ToDo: Find a better solution for skipping an object id
                result = null;
                break;

            default: throw new NShapeUnsupportedValueException(mappedStyleType);
            }
            return(result);
        }
Ejemplo n.º 9
0
 /// <override></override>
 protected override void LoadFieldsCore(IRepositoryReader reader, int version)
 {
     base.LoadFieldsCore(reader, version);
     // Read Diameter and update the shape's points
     diameter = reader.ReadFloat();
     UpdateShapePoints();
     VertexCount = reader.ReadInt32();
 }
Ejemplo n.º 10
0
 /// <override></override>
 public override void LoadFields(IRepositoryReader reader, int version)
 {
     base.LoadFields(reader, version);
     mappingType = (MappingType)reader.ReadInt32();
     if (mappingType == MappingType.IntegerStyle)
     {
         intRanges = new SortedList <int, IStyle>();
     }
     else
     {
         floatRanges = new SortedList <float, IStyle>();
     }
     defaultStyle = ReadStyle(reader);
 }
Ejemplo n.º 11
0
 void IEntity.LoadInnerObjects(string propertyName, IRepositoryReader reader, int version)
 {
     Project.AssertSupportedVersion(false, version);
     reader.BeginReadInnerObjects();
     while (reader.BeginReadInnerObject())
     {
         LibraryData ld = new LibraryData(null, null, 0);
         ld.Name              = reader.ReadString();
         ld.AssemblyName      = reader.ReadString();
         ld.RepositoryVersion = reader.ReadInt32();
         libraries.Add(ld);
         reader.EndReadInnerObject();
     }
     reader.EndReadInnerObjects();
 }
Ejemplo n.º 12
0
 /// <override></override>
 protected override void LoadFieldsCore(IRepositoryReader reader, int version)
 {
     base.LoadFieldsCore(reader, version);
     shapePoints[0].X = reader.ReadInt32();
     shapePoints[0].Y = reader.ReadInt32();
     shapePoints[1].X = reader.ReadInt32();
     shapePoints[1].Y = reader.ReadInt32();
     shapePoints[2].X = reader.ReadInt32();
     shapePoints[2].Y = reader.ReadInt32();
 }
Ejemplo n.º 13
0
 /// <override></override>
 public override void LoadFields(IRepositoryReader reader, int version)
 {
     base.LoadFields(reader, version);
     mappingType = (MappingType)reader.ReadInt32();
     format      = reader.ReadString();
 }
Ejemplo n.º 14
0
		/// <override></override>
		protected override void LoadFieldsCore(IRepositoryReader reader, int version) {
			base.LoadFieldsCore(reader, version);
			internalDiameter = reader.ReadInt32();
		}
Ejemplo n.º 15
0
		/// <override></override>
		protected override void LoadFieldsCore(IRepositoryReader reader, int version)
		{
			base.LoadFieldsCore(reader, version);
			Width = reader.ReadInt32();
			Height = reader.ReadInt32();
		}
Ejemplo n.º 16
0
 void IEntity.LoadInnerObjects(string propertyName, IRepositoryReader reader, int version)
 {
     Debug.Assert(propertyName == "Layers");
     Debug.Assert(layers.Count == 0);
     reader.BeginReadInnerObjects();
     while (reader.BeginReadInnerObject()) {
         int id = reader.ReadInt32();
         string name = reader.ReadString();
         Layer l = new Layer(name);
         l.Id = (LayerIds)id;
         l.Title = reader.ReadString();
         l.LowerZoomThreshold = reader.ReadInt32();
         l.UpperZoomThreshold = reader.ReadInt32();
         reader.EndReadInnerObject();
         layers.Add(l);
     }
     reader.EndReadInnerObjects();
 }
Ejemplo n.º 17
0
 void IEntity.LoadFields(IRepositoryReader reader, int version)
 {
     name = reader.ReadString();
     if (version >= 3) title = reader.ReadString();
     if (version >= 4) securityDomainName = reader.ReadChar();
     size.Width = reader.ReadInt32();
     size.Height = reader.ReadInt32();
     backColor = Color.FromArgb(reader.ReadInt32());
     targetColor = Color.FromArgb(reader.ReadInt32());
     string imgName = reader.ReadString();
     Image img = reader.ReadImage();
     if (img != null) backImage = new NamedImage(img, imgName);
     imageLayout = (ImageLayoutMode)reader.ReadByte();
     imageGamma = reader.ReadFloat();
     imageTransparency = reader.ReadByte();
     imageGrayScale = reader.ReadBool();
     imageTransparentColor = Color.FromArgb(reader.ReadInt32());
 }
Ejemplo n.º 18
0
		/// <ToBeCompleted></ToBeCompleted>
		public void LoadInnerObjects(string propertyName, IRepositoryReader reader, int version) {
			if (propertyName == null) throw new ArgumentNullException("propertyName");
			if (reader == null) throw new ArgumentNullException("reader");
			if (propertyName == "ConnectionPointMappings") {
				// load ConnectionPoint mappings			
				reader.BeginReadInnerObjects();
				while (reader.BeginReadInnerObject()) {
					ControlPointId connectionPointId = reader.ReadInt32();
					TerminalId terminalId = reader.ReadInt32();
					// The following is the essence of MapTerminal without the checks.
					if (connectionPointMappings.ContainsKey(connectionPointId))
						connectionPointMappings[connectionPointId] = terminalId;
					else
						connectionPointMappings.Add(connectionPointId, terminalId);
					reader.EndReadInnerObject();
				}
				reader.EndReadInnerObjects();
			}
		}
Ejemplo n.º 19
0
 /// <override></override>
 protected override void LoadFieldsCore(IRepositoryReader reader, int version)
 {
     base.LoadFieldsCore(reader, version);
     shapePoints[0].X = reader.ReadInt32();
     shapePoints[0].Y = reader.ReadInt32();
     shapePoints[1].X = reader.ReadInt32();
     shapePoints[1].Y = reader.ReadInt32();
     shapePoints[2].X = reader.ReadInt32();
     shapePoints[2].Y = reader.ReadInt32();
 }
Ejemplo n.º 20
0
 /// <ToBeCompleted></ToBeCompleted>
 public virtual void LoadFields(IRepositoryReader reader, int version)
 {
     if (reader == null) throw new ArgumentNullException("reader");
     shapePropertyId = reader.ReadInt32();
     modelPropertyId = reader.ReadInt32();
 }
Ejemplo n.º 21
0
 /// <override></override>
 public override void LoadFields(IRepositoryReader reader, int version)
 {
     base.LoadFields(reader, version);
     mappingType = (MappingType)reader.ReadInt32();
     intercept = reader.ReadFloat();
     slope = reader.ReadFloat();
 }
Ejemplo n.º 22
0
 /// <override></override>
 protected override void LoadFieldsCore(IRepositoryReader reader, int version)
 {
     base.LoadFieldsCore(reader, version);
     _internalDiameter = reader.ReadInt32();
 }
Ejemplo n.º 23
0
		/// <override></override>
		protected override void LoadFieldsCore(IRepositoryReader reader, int version) {
			base.LoadFieldsCore(reader, version);
			gluePointPos.X = reader.ReadInt32();
			gluePointPos.Y = reader.ReadInt32();
			if (version > 2) maintainOrientation = reader.ReadBool();
		}
Ejemplo n.º 24
0
		/// <override></override>
		protected override void LoadFieldsCore(IRepositoryReader reader, int version)
		{
			template = reader.ReadTemplate();
			int x = reader.ReadInt32();
			int y = reader.ReadInt32();
			MoveTo(x, y);
			ZOrder = reader.ReadInt32();
			Layers = (LayerIds) reader.ReadInt32();
			angle = reader.ReadInt32();
		}
 /// <override></override>
 protected override void LoadFieldsCore(IRepositoryReader reader, int version)
 {
     base.LoadFieldsCore(reader, version);
     imageLayout = (ImageLayoutMode)reader.ReadByte();
     imageTransparency = reader.ReadByte();
     imageGamma = reader.ReadFloat();
     compressionQuality = reader.ReadByte();
     imageGrayScale = reader.ReadBool();
     string name = reader.ReadString();
     Image img = reader.ReadImage();
     if (name != null && img != null)
         image = new NamedImage(img, name);
     transparentColor = Color.FromArgb(reader.ReadInt32());
 }
Ejemplo n.º 26
0
 /// <override></override>
 protected override void LoadFieldsCore(IRepositoryReader reader, int version)
 {
     base.LoadFieldsCore(reader, version);
     ColumnBackgroundColorStyle = reader.ReadColorStyle();
     ColumnCharacterStyle = reader.ReadCharacterStyle();
     ColumnParagraphStyle = reader.ReadParagraphStyle();
     int colCnt = reader.ReadInt32();
     if (columnNames == null) columnNames = new string[colCnt];
     else Array.Resize(ref columnNames, colCnt);
 }
Ejemplo n.º 27
0
		/// <override></override>
		protected override void LoadFieldsCore(IRepositoryReader reader, int version)
		{
			base.LoadFieldsCore(reader, version);
			fillStyle = reader.ReadFillStyle();
			charStyle = reader.ReadCharacterStyle();
			paragraphStyle = reader.ReadParagraphStyle();

			string txt = reader.ReadString();
			if (caption == null) caption = new Caption(txt);
			else caption.Text = txt;
			w = reader.ReadInt32();
			h = reader.ReadInt32();
		}
Ejemplo n.º 28
0
 /// <override></override>
 protected override void LoadFieldsCore(IRepositoryReader reader, int version)
 {
     base.LoadFieldsCore(reader, version);
     diameter = reader.ReadFloat();
     VertexCount = reader.ReadInt32();
 }
Ejemplo n.º 29
0
 /// <override></override>
 protected override void LoadInnerObjectsCore(string propertyName, IRepositoryReader reader, int version)
 {
     if (propertyName == attrNameColumns) {
         reader.BeginReadInnerObjects();
         while (reader.BeginReadInnerObject()) {
             int colIdx = reader.ReadInt32();
             string colName = reader.ReadString();
             reader.EndReadInnerObject();
             InsertColumn(colIdx, colName);
         }
         reader.EndReadInnerObjects();
     } else base.LoadInnerObjectsCore(propertyName, reader, version);
 }
Ejemplo n.º 30
0
 /// <override></override>
 protected override void LoadFieldsCore(IRepositoryReader reader, int version)
 {
     base.LoadFieldsCore(reader, version);
     HeadWidth  = reader.ReadInt32();
     BodyHeight = reader.ReadInt32();
 }
Ejemplo n.º 31
0
 /// <override></override>
 protected override void LoadFieldsCore(IRepositoryReader reader, int version)
 {
     base.LoadFieldsCore(reader, version);
     angle = reader.ReadInt32();
     privateFillStyle = reader.ReadFillStyle();
 }
Ejemplo n.º 32
0
 /// <override></override>
 public override void LoadFields(IRepositoryReader reader, int version)
 {
     base.LoadFields(reader, version);
     mappingType = (MappingType)reader.ReadInt32();
     if (mappingType == MappingType.IntegerStyle)
         intRanges = new SortedList<int, IStyle>();
     else floatRanges = new SortedList<float, IStyle>();
     defaultStyle = ReadStyle(reader);
 }
Ejemplo n.º 33
0
 /// <override></override>
 protected override void LoadFieldsCore(IRepositoryReader reader, int version)
 {
     base.LoadFieldsCore(reader, version);
     diameter    = reader.ReadFloat();
     VertexCount = reader.ReadInt32();
 }
Ejemplo n.º 34
0
 private IStyle ReadStyle(IRepositoryReader reader)
 {
     IStyle result;
     MappedStyleType mappedStyleType = (MappedStyleType)reader.ReadInt32();
     switch (mappedStyleType) {
         case MappedStyleType.CapStyle:
             result = reader.ReadCapStyle(); break;
         case MappedStyleType.CharacterStyle:
             result = reader.ReadCharacterStyle(); break;
         case MappedStyleType.ColorStyle:
             result = reader.ReadColorStyle(); break;
         case MappedStyleType.FillStyle:
             result = reader.ReadFillStyle(); break;
         case MappedStyleType.LineStyle:
             result = reader.ReadLineStyle(); break;
         case MappedStyleType.ParagraphStyle:
             result = reader.ReadParagraphStyle(); break;
         case MappedStyleType.Unassigned:
             // Skip value - it does not matter what we read here
             reader.ReadColorStyle();	// ToDo: Find a better solution for skipping an object id
             result = null;
             break;
         default: throw new NShapeUnsupportedValueException(mappedStyleType);
     }
     return result;
 }
Ejemplo n.º 35
0
 /// <override></override>
 protected override void LoadFieldsCore(IRepositoryReader reader, int version)
 {
     base.LoadFieldsCore(reader, version);
     angle            = reader.ReadInt32();
     privateFillStyle = reader.ReadFillStyle();
 }
Ejemplo n.º 36
0
 /// <override></override>
 public override void LoadFields(IRepositoryReader reader, int version)
 {
     base.LoadFields(reader, version);
     mappingType = (MappingType)reader.ReadInt32();
     format = reader.ReadString();
 }