private void GetCssXmlValue() { if (_source == SvgLengthSource.Css) { ICssStyleDeclaration csd = _ownerElement.GetComputedStyle(string.Empty); CssPrimitiveLengthValue cssValue = csd.GetPropertyCssValue(_propertyName) as CssPrimitiveLengthValue; if (cssValue != null) { _cssLength = new CssAbsPrimitiveLengthValue(cssValue, _propertyName, _ownerElement); } else { throw new DomException(DomExceptionType.SyntaxErr, "Not a length value"); } } else { string baseVal = _ownerElement.GetAttribute(_propertyName); if (baseVal == null || baseVal.Length == 0) { baseVal = _defaultValue; } baseVal = SvgNumber.ScientificToDec(baseVal); _cssLength = new CssAbsPrimitiveLengthValue(new CssPrimitiveLengthValue(baseVal, false), _propertyName, _ownerElement); } }
private string GetBaseUrl() { if (ownerElement.HasAttribute("xml:base")) { return(ownerElement.GetAttribute("xml:base")); } XmlElement parentNode = ownerElement.ParentNode as XmlElement; if (parentNode != null && parentNode.HasAttribute("xml:base")) { return(parentNode.GetAttribute("xml:base")); } return(null); }
private void AddExtraLinkInformation(DrawingGroup group, SvgElement element) { string linkColor = element.GetAttribute("color"); if (!String.IsNullOrEmpty(linkColor)) { SvgLink.SetColor(group, linkColor); } string linkPartsId = element.GetAttribute("partsid"); if (!String.IsNullOrEmpty(linkPartsId)) { SvgLink.SetPartsId(group, linkPartsId); } string linkType = element.GetAttribute("type"); if (!String.IsNullOrEmpty(linkType)) { SvgLink.SetPartsId(group, linkType); } string linkNumber = element.GetAttribute("num"); if (!String.IsNullOrEmpty(linkNumber)) { SvgLink.SetPartsId(group, linkNumber); } string linkPin = element.GetAttribute("pin"); if (!String.IsNullOrEmpty(linkPin)) { SvgLink.SetPartsId(group, linkPin); } string linkLineId = element.GetAttribute("lineid"); if (!String.IsNullOrEmpty(linkLineId)) { SvgLink.SetPartsId(group, linkLineId); } }