コード例 #1
0
ファイル: HeliosSerializer.cs プロジェクト: appsou/Helios
        public IEnumerable <string> DeserializeInterface(HeliosInterfaceCollection destination, XmlReader xmlReader)
        {
            string interfaceType = xmlReader.GetAttribute("TypeIdentifier");

            ComponentUnsupportedSeverity unsupportedSeverity = ReadUnsupportedSeverity(xmlReader);
            HeliosInterface heliosInterface = (HeliosInterface)CreateNewObject("Interface", interfaceType, unsupportedSeverity);

            if (heliosInterface != null)
            {
                string name = xmlReader.GetAttribute("Name");
                if (xmlReader.IsEmptyElement)
                {
                    // don't read from empty XML element
                    xmlReader.Read();
                }
                else
                {
                    xmlReader.ReadStartElement("Interface");
                    heliosInterface.ReadXml(xmlReader);
                    xmlReader.ReadEndElement();
                }
                heliosInterface.Name = name;
                heliosInterface.UnsupportedSeverity = unsupportedSeverity;
                destination.Add(heliosInterface);
                yield return($"loaded {heliosInterface.TypeIdentifier} {heliosInterface.Name}");
            }
            else
            {
                xmlReader.Skip();
                yield return("failed to load interface");
            }
        }
コード例 #2
0
 public void SerializeInterfaces(HeliosInterfaceCollection interfaces, XmlWriter xmlWriter)
 {
     xmlWriter.WriteStartElement("Interfaces");
     foreach (HeliosInterface heliosInterface in interfaces)
     {
         SerializeInterface(heliosInterface, xmlWriter);
     }
     xmlWriter.WriteEndElement(); // Interfaces
 }
コード例 #3
0
 private ProfileExplorerTreeItem(string name, HeliosInterfaceCollection interfaces, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes)
     : this(name, "", parent, includeTypes)
 {
     _itemType = ProfileExplorerTreeItemType.Folder;
     foreach (HeliosInterface heliosInterface in interfaces)
     {
         ProfileExplorerTreeItem item = new ProfileExplorerTreeItem(heliosInterface, this, includeTypes);
         Children.Add(item);
     }
 }
コード例 #4
0
 public void DeserializeInterfaces(HeliosInterfaceCollection destination, XmlReader xmlReader)
 {
     if (!xmlReader.IsEmptyElement)
     {
         xmlReader.ReadStartElement("Interfaces");
         while (xmlReader.NodeType != XmlNodeType.EndElement)
         {
             HeliosInterface heliosInterface = DeserializeInterface(xmlReader);
             if (heliosInterface != null)
             {
                 destination.Add(heliosInterface);
             }
         }
         xmlReader.ReadEndElement();
     }
     else
     {
         xmlReader.Read();
     }
 }
コード例 #5
0
ファイル: HeliosSerializer.cs プロジェクト: Heliflyer/helios
 public void DeserializeInterfaces(HeliosInterfaceCollection destination, XmlReader xmlReader)
 {
     if (!xmlReader.IsEmptyElement)
     {
         xmlReader.ReadStartElement("Interfaces");
         while (xmlReader.NodeType != XmlNodeType.EndElement)
         {
             HeliosInterface heliosInterface = DeserializeInterface(xmlReader);
             if (heliosInterface != null)
             {
                 destination.Add(heliosInterface);
             }
         }
         xmlReader.ReadEndElement();
     }
     else
     {
         xmlReader.Read();
     }
 }
コード例 #6
0
ファイル: HeliosSerializer.cs プロジェクト: Heliflyer/helios
 public void SerializeInterfaces(HeliosInterfaceCollection interfaces, XmlWriter xmlWriter)
 {
     xmlWriter.WriteStartElement("Interfaces");
     foreach (HeliosInterface heliosInterface in interfaces)
     {
         SerializeInterface(heliosInterface, xmlWriter);
     }
     xmlWriter.WriteEndElement(); // Interfaces
 }
コード例 #7
0
 private ProfileExplorerTreeItem(string name, HeliosInterfaceCollection interfaces, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes)
     : this(name, "", parent, includeTypes)
 {
     _itemType = ProfileExplorerTreeItemType.Folder;
     foreach (HeliosInterface heliosInterface in interfaces)
     {
         ProfileExplorerTreeItem item = new ProfileExplorerTreeItem(heliosInterface, this, includeTypes);
         Children.Add(item);
     }
 }