private CssPrimitiveValue(Match match, bool readOnly)
: this(match.Value, readOnly)
{
if(match.Groups["func"].Success)
{
switch(match.Groups["funcname"].Value){
case "rect":
_primitiveType = CssPrimitiveType.Rect;
rectValue = new Rect(match.Groups["funcvalue"].Value, ReadOnly);
break;
case "attr":
_primitiveType = CssPrimitiveType.Attr;
stringValue = match.Groups["funcvalue"].Value;
break;
case "url":
stringValue = match.Groups["funcvalue"].Value;
_primitiveType = CssPrimitiveType.Uri;
break;
case "counter":
throw new NotImplementedException("Counters are not implemented");
//_primitiveType = CssPrimitiveType.CSS_COUNTER;
}
}
else if(match.Groups["freqTimeNumber"].Success)
{
floatValue = Single.Parse(match.Groups["numberValue2"].Value, CssNumber.Format);
switch(match.Groups["unit2"].Value)
{
case "Hz":
_primitiveType = CssPrimitiveType.Hz;
break;
case "kHz":
_primitiveType = CssPrimitiveType.KHz;
break;
case "in":
_primitiveType = CssPrimitiveType.In;
break;
case "s":
_primitiveType = CssPrimitiveType.S;
break;
case "ms":
_primitiveType = CssPrimitiveType.Ms;
break;
case "%":
_primitiveType = CssPrimitiveType.Percentage;
break;
default:
_primitiveType = CssPrimitiveType.Number;
break;
}
}
else if(match.Groups["string"].Success)
{
stringValue = match.Groups["stringvalue"].Value;
_primitiveType = CssPrimitiveType.String;
}
else if(match.Groups["colorIdent"].Success)
{
string val = match.Value;
stringValue = match.Value;
_primitiveType = CssPrimitiveType.Ident;
}
else
{
_primitiveType = CssPrimitiveType.Unknown;
}
}