Beispiel #1
0
		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;
		}
Beispiel #2
0
		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;
		}
Beispiel #3
0
 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();
 }
 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();
 }
Beispiel #5
0
		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;
		}