本文整理汇总了C#中System.Xml.XmlReader.GetBoolAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReader.GetBoolAttribute方法的具体用法?C# XmlReader.GetBoolAttribute怎么用?C# XmlReader.GetBoolAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlReader
的用法示例。
在下文中一共展示了XmlReader.GetBoolAttribute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseSpan
static XshdSpan ParseSpan(XmlReader reader)
{
XshdSpan span = new XshdSpan();
SetPosition(span, reader);
span.BeginRegex = reader.GetAttribute("begin");
span.EndRegex = reader.GetAttribute("end");
span.Multiline = reader.GetBoolAttribute("multiline") ?? false;
span.SpanColorReference = ParseColorReference(reader);
span.RuleSetReference = ParseRuleSetReference(reader);
if (!reader.IsEmptyElement) {
reader.Read();
while (reader.NodeType != XmlNodeType.EndElement) {
Debug.Assert(reader.NodeType == XmlNodeType.Element);
switch (reader.Name) {
case "Begin":
if (span.BeginRegex != null)
throw Error(reader, "Duplicate Begin regex");
span.BeginColorReference = ParseColorReference(reader);
span.BeginRegex = reader.ReadElementString();
span.BeginRegexType = XshdRegexType.IgnorePatternWhitespace;
break;
case "End":
if (span.EndRegex != null)
throw Error(reader, "Duplicate End regex");
span.EndColorReference = ParseColorReference(reader);
span.EndRegex = reader.ReadElementString();
span.EndRegexType = XshdRegexType.IgnorePatternWhitespace;
break;
case "RuleSet":
if (span.RuleSetReference.ReferencedElement != null)
throw Error(reader, "Cannot specify both inline RuleSet and RuleSet reference");
span.RuleSetReference = new XshdReference<XshdRuleSet>(ParseRuleSet(reader));
reader.Read();
break;
default:
throw new NotSupportedException("Unknown element " + reader.Name);
}
}
}
return span;
}
示例2: ParseRuleSet
static XshdRuleSet ParseRuleSet(XmlReader reader)
{
XshdRuleSet ruleSet = new XshdRuleSet();
SetPosition(ruleSet, reader);
ruleSet.Name = reader.GetAttribute("name");
ruleSet.IgnoreCase = reader.GetBoolAttribute("ignoreCase");
CheckElementName(reader, ruleSet.Name);
ParseElements(ruleSet.Elements, reader);
return ruleSet;
}
示例3: ReadXml
public override void ReadXml(XmlReader reader)
{
base.ReadXml(reader);
reader.ReadStartElement();
var columns = new List<GridColumn>();
while (reader.IsStartElement(El.grid_column))
{
var name = reader.GetAttribute(Attr.name);
var visible = reader.GetBoolAttribute(Attr.visible);
var width = reader.GetIntAttribute(Attr.width);
columns.Add(new GridColumn(name, visible, width));
reader.Read();
}
_columns = ImmutableList.ValueOf(columns);
reader.ReadEndElement();
}
示例4: ReadXml
public override void ReadXml(XmlReader reader)
{
base.ReadXml(reader);
ControlAnnotation = reader.GetAttribute(ATTR.control_annotation);
ControlValue = reader.GetAttribute(ATTR.control_value);
CaseValue = reader.GetAttribute(ATTR.case_value);
IdentityAnnotation = reader.GetAttribute(ATTR.identity_annotation);
AverageTechnicalReplicates = reader.GetBoolAttribute(ATTR.avg_tech_replicates, true);
SumTransitions = reader.GetBoolAttribute(ATTR.sum_transitions, true);
NormalizationMethod = NormalizationMethod.FromName(reader.GetAttribute(ATTR.normalization_method));
IncludeInteractionTransitions = reader.GetBoolAttribute(ATTR.include_interaction_transitions, false);
SummarizationMethod = SummarizationMethod.FromName(reader.GetAttribute(ATTR.summarization_method));
ConfidenceLevelTimes100 = reader.GetDoubleAttribute(ATTR.confidence_level, 95);
PerProtein = reader.GetBoolAttribute(ATTR.per_protein, false);
reader.Read();
}
示例5: ParseColorAttributes
static XshdColor ParseColorAttributes(XmlReader reader)
{
XshdColor color = new XshdColor();
SetPosition(color, reader);
IXmlLineInfo position = reader as IXmlLineInfo;
color.Foreground = ParseColor(position, reader.GetAttribute("foreground"));
color.Background = ParseColor(position, reader.GetAttribute("background"));
color.FontWeight = ParseFontWeight(reader.GetAttribute("fontWeight"));
color.FontStyle = ParseFontStyle(reader.GetAttribute("fontStyle"));
color.Underline = reader.GetBoolAttribute("underline");
return color;
}