Ejemplo n.º 1
0
 internal ConsoleDataBlock(byte[] bytes, int offset)
 {
     BlockSize              = BitConverter.ToUInt32(bytes, offset);
     Name                   = (EXTRA_DATA_TYPE)BitConverter.ToUInt32(bytes, offset + 0x04);
     FillAttribute          = (FILL)BitConverter.ToUInt16(bytes, offset + 0x08);
     PopupFillAttribute     = (FILL)BitConverter.ToUInt16(bytes, offset + 0x0A);
     ScreenBufferSizeX      = BitConverter.ToInt16(bytes, offset + 0x0C);
     ScreenBufferSizeY      = BitConverter.ToInt16(bytes, offset + 0x0E);
     WindowSizeX            = BitConverter.ToInt16(bytes, offset + 0x10);
     WindowSizeY            = BitConverter.ToInt16(bytes, offset + 0x12);
     WindowOriginX          = BitConverter.ToInt16(bytes, offset + 0x14);
     WindowOriginY          = BitConverter.ToInt16(bytes, offset + 0x16);
     FontSize               = BitConverter.ToUInt32(bytes, offset + 0x20);
     FontFamily             = (FONT)BitConverter.ToUInt32(bytes, offset + 0x24);
     FontWeight             = BitConverter.ToUInt32(bytes, offset + 0x28);
     FaceName               = Encoding.Unicode.GetString(bytes, offset + 0x2C, 0x40);
     CursorSize             = BitConverter.ToUInt32(bytes, offset + 0x30);
     FullScreen             = BitConverter.ToUInt32(bytes, offset + 0x34) != 0;
     QuickEdit              = BitConverter.ToUInt32(bytes, offset + 0x38) != 0;
     InsertMode             = BitConverter.ToUInt32(bytes, offset + 0x3C) != 0;
     AutoPosition           = BitConverter.ToUInt32(bytes, offset + 0x40) != 0;
     HistoryBufferSize      = BitConverter.ToUInt32(bytes, offset + 0x44);
     NumberOfHistroyBuffers = BitConverter.ToUInt32(bytes, offset + 0x48);
     HistoryNoDup           = BitConverter.ToUInt32(bytes, offset + 0x4C) != 0;
     // More research needed
     ColorTable = Helper.GetSubArray(bytes, offset + 0x50, 0x40);
 }
Ejemplo n.º 2
0
        private void ExtractValues(string elementName, XmlReader reader)
        {
            for (int i = 0; i < reader.AttributeCount; ++i)
            {
                reader.MoveToAttribute(i);

                string name  = reader.Name;
                string value = reader.Value;

                if (SRC.Equals(name))
                {
                    this.src = value;
                }
                else if (CAT.Equals(name))
                {
                    this.category = value;
                }
                else if (FILL.Equals(name))
                {
                    this.fill.Color = XmlUtils.GetColor(value);
                }
                else if (STROKE.Equals(name))
                {
                    this.stroke.Color = XmlUtils.GetColor(value);
                }
                else if (SYMBOL_HEIGHT.Equals(name))
                {
                    this.height = XmlUtils.ParseNonNegativeInteger(name, value) * displayModel.ScaleFactor;
                }
                else if (SYMBOL_PERCENT.Equals(name))
                {
                    this.percent = XmlUtils.ParseNonNegativeInteger(name, value);
                }
                else if (SYMBOL_SCALING.Equals(name))
                {
                    this.scaling = FromValue(value);
                }
                else if (SYMBOL_WIDTH.Equals(name))
                {
                    this.width = XmlUtils.ParseNonNegativeInteger(name, value) * displayModel.ScaleFactor;
                }
                else if (STROKE_WIDTH.Equals(name))
                {
                    this.strokeWidth = XmlUtils.ParseNonNegativeFloat(name, value) * displayModel.ScaleFactor;
                }
                else
                {
                    throw XmlUtils.CreateXmlReaderException(elementName, name, value, i);
                }
            }
        }
Ejemplo n.º 3
0
        private void ExtractValues(IGraphicFactory graphicFactory, DisplayModel displayModel, string elementName, XmlReader reader)
        {
            for (int i = 0; i < reader.AttributeCount; ++i)
            {
                reader.MoveToAttribute(i);

                string name  = reader.Name;
                string value = reader.Value;

                if (RADIUS.Equals(name) || (XmlUtils.supportOlderRenderThemes && R.Equals(name)))
                {
                    this.radius = Convert.ToSingle(XmlUtils.ParseNonNegativeFloat(name, value)) * displayModel.ScaleFactor;
                }
                else if (SCALE_RADIUS.Equals(name))
                {
                    this.scaleRadius = bool.Parse(value);
                }
                else if (CAT.Equals(name))
                {
                    this.category = value;
                }
                else if (FILL.Equals(name))
                {
                    this.fill.Color = XmlUtils.GetColor(value);
                }
                else if (STROKE.Equals(name))
                {
                    this.stroke.Color = XmlUtils.GetColor(value);
                }
                else if (STROKE_WIDTH.Equals(name))
                {
                    this.strokeWidth = XmlUtils.ParseNonNegativeFloat(name, value) * displayModel.ScaleFactor;
                }
                else
                {
                    throw XmlUtils.CreateXmlReaderException(elementName, name, value, i);
                }
            }

            XmlUtils.CheckMandatoryAttribute(elementName, RADIUS, this.radius);
        }
