本文整理汇总了C#中AttributeList.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# AttributeList.GetValue方法的具体用法?C# AttributeList.GetValue怎么用?C# AttributeList.GetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttributeList
的用法示例。
在下文中一共展示了AttributeList.GetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SVGGradientElement
public SVGGradientElement(SVGParser xmlImp, Node node)
{
_attrList = node.attributes;
_xmlImp = xmlImp;
_stopList = new List<SVGStopElement>();
_id = _attrList.GetValue("id");
_gradientUnits = SVGGradientUnit.ObjectBoundingBox;
if (_attrList.GetValue("gradiantUnits") == "userSpaceOnUse")
{
_gradientUnits = SVGGradientUnit.UserSpaceOnUse;
}
_gradientTransform = new SVGTransformList(_attrList.GetValue("gradientTransform"));
//------
// TODO: It's probably a bug that the value is not innoculated for CaSe
// VaRiAtIoN in GetValue, below:
_spreadMethod = SVGSpreadMethod.Pad;
if (_attrList.GetValue("spreadMethod") == "reflect")
{
_spreadMethod = SVGSpreadMethod.Reflect;
} else if (_attrList.GetValue("spreadMethod") == "repeat")
{
_spreadMethod = SVGSpreadMethod.Repeat;
}
if(node is BlockOpenNode)
{
GetElementList();
}
}
示例2: SVGStopElement
/***************************************************************************/
public SVGStopElement(AttributeList attrList)
{
_stopColor = new SVGColor(attrList.GetValue("stop-color"));
string temp = attrList.GetValue("offset").Trim();
if(temp != "") {
if(temp.EndsWith("%")) {
_offset = float.Parse(temp.TrimEnd(new char[1] { '%' }), System.Globalization.CultureInfo.InvariantCulture);
} else {
_offset = float.Parse(temp, System.Globalization.CultureInfo.InvariantCulture)* 100;
}
}
}
示例3: SVGStopElement
/***************************************************************************/
public SVGStopElement(AttributeList attrList)
{
_stopColor = new SVGColor(attrList.GetValue("stop-color"));
string temp = attrList.GetValue("offset").Trim();
if(temp != "") {
if(temp.EndsWith("%")) {
_offset = SVGNumber.ParseToFloat(temp.TrimEnd(new char[1]{'%'}));
} else {
_offset = SVGNumber.ParseToFloat(temp)* 100;
}
}
}
示例4: SVGCircleElement
//================================================================================
public SVGCircleElement(AttributeList attrList,
SVGTransformList inheritTransformList,
SVGPaintable inheritPaintable,
SVGGraphics _render)
: base(inheritTransformList)
{
this._attrList = attrList;
this._render = _render;
this._paintable = new SVGPaintable(inheritPaintable, this._attrList);
this._cx = new SVGLength(attrList.GetValue("cx"));
this._cy = new SVGLength(attrList.GetValue("cy"));
this._r = new SVGLength(attrList.GetValue("r"));
}
示例5: SVGLineElement
/***********************************************************************************/
public SVGLineElement( AttributeList attrList,
SVGTransformList inheritTransformList,
SVGPaintable inheritPaintable,
SVGGraphics _render)
: base(inheritTransformList)
{
this._attrList = attrList;
this._paintable = new SVGPaintable(inheritPaintable, this._attrList);
this._render = _render;
this._x1 = new SVGLength(attrList.GetValue("x1"));
this._y1 = new SVGLength(attrList.GetValue("y1"));
this._x2 = new SVGLength(attrList.GetValue("x2"));
this._y2 = new SVGLength(attrList.GetValue("y2"));
}
示例6: SVGSVGElement
/***********************************************************************************/
public SVGSVGElement( SVGParser xmlImp,
SVGTransformList inheritTransformList,
SVGPaintable inheritPaintable,
SVGGraphics r)
: base(inheritTransformList)
{
_render = r;
_xmlImp = xmlImp;
_attrList = _xmlImp.Node.Attributes;
_paintable = new SVGPaintable(inheritPaintable, _attrList);
_width = new SVGLength(_attrList.GetValue("width"));
_height = new SVGLength(_attrList.GetValue("height"));
Initial();
}
示例7: SVGClipPathElement
public SVGClipPathElement(SVGParser xmlImp, Node node)
{
_attrList = node.attributes;
_xmlImp = xmlImp;
_id = _attrList.GetValue("id");
GetElementList();
}
示例8: SVGRadialGradientElement
/***************************************************************************/
public SVGRadialGradientElement(SVGParser xmlImp, AttributeList attrList)
: base(xmlImp, attrList)
{
string temp;
temp = attrList.GetValue("cx");
_cx = new SVGLength((temp == "") ? "50%" : temp);
temp = attrList.GetValue("cy");
_cy = new SVGLength((temp == "") ? "50%" : temp);
temp = attrList.GetValue("r");
_r = new SVGLength((temp == "") ? "50%" : temp);
temp = attrList.GetValue("fx");
_fx = new SVGLength((temp == "") ? "50%" : temp);
temp = attrList.GetValue("fy");
_fy = new SVGLength((temp == "") ? "50%" : temp);
}
示例9: SVGPathElement
public SVGPathElement(Node node, SVGTransformList inheritTransformList, SVGPaintable inheritPaintable = null) : base(inheritTransformList)
{
_attrList = node.attributes;
_paintable = new SVGPaintable(inheritPaintable, node);
currentTransformList = new SVGTransformList(_attrList.GetValue("transform"));
Rect viewport = _paintable.viewport;
this.currentTransformList.AppendItem(new SVGTransform(SVGTransformable.GetViewBoxTransform(_attrList, ref viewport, false)));
paintable.SetViewport(viewport);
Initial();
}
示例10: SVGGElement
/***********************************************************************************/
public SVGGElement(SVGParser xmlImp,
SVGTransformList inheritTransformList,
SVGPaintable inheritPaintable,
SVGGraphics render)
: base(inheritTransformList)
{
_render = render;
_xmlImp = xmlImp;
_attrList = _xmlImp.Node.Attributes;
_paintable = new SVGPaintable(inheritPaintable, _attrList);
_elementList = new List<object>();
currentTransformList = new SVGTransformList(_attrList.GetValue("transform"));
GetElementList();
}
示例11: SVGRectElement
//================================================================================
public SVGRectElement(AttributeList attrList,
SVGTransformList inheritTransformList,
SVGPaintable inheritPaintable,
SVGGraphics _render)
: base(inheritTransformList)
{
this._attrList = attrList;
this._render = _render;
this._paintable = new SVGPaintable(inheritPaintable, this._attrList);
this._x = new SVGLength(attrList.GetValue("x"));
this._y = new SVGLength(attrList.GetValue("y"));
this._width = new SVGLength(attrList.GetValue("width"));
this._height = new SVGLength(attrList.GetValue("height"));
this._rx = new SVGLength(attrList.GetValue("rx"));
this._ry = new SVGLength(attrList.GetValue("ry"));
}
示例12: Initialize
/***********************************************************************************/
//Khoi tao
private void Initialize(AttributeList attrList)
{
isStrokeWidth = false;
if(attrList.GetValue("fill").IndexOf("url") >= 0) {
_gradientID = SVGStringExtractor.ExtractUrl4Gradient(attrList.GetValue("fill"));
} else {
_fillColor = new SVGColor(attrList.GetValue("fill"));
}
_strokeColor = new SVGColor(attrList.GetValue("stroke"));
if(attrList.GetValue("stroke-width") != "") isStrokeWidth = true;
_strokeWidth = new SVGLength(attrList.GetValue("stroke-width"));
SetStrokeLineCap(attrList.GetValue("stroke-linecap"));
SetStrokeLineJoin(attrList.GetValue("stroke-linejoin"));
if(attrList.GetValue("stroke-width") == "") _strokeWidth.NewValueSpecifiedUnits(1f);
Style(attrList.GetValue("style"));
//style="fill: #ffffff; stroke:#000000; stroke-width:0.172"
}
示例13: GetRootViewBoxTransform
public static SVGMatrix GetRootViewBoxTransform(AttributeList attributeList, ref Rect viewport)
{
SVGMatrix matrix = new SVGMatrix();
float x = 0.0f;
float y = 0.0f;
float w = 0.0f;
float h = 0.0f;
string attrXString = attributeList.GetValue("x");
string attrYString = attributeList.GetValue("y");
string attrWidthString = attributeList.GetValue("width");
string attrHeightString = attributeList.GetValue("height");
SVGLength attrX = new SVGLength(SVGLengthType.PX, 0f), attrY = new SVGLength(SVGLengthType.PX, 0f),
attrWidth = new SVGLength(SVGLengthType.PX, 1f), attrHeight = new SVGLength(SVGLengthType.PX, 1f);
if(!string.IsNullOrEmpty(attrXString))
{
attrX = new SVGLength(attrXString);
}
if(!string.IsNullOrEmpty(attrYString))
{
attrY = new SVGLength(attrYString);
}
if(!string.IsNullOrEmpty(attrWidthString))
{
attrWidth = new SVGLength(attrWidthString);
}
if(!string.IsNullOrEmpty(attrHeightString))
{
attrHeight = new SVGLength(attrHeightString);
}
string viewBox = attributeList.GetValue("viewBox");
if (!string.IsNullOrEmpty(viewBox))
{
string[] _temp = SVGStringExtractor.ExtractTransformValue(viewBox);
if (_temp.Length > 0)
{
if(string.IsNullOrEmpty(attrXString))
{
attrX = new SVGLength(_temp [0]);
}
}
if (_temp.Length > 1)
{
if(string.IsNullOrEmpty(attrYString))
{
attrY = new SVGLength(_temp [1]);
}
}
if (_temp.Length > 2)
{
if(string.IsNullOrEmpty(attrWidthString))
{
attrWidth = new SVGLength(_temp [2]);
}
}
if (_temp.Length > 3)
{
if(string.IsNullOrEmpty(attrHeightString))
{
attrHeight = new SVGLength(_temp [3]);
}
}
viewport = new Rect(attrX.value, attrY.value, attrWidth.value, attrHeight.value);
if(string.IsNullOrEmpty(attrXString))
{
viewport.x = attrX.value;
}
if(string.IsNullOrEmpty(attrYString))
{
viewport.y = attrY.value;
}
if(string.IsNullOrEmpty(attrWidthString))
{
viewport.width = attrWidth.value;
}
if(string.IsNullOrEmpty(attrHeightString))
{
viewport.height = attrHeight.value;
}
} else {
viewport = new Rect(attrX.value, attrY.value, attrWidth.value, attrHeight.value);
}
return matrix;
}
示例14: GetViewBoxTransform
public static SVGMatrix GetViewBoxTransform(AttributeList attributeList, ref Rect viewport, bool negotiate = false)
{
SVGMatrix matrix = new SVGMatrix();
float x = 0.0f;
float y = 0.0f;
float w = 0.0f;
float h = 0.0f;
string preserveAspectRatio = attributeList.GetValue("preserveAspectRatio");
string viewBox = attributeList.GetValue("viewBox");
if (!string.IsNullOrEmpty(viewBox))
{
string[] viewBoxValues = SVGStringExtractor.ExtractTransformValue(viewBox);
if(viewBoxValues.Length == 4)
{
Rect contentRect = new Rect(
new SVGLength(viewBoxValues[0]).value,
new SVGLength(viewBoxValues[1]).value,
new SVGLength(viewBoxValues[2]).value,
new SVGLength(viewBoxValues[3]).value
);
SVGViewport.Align align = SVGViewport.Align.xMidYMid;
SVGViewport.MeetOrSlice meetOrSlice = SVGViewport.MeetOrSlice.Meet;
if(!string.IsNullOrEmpty(preserveAspectRatio))
{
string[] aspectRatioValues = SVGStringExtractor.ExtractStringArray(preserveAspectRatio);
align = SVGViewport.GetAlignFromStrings(aspectRatioValues);
meetOrSlice = SVGViewport.GetMeetOrSliceFromStrings(aspectRatioValues);
}
Rect oldViewport = viewport;
viewport = SVGViewport.GetViewport(viewport, contentRect, align, meetOrSlice);
float sizeX = 0f, sizeY = 0f;
if(oldViewport.size.x != 0f)
sizeX = viewport.size.x / oldViewport.size.x;
if(oldViewport.size.y != 0f)
sizeY = viewport.size.y / oldViewport.size.y;
matrix.ScaleNonUniform(sizeX, sizeY);
matrix = matrix.Translate(viewport.x - oldViewport.x, viewport.y - oldViewport.y);
}
} else {
if(negotiate)
{
string attrXString = attributeList.GetValue("x");
string attrYString = attributeList.GetValue("y");
string attrWidthString = attributeList.GetValue("width");
string attrHeightString = attributeList.GetValue("height");
SVGLength attrX = new SVGLength(SVGLengthType.PX, 0f), attrY = new SVGLength(SVGLengthType.PX, 0f),
attrWidth = new SVGLength(SVGLengthType.PX, 1f), attrHeight = new SVGLength(SVGLengthType.PX, 1f);
if(!string.IsNullOrEmpty(attrXString))
{
attrX = new SVGLength(attrXString);
}
if(!string.IsNullOrEmpty(attrYString))
{
attrY = new SVGLength(attrYString);
}
if(!string.IsNullOrEmpty(attrWidthString))
{
attrWidth = new SVGLength(attrWidthString);
}
if(!string.IsNullOrEmpty(attrHeightString))
{
attrHeight = new SVGLength(attrHeightString);
}
x = attrX.value;
y = attrY.value;
w = attrWidth.value;
h = attrHeight.value;
float x_ratio = 1f;
if(w != 0f)
x_ratio = attrWidth.value / w;
float y_ratio = 1f;
if(h != 0f)
y_ratio = attrHeight.value / h;
matrix = matrix.ScaleNonUniform(x_ratio, y_ratio);
matrix = matrix.Translate(x, y);
viewport = new Rect(x, y, w, h);
// Debug.Log(string.Format("x: {0}, y: {1}, width: {2}, height: {3}, attrWidth: {4}, attrHeight: {5}", x, y, w, h, attrWidth, attrHeight));
}
// Debug.Log(string.Format("x: {0}, y: {1}, width: {2}, height: {3}, attrWidth: {4}, attrHeight: {5}", x, y, w, h, attrWidth, attrHeight));
}
return matrix;
}
示例15: Initialize
//style="fill: #ffffff; stroke:#000000; stroke-width:0.172"
private void Initialize(AttributeList attrList)
{
ReadStyle(attrList.Get);
ReadStyle(attrList.GetValue("style"));
}