Exemplo n.º 1
0
            public override void ReadXml(System.Xml.XmlReader reader)
            {
                base.ReadXml(reader);
                // avoid using the accessor to reduce the number of call of updateBitmap
                // for some strange reason, the new lines are read "/n" no matter the environnement,
                // so reset it as the environnement wants it, such as the edit text form works correctly
                mText            = reader.ReadElementContentAsString().Replace("\n", Environment.NewLine);
                mOrientation     = reader.ReadElementContentAsFloat();
                mTextBrush.Color = XmlReadWrite.readColor(reader);
                mTextFont        = XmlReadWrite.readFont(reader);
                // for the last use the accessor to recreate the bitmap
                string alignment = reader.ReadElementContentAsString();

                if (alignment.Equals("Near"))
                {
                    TextAlignment = StringAlignment.Near;
                }
                else if (alignment.Equals("Far"))
                {
                    TextAlignment = StringAlignment.Far;
                }
                else
                {
                    TextAlignment = StringAlignment.Center;
                }
                // read the end element of the brick
                reader.ReadEndElement();
            }
Exemplo n.º 2
0
 public override void WriteXml(System.Xml.XmlWriter writer)
 {
     writer.WriteStartElement("TextCell");
     base.WriteXml(writer);
     writer.WriteElementString("Text", mText);
     writer.WriteElementString("Orientation", mOrientation.ToString(System.Globalization.CultureInfo.InvariantCulture));
     XmlReadWrite.writeColor(writer, "FontColor", FontColor);
     XmlReadWrite.writeFont(writer, "Font", mTextFont);
     writer.WriteElementString("TextAlignment", TextAlignment.ToString());
     writer.WriteEndElement();                 // end of TextCell
 }
Exemplo n.º 3
0
 public override void ReadXml(System.Xml.XmlReader reader)
 {
     base.ReadXml(reader);
     GridColor          = XmlReadWrite.readColor(reader);
     GridThickness      = reader.ReadElementContentAsFloat();
     SubGridColor       = XmlReadWrite.readColor(reader);
     SubGridThickness   = reader.ReadElementContentAsFloat();
     mGridSizeInStud    = reader.ReadElementContentAsInt();
     mSubDivisionNumber = Math.Max(reader.ReadElementContentAsInt(), 2);
     if (reader.Name.Equals("DisplayGrid"))
     {
         mDisplayGrid = reader.ReadElementContentAsBoolean();
     }
     mDisplaySubGrid      = reader.ReadElementContentAsBoolean();
     mDisplayCellIndex    = reader.ReadElementContentAsBoolean();
     mCellIndexFont       = XmlReadWrite.readFont(reader);
     CellIndexColor       = XmlReadWrite.readColor(reader);
     mCellIndexColumnType = (CellIndexType)reader.ReadElementContentAsInt();
     mCellIndexRowType    = (CellIndexType)reader.ReadElementContentAsInt();
     mCellIndexCorner     = XmlReadWrite.readPoint(reader);
     // step the progress bar for the grid
     MainForm.Instance.stepProgressBar();
 }