本文整理汇总了C#中CssValue.SetPairListValue方法的典型用法代码示例。如果您正苦于以下问题:C# CssValue.SetPairListValue方法的具体用法?C# CssValue.SetPairListValue怎么用?C# CssValue.SetPairListValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CssValue
的用法示例。
在下文中一共展示了CssValue.SetPairListValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseQuotes
internal bool ParseQuotes()
{
var value = new nsCSSValue();
if (!ParseVariant(ref value, VARIANT_HOS, null)) {
return false;
}
if (value.GetUnit() != nsCSSUnit.String) {
if (!ExpectEndProperty()) {
return false;
}
} else {
nsCSSValue open = value;
nsCSSValuePairList quotes = value.SetPairListValue();
for (;;) {
quotes.mXValue = open;
// get mandatory close
if (!ParseVariant(ref quotes.mYValue, VARIANT_STRING, null)) {
return false;
}
if (CheckEndProperty()) {
break;
}
// look for another open
if (!ParseVariant(ref open, VARIANT_STRING, null)) {
return false;
}
quotes.mNext = new nsCSSValuePairList();
quotes = quotes.mNext;
}
}
AppendValue(nsCSSProperty.Quotes, value);
return true;
}
示例2: ParseFontFeatureSettings
internal bool ParseFontFeatureSettings(ref nsCSSValue aValue)
{
if (ParseVariant(ref aValue, VARIANT_INHERIT | VARIANT_NORMAL, null)) {
return true;
}
nsCSSValuePairList cur = aValue.SetPairListValue();
for (;;) {
// feature tag
if (!GetToken(true)) {
return false;
}
if (mToken.mType != nsCSSTokenType.String ||
!ValidFontFeatureTag(mToken.mIdentStr)) {
UngetToken();
return false;
}
cur.mXValue.SetStringValue(mToken.mIdentStr, nsCSSUnit.String);
if (!GetToken(true)) {
cur.mYValue.SetIntValue(1, nsCSSUnit.Integer);
break;
}
// optional value or on/off keyword
if (mToken.mType == nsCSSTokenType.Number && mToken.mIntegerValid &&
mToken.mInteger >= 0) {
cur.mYValue.SetIntValue(mToken.mInteger, nsCSSUnit.Integer);
} else if (mToken.mType == nsCSSTokenType.Ident &&
mToken.mIdentStr.LowerCaseEqualsLiteral("on")) {
cur.mYValue.SetIntValue(1, nsCSSUnit.Integer);
} else if (mToken.mType == nsCSSTokenType.Ident &&
mToken.mIdentStr.LowerCaseEqualsLiteral("off")) {
cur.mYValue.SetIntValue(0, nsCSSUnit.Integer);
} else {
// something other than value/on/off, set default value
cur.mYValue.SetIntValue(1, nsCSSUnit.Integer);
UngetToken();
}
if (!ExpectSymbol(',', true)) {
break;
}
cur.mNext = new nsCSSValuePairList();
cur = cur.mNext;
}
return true;
}
示例3: ParseBackgroundSize
// This function is very similar to ParseBackgroundList and
// ParseBackgroundPosition.
internal bool ParseBackgroundSize()
{
var value = new nsCSSValue();
if (ParseVariant(ref value, VARIANT_INHERIT, null)) {
// 'initial' and 'inherit' stand alone, no list permitted.
if (!ExpectEndProperty()) {
return false;
}
} else {
var valuePair = new nsCSSValuePair();
if (!ParseBackgroundSizeValues(ref valuePair)) {
return false;
}
nsCSSValuePairList item = value.SetPairListValue();
for (;;) {
item.mXValue = valuePair.mXValue;
item.mYValue = valuePair.mYValue;
if (CheckEndProperty()) {
break;
}
if (!ExpectSymbol(',', true)) {
return false;
}
if (!ParseBackgroundSizeValues(ref valuePair)) {
return false;
}
item.mNext = new nsCSSValuePairList();
item = item.mNext;
}
}
AppendValue(nsCSSProperty.BackgroundSize, value);
return true;
}
示例4: ParseCounterData
internal bool ParseCounterData(nsCSSProperty aPropID)
{
var value = new nsCSSValue();
if (!ParseVariant(ref value, VARIANT_INHERIT | VARIANT_NONE, null)) {
if (!GetToken(true) || mToken.mType != nsCSSTokenType.Ident) {
return false;
}
nsCSSValuePairList cur = value.SetPairListValue();
for (;;) {
cur.mXValue.SetStringValue(mToken.mIdentStr, nsCSSUnit.Ident);
if (!GetToken(true)) {
break;
}
if (mToken.mType == nsCSSTokenType.Number && mToken.mIntegerValid) {
cur.mYValue.SetIntValue(mToken.mInteger, nsCSSUnit.Integer);
} else {
UngetToken();
}
if (CheckEndProperty()) {
break;
}
if (!GetToken(true) || mToken.mType != nsCSSTokenType.Ident) {
return false;
}
cur.mNext = new nsCSSValuePairList();
cur = cur.mNext;
}
}
AppendValue(aPropID, value);
return true;
}
示例5: ParseBackground
internal bool ParseBackground()
{
using (/*var compound = */new nsAutoParseCompoundProperty(this)) {
// background-color can only be set once, so it's not a list.
var color = new nsCSSValue();
// Check first for inherit/initial.
if (ParseVariant(ref color, VARIANT_INHERIT, null)) {
// must be alone
if (!ExpectEndProperty()) {
return false;
}
AppendValues(nsCSSProps.SubpropertyEntryFor(nsCSSProperty.Background), color);
return true;
}
nsCSSValue image = new nsCSSValue(), repeat = new nsCSSValue(), attachment = new nsCSSValue(), clip = new nsCSSValue(), origin = new nsCSSValue(), position = new nsCSSValue(), size = new nsCSSValue();
var state = new BackgroundParseState(color, image.SetListValue(),
repeat.SetPairListValue(),
attachment.SetListValue(), clip.SetListValue(),
origin.SetListValue(), position.SetListValue(),
size.SetPairListValue());
for (;;) {
if (!ParseBackgroundItem(state)) {
return false;
}
if (CheckEndProperty()) {
break;
}
// If we saw a color, this must be the last item.
if (color.GetUnit() != nsCSSUnit.Null) {
{ if (!mSuppressErrors) mReporter.ReportUnexpected("PEExpectEndValue", mToken); };
return false;
}
// Otherwise, a comma is mandatory.
if (!ExpectSymbol(',', true)) {
return false;
}
// Chain another entry on all the lists.
state.mImage.mNext = new nsCSSValueList();
state.mImage = state.mImage.mNext;
state.mRepeat.mNext = new nsCSSValuePairList();
state.mRepeat = state.mRepeat.mNext;
state.mAttachment.mNext = new nsCSSValueList();
state.mAttachment = state.mAttachment.mNext;
state.mClip.mNext = new nsCSSValueList();
state.mClip = state.mClip.mNext;
state.mOrigin.mNext = new nsCSSValueList();
state.mOrigin = state.mOrigin.mNext;
state.mPosition.mNext = new nsCSSValueList();
state.mPosition = state.mPosition.mNext;
state.mSize.mNext = new nsCSSValuePairList();
state.mSize = state.mSize.mNext;
}
// If we get to this point without seeing a color, provide a default.
if (color.GetUnit() == nsCSSUnit.Null) {
color.SetColorValue(nscolor.RGBA(0,0,0,0));
}
AppendValue(nsCSSProperty.BackgroundImage, image);
AppendValue(nsCSSProperty.BackgroundRepeat, repeat);
AppendValue(nsCSSProperty.BackgroundAttachment, attachment);
AppendValue(nsCSSProperty.BackgroundClip, clip);
AppendValue(nsCSSProperty.BackgroundOrigin, origin);
AppendValue(nsCSSProperty.BackgroundPosition, position);
AppendValue(nsCSSProperty.BackgroundSize, size);
AppendValue(nsCSSProperty.BackgroundColor, color);
return true;
}
}