Пример #1
0
		public Page(float width, float height, SvgLengthType unit)
		{
			this.Width = width;
			this.Height = height;
			this.Unit = unit;

			this.SvgLengthWidth = GetSvgLength(width);
			this.SvgLengthHeight = GetSvgLength(height);
		}
Пример #2
0
        public Page(float width, float height, SvgLengthType unit)
        {
            this.Width  = width;
            this.Height = height;
            this.Unit   = unit;

            this.SvgLengthWidth  = GetSvgLength(width);
            this.SvgLengthHeight = GetSvgLength(height);
        }
Пример #3
0
        public void FromString(string s)
        {
            int i = s.LastIndexOfAny(new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' });

            if (i == -1)
            {
                return;
            }

            _num = float.Parse(s.Substring(0, i + 1), System.Globalization.CultureInfo.InvariantCulture);

            switch (s.Substring(i + 1))
            {
            case "%":
                _type = SvgLengthType.SVG_LENGTHTYPE_PERCENTAGE;
                break;

            case "em":
                _type = SvgLengthType.SVG_LENGTHTYPE_EMS;
                break;

            case "ex":
                _type = SvgLengthType.SVG_LENGTHTYPE_EXS;
                break;

            case "px":
                _type = SvgLengthType.SVG_LENGTHTYPE_PX;
                break;

            case "cm":
                _type = SvgLengthType.SVG_LENGTHTYPE_CM;
                break;

            case "mm":
                _type = SvgLengthType.SVG_LENGTHTYPE_MM;
                break;

            case "in":
                _type = SvgLengthType.SVG_LENGTHTYPE_IN;
                break;

            case "pt":
                _type = SvgLengthType.SVG_LENGTHTYPE_PT;
                break;

            case "pc":
                _type = SvgLengthType.SVG_LENGTHTYPE_PC;
                break;

            case "":
                _type = SvgLengthType.SVG_LENGTHTYPE_UNKNOWN;
                break;

            default:
                throw new SvgException("Invalid SvgLength", s);
            }
        }
Пример #4
0
 public void ConvertToSpecifiedUnits(SvgLengthType unitType)
 {
 }
Пример #5
0
 /// <summary>
 /// Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object.
 /// </summary>
 /// <param name="unitType">The unitType for the value (e.g., MM). </param>
 /// <param name="valueInSpecifiedUnits">The new value</param>
 public void NewValueSpecifiedUnits(SvgLengthType unitType, double valueInSpecifiedUnits)
 {
     cssLength.SetFloatValue((CssPrimitiveType)unitType, valueInSpecifiedUnits);
 }
Пример #6
0
 public void ConvertToSpecifiedUnits(SvgLengthType unitType)
 {
     _domSvgLength.Instance.ConvertToSpecifiedUnits((ushort)unitType);
 }
Пример #7
0
        /// <summary>
        /// Preserve the same underlying stored value, but reset the stored unit identifier to the given unitType.
        /// Object attributes unitType, valueAsSpecified and valueAsString might be modified as a result of this
        /// method. For example, if the original value were "0.5cm" and the method was invoked to convert to
        /// millimeters, then the unitType would be changed to MM, valueAsSpecified would be changed to the
        /// numeric value 5 and valueAsString would be changed to "5mm".
        /// </summary>
        /// <param name="unitType">The unitType to switch to (e.g., MM).</param>
        public void ConvertToSpecifiedUnits(SvgLengthType unitType)
        {
            double newValue = _cssLength.GetFloatValue((CssPrimitiveType)unitType);

            _cssLength.SetFloatValue((CssPrimitiveType)unitType, newValue);
        }
Пример #8
0
 public SvgLength(float f, SvgLengthType type)
 {
     Value = f;
     Type  = type;
 }
Пример #9
0
 public SvgLength(float f, SvgLengthType type)
 {
     _num = f;
     _type = type;
 }
Пример #10
0
 public void ConvertToSpecifiedUnits(SvgLengthType unitType) { }
Пример #11
0
 public SvgLength(float f)
 {
     this._num  = f;
     this._type = SvgLengthType.SVG_LENGTHTYPE_UNKNOWN;
 }
Пример #12
0
 public SvgLength(float f, SvgLengthType type)
 {
     _num  = f;
     _type = type;
 }
Пример #13
0
 public SvgLength(double d, SvgLengthType type)
     : this((float)d, type)
 {
 }
Пример #14
0
 public SvgLength(double d, SvgLengthType type)
     : this((float)d, type)
 {
 }
Пример #15
0
		public void ConvertToSpecifiedUnits( SvgLengthType unitType )
		{
			_domSvgLength.Instance.ConvertToSpecifiedUnits( ( ushort ) unitType );
		}
Пример #16
0
 public SvgLength(float f, SvgLengthType type)
 {
     this._num  = f;
     this._type = type;
 }
Пример #17
0
 public void NewValueSpecifiedUnits(SvgLengthType unitType, double valueInSpecifiedUnits) { }
Пример #18
0
        public void FromString(string s)
        {
            int num = s.LastIndexOfAny(new char[]
            {
                '0',
                '1',
                '2',
                '3',
                '4',
                '5',
                '6',
                '7',
                '8',
                '9'
            });

            if (num != -1)
            {
                this._num = float.Parse(s.Substring(0, num + 1), CultureInfo.InvariantCulture);
                string text = s.Substring(num + 1);
                switch (text)
                {
                case "%":
                    this._type = SvgLengthType.SVG_LENGTHTYPE_PERCENTAGE;
                    return;

                case "em":
                    this._type = SvgLengthType.SVG_LENGTHTYPE_EMS;
                    return;

                case "ex":
                    this._type = SvgLengthType.SVG_LENGTHTYPE_EXS;
                    return;

                case "px":
                    this._type = SvgLengthType.SVG_LENGTHTYPE_PX;
                    return;

                case "cm":
                    this._type = SvgLengthType.SVG_LENGTHTYPE_CM;
                    return;

                case "mm":
                    this._type = SvgLengthType.SVG_LENGTHTYPE_MM;
                    return;

                case "in":
                    this._type = SvgLengthType.SVG_LENGTHTYPE_IN;
                    return;

                case "pt":
                    this._type = SvgLengthType.SVG_LENGTHTYPE_PT;
                    return;

                case "pc":
                    this._type = SvgLengthType.SVG_LENGTHTYPE_PC;
                    return;

                case "":
                    this._type = SvgLengthType.SVG_LENGTHTYPE_UNKNOWN;
                    return;
                }
                throw new SvgException("Invalid SvgLength", s);
            }
        }
Пример #19
0
 public SvgLength(float f)
 {
     _num = f;
     _type = SvgLengthType.SVG_LENGTHTYPE_UNKNOWN;
 }
Пример #20
0
 public void NewValueSpecifiedUnits(SvgLengthType unitType, float valueInSpecifiedUnits)
 {
     //_domSvgLength.Instance.NewValueSpecifiedUnits((ushort) unitType, valueInSpecifiedUnits);
     throw new NotImplementedException();
 }
Пример #21
0
        public void FromString(string s)
        {
            int i = s.LastIndexOfAny(new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' });
            if (i == -1)
                return;

            _num = float.Parse(s.Substring(0, i + 1));

            switch (s.Substring(i + 1)) {
                case "%":
                    _type = SvgLengthType.SVG_LENGTHTYPE_PERCENTAGE;
                    break;
                case "em":
                    _type = SvgLengthType.SVG_LENGTHTYPE_EMS;
                    break;
                case "ex":
                    _type = SvgLengthType.SVG_LENGTHTYPE_EXS;
                    break;
                case "px":
                    _type = SvgLengthType.SVG_LENGTHTYPE_PX;
                    break;
                case "cm":
                    _type = SvgLengthType.SVG_LENGTHTYPE_CM;
                    break;
                case "mm":
                    _type = SvgLengthType.SVG_LENGTHTYPE_MM;
                    break;
                case "in":
                    _type = SvgLengthType.SVG_LENGTHTYPE_IN;
                    break;
                case "pt":
                    _type = SvgLengthType.SVG_LENGTHTYPE_PT;
                    break;
                case "pc":
                    _type = SvgLengthType.SVG_LENGTHTYPE_PC;
                    break;
                case "":
                    _type = SvgLengthType.SVG_LENGTHTYPE_UNKNOWN;
                    break;
                default:
                    throw new SvgException("Invalid SvgLength", s);
            }
        }
Пример #22
0
 public void ConvertToSpecifiedUnits(SvgLengthType unitType)
 {
     //_domSvgLength.Instance.ConvertToSpecifiedUnits((ushort) unitType);
     throw new NotImplementedException();
 }
Пример #23
0
 /// <summary>
 /// Reset the value as a number with an associated unitType, thereby replacing the values for
 /// all of the attributes on the object.
 /// </summary>
 /// <param name="unitType">The unitType for the value (e.g., MM). </param>
 /// <param name="valueInSpecifiedUnits">The new value</param>
 public void NewValueSpecifiedUnits(SvgLengthType unitType, double valueInSpecifiedUnits)
 {
     _cssLength.SetFloatValue((CssPrimitiveType)unitType, valueInSpecifiedUnits);
 }
Пример #24
0
 internal SvgLength(SvgLengthType unitType, float value)
 {
     this.UnitType = unitType;
     this.Value    = value;
 }
Пример #25
0
 public void NewValueSpecifiedUnits(SvgLengthType unitType, float valueInSpecifiedUnits)
 {
     _domSvgLength.Instance.NewValueSpecifiedUnits((ushort)unitType, valueInSpecifiedUnits);
 }
Пример #26
0
		public Page(float width, float height, SvgLengthType unit)
		{
			this.Width = width;
			this.Height = height;
			this.Unit = unit;
		}
Пример #27
0
 /// <summary>
 /// Preserve the same underlying stored value, but reset the stored unit identifier to the given unitType. Object attributes unitType, valueAsSpecified and valueAsString might be modified as a result of this method. For example, if the original value were "0.5cm" and the method was invoked to convert to millimeters, then the unitType would be changed to MM, valueAsSpecified would be changed to the numeric value 5 and valueAsString would be changed to "5mm". 
 /// </summary>
 /// <param name="unitType">The unitType to switch to (e.g., MM).</param>
 public void ConvertToSpecifiedUnits(SvgLengthType unitType)
 {
     double newValue = cssLength.GetFloatValue((CssPrimitiveType)unitType);
     cssLength.SetFloatValue((CssPrimitiveType)unitType, newValue);
 }
Пример #28
0
		public void NewValueSpecifiedUnits( SvgLengthType unitType, float valueInSpecifiedUnits )
		{
			_domSvgLength.Instance.NewValueSpecifiedUnits( ( ushort ) unitType, valueInSpecifiedUnits );
		}
Пример #29
0
 public Page(float width, float height, SvgLengthType unit)
 {
     this.Width  = width;
     this.Height = height;
     this.Unit   = unit;
 }
Пример #30
0
 public void NewValueSpecifiedUnits(SvgLengthType unitType, double valueInSpecifiedUnits)
 {
 }