Ejemplo n.º 4
0
        private void ExtractValues(IGraphicFactory graphicFactory, DisplayModel displayModel, string elementName, XmlReader reader)
        {
            FontFamily fontFamily = FontFamily.Default;
            FontStyle  fontStyle  = FontStyle.Normal;

            for (int i = 0; i < reader.AttributeCount; ++i)
            {
                reader.MoveToAttribute(i);

                string name  = reader.Name;
                string value = reader.Value;

                if (K.Equals(name))
                {
                    this.textKey = TextKey.getInstance(value);
                }
                else if (POSITION.Equals(name))
                {
                    this.position = value.ToPosition();
                }
                else if (CAT.Equals(name))
                {
                    this.category = value;
                }
                else if (DISPLAY.Equals(name))
                {
                    this.display = value.ToDisplay();
                }
                else if (DY.Equals(name))
                {
                    this.dy = float.Parse(value) * displayModel.ScaleFactor;
                }
                else if (FONT_FAMILY.Equals(name))
                {
                    fontFamily = value.ToFontFamily();
                }
                else if (FONT_STYLE.Equals(name))
                {
                    fontStyle = value.ToFontStyle();
                }
                else if (FONT_SIZE.Equals(name))
                {
                    this.fontSize = XmlUtils.ParseNonNegativeFloat(name, value) * displayModel.ScaleFactor;
                }
                else if (FILL.Equals(name))
                {
                    this.fill.Color = XmlUtils.GetColor(value);
                }
                else if (PRIORITY.Equals(name))
                {
                    this.priority = int.Parse(value);
                }
                else if (STROKE.Equals(name))
                {
                    this.stroke.Color = XmlUtils.GetColor(value);
                }
                else if (STROKE_WIDTH.Equals(name))
                {
                    this.stroke.StrokeWidth = XmlUtils.ParseNonNegativeFloat(name, value) * displayModel.ScaleFactor;
                }
                else if (SYMBOL_ID.Equals(name))
                {
                    this.symbolId = value;
                }
                else
                {
                    throw XmlUtils.CreateXmlReaderException(elementName, name, value, i);
                }
            }

            this.fill.SetTypeface(fontFamily, fontStyle);
            this.stroke.SetTypeface(fontFamily, fontStyle);

            XmlUtils.CheckMandatoryAttribute(elementName, K, this.textKey);
        }
Ejemplo n.º 5
0
 internal ConsoleDataBlock(byte[] bytes, int offset)
 {
     BlockSize = BitConverter.ToUInt32(bytes, offset);
     Name = (EXTRA_DATA_TYPE)BitConverter.ToUInt32(bytes, offset + 0x04);
     FillAttribute = (FILL)BitConverter.ToUInt16(bytes, offset + 0x08);
     PopupFillAttribute = (FILL)BitConverter.ToUInt16(bytes, offset + 0x0A);
     ScreenBufferSizeX = BitConverter.ToInt16(bytes, offset + 0x0C);
     ScreenBufferSizeY = BitConverter.ToInt16(bytes, offset + 0x0E);
     WindowSizeX = BitConverter.ToInt16(bytes, offset + 0x10);
     WindowSizeY = BitConverter.ToInt16(bytes, offset + 0x12);
     WindowOriginX = BitConverter.ToInt16(bytes, offset + 0x14);
     WindowOriginY = BitConverter.ToInt16(bytes, offset + 0x16);
     FontSize = BitConverter.ToUInt32(bytes, offset + 0x20);
     FontFamily = (FONT)BitConverter.ToUInt32(bytes, offset + 0x24);
     FontWeight = BitConverter.ToUInt32(bytes, offset + 0x28);
     FaceName = Encoding.Unicode.GetString(bytes, offset + 0x2C, 0x40);
     CursorSize = BitConverter.ToUInt32(bytes, offset + 0x30);
     FullScreen = BitConverter.ToUInt32(bytes, offset + 0x34) != 0;
     QuickEdit = BitConverter.ToUInt32(bytes, offset + 0x38) != 0;
     InsertMode = BitConverter.ToUInt32(bytes, offset + 0x3C) != 0;
     AutoPosition = BitConverter.ToUInt32(bytes, offset + 0x40) != 0;
     HistoryBufferSize = BitConverter.ToUInt32(bytes, offset + 0x44);
     NumberOfHistroyBuffers = BitConverter.ToUInt32(bytes, offset + 0x48);
     HistoryNoDup = BitConverter.ToUInt32(bytes, offset + 0x4C) != 0;
     // More research needed
     ColorTable = NativeMethods.GetSubArray(bytes, (uint)offset + 0x50, 0x40);
 }