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); }
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); } }
public void ConvertToSpecifiedUnits(SvgLengthType unitType) { }
/// <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); }
public void ConvertToSpecifiedUnits(SvgLengthType unitType) { _domSvgLength.Instance.ConvertToSpecifiedUnits((ushort)unitType); }
/// <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); }
public SvgLength(float f, SvgLengthType type) { Value = f; Type = type; }
public SvgLength(float f, SvgLengthType type) { _num = f; _type = type; }
public SvgLength(float f) { this._num = f; this._type = SvgLengthType.SVG_LENGTHTYPE_UNKNOWN; }
public SvgLength(double d, SvgLengthType type) : this((float)d, type) { }
public void ConvertToSpecifiedUnits( SvgLengthType unitType ) { _domSvgLength.Instance.ConvertToSpecifiedUnits( ( ushort ) unitType ); }
public SvgLength(float f, SvgLengthType type) { this._num = f; this._type = type; }
public void NewValueSpecifiedUnits(SvgLengthType unitType, double valueInSpecifiedUnits) { }
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); } }
public SvgLength(float f) { _num = f; _type = SvgLengthType.SVG_LENGTHTYPE_UNKNOWN; }
public void NewValueSpecifiedUnits(SvgLengthType unitType, float valueInSpecifiedUnits) { //_domSvgLength.Instance.NewValueSpecifiedUnits((ushort) unitType, valueInSpecifiedUnits); throw new NotImplementedException(); }
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); } }
public void ConvertToSpecifiedUnits(SvgLengthType unitType) { //_domSvgLength.Instance.ConvertToSpecifiedUnits((ushort) unitType); throw new NotImplementedException(); }
/// <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); }
internal SvgLength(SvgLengthType unitType, float value) { this.UnitType = unitType; this.Value = value; }
public void NewValueSpecifiedUnits(SvgLengthType unitType, float valueInSpecifiedUnits) { _domSvgLength.Instance.NewValueSpecifiedUnits((ushort)unitType, valueInSpecifiedUnits); }
public Page(float width, float height, SvgLengthType unit) { this.Width = width; this.Height = height; this.Unit = unit; }
/// <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); }
public void NewValueSpecifiedUnits( SvgLengthType unitType, float valueInSpecifiedUnits ) { _domSvgLength.Instance.NewValueSpecifiedUnits( ( ushort ) unitType, valueInSpecifiedUnits ); }