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 = int.Parse(s.Substring(0, i + 1), System.Globalization.CultureInfo.InvariantCulture); switch (s.Substring(i + 1)) { case "grad": _type = SvgAngleType.SVG_ANGLETYPE_GRAD; break; case "rad": _type = SvgAngleType.SVG_ANGLETYPE_RAD; break; case "deg": _type = SvgAngleType.SVG_ANGLETYPE_DEG; break; case "": _type = SvgAngleType.SVG_ANGLETYPE_UNSPECIFIED; break; default: throw new SvgException("Invalid SvgAngle", s); } }
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)int.Parse(s.Substring(0, num + 1), CultureInfo.InvariantCulture); string text = s.Substring(num + 1); if (text != null) { if (text == "grad") { this._type = SvgAngleType.SVG_ANGLETYPE_GRAD; return; } if (text == "rad") { this._type = SvgAngleType.SVG_ANGLETYPE_RAD; return; } if (text == "deg") { this._type = SvgAngleType.SVG_ANGLETYPE_DEG; return; } if (text == "") { this._type = SvgAngleType.SVG_ANGLETYPE_UNSPECIFIED; return; } } throw new SvgException("Invalid SvgAngle", s); } }
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 = int.Parse(s.Substring(0, i + 1)); switch (s.Substring(i + 1)) { case "grad": _type = SvgAngleType.SVG_ANGLETYPE_GRAD; break; case "rad": _type = SvgAngleType.SVG_ANGLETYPE_RAD; break; case "deg": _type = SvgAngleType.SVG_ANGLETYPE_DEG; break; case "": _type = SvgAngleType.SVG_ANGLETYPE_UNSPECIFIED; break; default: throw new SvgException("Invalid SvgAngle", s); } }
public SvgAngle(float num, SvgAngleType type) { _num = num; _type = type; }
public SvgAngle(float num, SvgAngleType type) { Value = num; Type = type; }
/// <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 angle value (e.g., SvgAngleTypeDEG).</param> /// <param name="valueInSpecifiedUnits">The angle value</param> public void NewValueSpecifiedUnits(SvgAngleType unitType, double valueInSpecifiedUnits) { cssAngle.SetFloatValue((CssPrimitiveType)unitType, valueInSpecifiedUnits); }
/// <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. /// </summary> /// <param name="unitType">The unitType to switch to (e.g., SvgAngleTypeDEG).</param> public void ConvertToSpecifiedUnits(SvgAngleType unitType) { double newValue = cssAngle.GetFloatValue((CssPrimitiveType)unitType); cssAngle.SetFloatValue((CssPrimitiveType)unitType, newValue); }
internal SvgAngle(SvgAngleType unitType, float value) { this.UnitType = unitType; this.Value = value; }
/// <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 angle value (e.g., SvgAngleTypeDEG).</param> /// <param name="valueInSpecifiedUnits">The angle value</param> public void NewValueSpecifiedUnits(SvgAngleType unitType, double valueInSpecifiedUnits) { _cssAngle.SetFloatValue((CssPrimitiveType)unitType, valueInSpecifiedUnits); }
public void NewValueSpecifiedUnits(SvgAngleType unitType, double valueInSpecifiedUnits) { }
public void ConvertToSpecifiedUnits(SvgAngleType unitType) { }
public SvgAngle(double num, SvgAngleType type) : this((float)num, type) { }
/// <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. /// </summary> /// <param name="unitType">The unitType to switch to (e.g., SvgAngleTypeDEG).</param> public void ConvertToSpecifiedUnits(SvgAngleType unitType) { double newValue = _cssAngle.GetFloatValue((CssPrimitiveType)unitType); _cssAngle.SetFloatValue((CssPrimitiveType)unitType, newValue); }
public SvgAngle(float num, SvgAngleType type) { this._num = num; this._type = type; }