public KeywordItem(KeywordType type, string term) : this() { _type = type; if (!String.IsNullOrEmpty(term)) { _listTerms.Add(term); } }
/// <summary> /// This reads and sets its state or attributes stored in a <c>XML</c> format /// with the given reader. /// </summary> /// <param name="reader"> /// The reader with which the <c>XML</c> attributes of this object are accessed. /// </param> /// <exception cref="ArgumentNullException"> /// If the <paramref name="reader"/> is <see langword="null"/>. /// </exception> public override void ReadXml(XmlReader reader) { BuildExceptions.NotNull(reader, "reader"); Debug.Assert(reader.NodeType == XmlNodeType.Element); if (reader.NodeType != XmlNodeType.Element) { return; } if (!String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { return; } string tempText = reader.GetAttribute("FrameworkType"); if (!String.IsNullOrEmpty(tempText)) { _frameworkType = (TemplateFrameworkType)Enum.Parse( typeof(TemplateFrameworkType), tempText, true); } _condition = reader.GetAttribute("Condition"); if (reader.IsEmptyElement) { return; } if (_items == null || _items.Count != 0) { _items = new BuildList <TemplateItem>(); } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { if (String.Equals(reader.Name, TemplateItem.TagName, StringComparison.OrdinalIgnoreCase)) { TemplateItem item = new TemplateItem(); item.ReadXml(reader); if (!item.IsEmpty) { _items.Add(item); } } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { break; } } } }
/// <summary> /// This reads and sets its state or attributes stored in a <c>XML</c> format /// with the given reader. /// </summary> /// <param name="reader"> /// The reader with which the <c>XML</c> attributes of this object are accessed. /// </param> /// <exception cref="ArgumentNullException"> /// If the <paramref name="reader"/> is <see langword="null"/>. /// </exception> public override void ReadXml(XmlReader reader) { BuildExceptions.NotNull(reader, "reader"); Debug.Assert(reader.NodeType == XmlNodeType.Element); if (reader.NodeType != XmlNodeType.Element) { return; } if (!String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { return; } if (reader.IsEmptyElement) { return; } _previewImageId = String.Empty; _previewImagePath = String.Empty; if (_descriptions == null || _descriptions.Count != 0) { _descriptions = new BuildList <string>(); } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { switch (reader.Name) { case "Description": string tempText = reader.ReadString(); if (!String.IsNullOrEmpty(tempText)) { _descriptions.Add(tempText); } break; case "PreviewImage": _previewImageId = reader.GetAttribute("Id"); _previewImagePath = reader.ReadString(); break; } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { break; } } } }
public void AddDirectory(BuildDirectoryPath path) { BuildExceptions.NotNull(path, "path"); if (_paths == null) { _paths = new BuildList <BuildDirectoryPath>(); } _paths.Add(path); }
public MathPackageItem(string use, string option) { if (!String.IsNullOrEmpty(use)) { use = use.Trim(); } _use = use; _listOptions = new BuildList <string>(); if (!String.IsNullOrEmpty(option)) { _listOptions.Add(option); } }
/// <summary> /// This reads and sets its state or attributes stored in a <c>XML</c> format /// with the given reader. /// </summary> /// <param name="reader"> /// The reader with which the <c>XML</c> attributes of this object are accessed. /// </param> /// <exception cref="ArgumentNullException"> /// If the <paramref name="reader"/> is <see langword="null"/>. /// </exception> public override void ReadXml(XmlReader reader) { BuildExceptions.NotNull(reader, "reader"); Debug.Assert(reader.NodeType == XmlNodeType.Element); if (reader.NodeType != XmlNodeType.Element) { return; } if (!String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { return; } _use = reader.GetAttribute("use"); if (reader.IsEmptyElement) { return; } if (_listOptions == null) { _listOptions = new BuildList <string>(); } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { if (String.Equals(reader.Name, "option", StringComparison.OrdinalIgnoreCase)) { _listOptions.Add(reader.GetAttribute("value")); } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, "options", StringComparison.OrdinalIgnoreCase)) { break; } } } }
/// <summary> /// This reads and sets its state or attributes stored in a <c>XML</c> format /// with the given reader. /// </summary> /// <param name="reader"> /// The reader with which the <c>XML</c> attributes of this object are accessed. /// </param> /// <exception cref="ArgumentNullException"> /// If the <paramref name="reader"/> is <see langword="null"/>. /// </exception> public override void ReadXml(XmlReader reader) { BuildExceptions.NotNull(reader, "reader"); Debug.Assert(reader.NodeType == XmlNodeType.Element); if (reader.NodeType != XmlNodeType.Element) { return; } if (!String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { return; } _name = reader.GetAttribute("name"); while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { if (String.Equals(reader.Name, MediaImageArea.TagName, StringComparison.OrdinalIgnoreCase)) { MediaImageArea imageArea = new MediaImageArea(); imageArea.ReadXml(reader); if (!imageArea.IsEmpty) { _listAreas.Add(imageArea); } } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, MediaImageMap.TagName, StringComparison.OrdinalIgnoreCase)) { break; } } } }
public MathPackageItem(string use, params string[] options) { if (!String.IsNullOrEmpty(use)) { use = use.Trim(); } _use = use; _listOptions = new BuildList <string>(); if (options != null && options.Length != 0) { for (int i = 0; i < options.Length; i++) { string option = options[i]; if (!String.IsNullOrEmpty(option)) { _listOptions.Add(option); } } } }
public void Add(ReferenceItem item) { BuildExceptions.NotNull(item, "item"); _listItems.Add(item); }
/// <summary> /// /// </summary> /// <param name="reader"></param> public override void ReadXml(XmlReader reader) { BuildExceptions.NotNull(reader, "reader"); Debug.Assert(reader.NodeType == XmlNodeType.Element); if (reader.NodeType != XmlNodeType.Element) { return; } if (!String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { return; } string nodeText = reader.GetAttribute("name"); if (!String.IsNullOrEmpty(nodeText)) { this.Name = nodeText; _isAttributeType = (nodeText.IndexOf("Attribute", StringComparison.Ordinal) >= 0); } nodeText = reader.GetAttribute("expose"); if (!String.IsNullOrEmpty(nodeText)) { this.Expose = Convert.ToBoolean(nodeText); } if (reader.IsEmptyElement) { return; } if (_listMembers == null) { _listMembers = new BuildList <ReferenceMemberFilter>(); } string nodeName = null; XmlNodeType nodeType = XmlNodeType.None; while (reader.Read()) { nodeName = reader.Name; nodeType = reader.NodeType; if (nodeType == XmlNodeType.Element) { if (String.Equals(nodeName, ReferenceMemberFilter.TagName, StringComparison.OrdinalIgnoreCase)) { ReferenceMemberFilter memberFilter = new ReferenceMemberFilter(); memberFilter.ReadXml(reader); _listMembers.Add(memberFilter); } } else if (nodeType == XmlNodeType.EndElement) { if (String.Equals(nodeName, TagName, StringComparison.OrdinalIgnoreCase)) { break; } } } }
private void ButtonOkay_Click(object sender, RoutedEventArgs e) { if (_backgroundWorker.IsBusy) _backgroundWorker.CancelAsync(); BuildList storedBuilds = new BuildList(); foreach (object item in ListBoxBuilds.Items.Cast<object>().Where(item => ((CheckBox)item).IsChecked == true)) { storedBuilds.Add(((CheckBox)item).Tag as Build); } SaveSettings(storedBuilds); Close(); }
/// <summary> /// This reads and sets its state or attributes stored in a <c>XML</c> format /// with the given reader. /// </summary> /// <param name="reader"> /// The reader with which the <c>XML</c> attributes of this object are accessed. /// </param> /// <exception cref="ArgumentNullException"> /// If the <paramref name="reader"/> is <see langword="null"/>. /// </exception> public override void ReadXml(XmlReader reader) { BuildExceptions.NotNull(reader, "reader"); Debug.Assert(reader.NodeType == XmlNodeType.Element); if (reader.NodeType != XmlNodeType.Element) { return; } if (!String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { return; } _name = reader.GetAttribute("name"); if (reader.IsEmptyElement) { return; } if (_listParts == null) { _listParts = new BuildList <CommentPart>(); } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { CommentPartType partType = CommentPartType.None; switch (reader.Name.ToLower()) { case "overloads": partType = CommentPartType.Overloads; break; case "summary": partType = CommentPartType.Summary; break; case "remarks": partType = CommentPartType.Remarks; break; case "exception": partType = CommentPartType.Exception; break; case "param": partType = CommentPartType.Parameter; break; case "typeparam": partType = CommentPartType.TypeParameter; break; case "returns": partType = CommentPartType.Returns; break; case "value": partType = CommentPartType.Value; break; case "example": partType = CommentPartType.Example; break; } if (partType == CommentPartType.None) { throw new InvalidOperationException(); } CommentPart part = new CommentPart(String.Empty, partType); part.ReadXml(reader); _listParts.Add(part); } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, CommentItem.TagName, StringComparison.OrdinalIgnoreCase)) { break; } } } }
/// <summary> /// This reads and sets its state or attributes stored in a <c>XML</c> format /// with the given reader. /// </summary> /// <param name="reader"> /// The reader with which the <c>XML</c> attributes of this object are accessed. /// </param> /// <exception cref="ArgumentNullException"> /// If the <paramref name="reader"/> is <see langword="null"/>. /// </exception> public override void ReadXml(XmlReader reader) { BuildExceptions.NotNull(reader, "reader"); Debug.Assert(reader.NodeType == XmlNodeType.Element); if (reader.NodeType != XmlNodeType.Element) { return; } if (!String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { return; } string tempText = reader.GetAttribute("Version"); if (!String.IsNullOrEmpty(tempText)) { _version = new Version(tempText); } if (reader.IsEmptyElement) { return; } string sourceDir = String.IsNullOrEmpty(_sourceFile) ? String.Empty : Path.GetDirectoryName(_sourceFile); while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { switch (reader.Name) { case "TemplateAuthoring": if (_authoring == null) { _authoring = new TemplateAuthoring(); } _authoring.ReadXml(reader); break; case "TemplateConfiguration": if (_configuration == null) { _configuration = new TemplateConfiguration(); } _configuration.ReadXml(reader); break; case "TemplateDescription": if (_description == null) { _description = new TemplateDescription(); } _description.ReadXml(reader); break; case "TemplateProperty": if (_properties == null) { _properties = new BuildList <TemplateProperty>(); } TemplateProperty property = new TemplateProperty(); property.ReadXml(reader); if (!property.IsEmpty) { _properties.Add(property); } break; case "TemplateAssistant": if (_assistant == null) { _assistant = new TemplateAssistant(); } _assistant.ReadXml(reader); break; case "TemplateFile": if (_files == null) { _files = new BuildList <TemplateFile>(); } TemplateFile file = new TemplateFile(); if (!String.IsNullOrEmpty(sourceDir)) { file.SourceDir = sourceDir; } file.ReadXml(reader); if (!file.IsEmpty) { _files.Add(file); } break; } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { break; } } } }
public void Add(ReferenceTypeFilter item) { BuildExceptions.NotNull(item, "item"); _listTypes.Add(item); }
protected override void OnReadXml(XmlReader reader) { if (reader.IsEmptyElement) { return; } if (String.Equals(reader.Name, "compilerFile", StringComparison.OrdinalIgnoreCase)) { _compilerFile = BuildFilePath.ReadLocation(reader); } else if (String.Equals(reader.Name, "compilerDirectory", StringComparison.OrdinalIgnoreCase)) { _compilerDir = BuildDirectoryPath.ReadLocation(reader); } else if (String.Equals(reader.Name, "plugin", StringComparison.OrdinalIgnoreCase)) { //<plugin flatToc="False"> // <title></title> // <parents> // <parent>ParentName</parent> // </parents> // <children> // <child>ChildName</child> // </children> //</plugin> if (_pluginParents == null) { _pluginParents = new BuildList <string>(); } if (_pluginChildren == null) { _pluginChildren = new BuildList <string>(); } string tempText = reader.GetAttribute("flatToc"); if (!String.IsNullOrEmpty(tempText)) { _pluginTocFlat = Convert.ToBoolean(tempText); } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { switch (reader.Name.ToLower()) { case "title": _pluginTitle = reader.ReadString(); break; case "parent": tempText = reader.ReadString(); if (!String.IsNullOrEmpty(tempText)) { _pluginParents.Add(tempText); } break; case "child": tempText = reader.ReadString(); if (!String.IsNullOrEmpty(tempText)) { _pluginChildren.Add(tempText); } break; } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, "plugin", StringComparison.OrdinalIgnoreCase)) { break; } } } } }
public void Add(ReferenceNamespaceFilter item) { BuildExceptions.NotNull(item, "item"); _listNamespaces.Add(item); }