Exemplo n.º 1
0
 void IXmlSerializable.WriteXml(XmlWriter writer)
 {
     writer.WriteAttributeString("version", base.FileVersion);
     writer.WriteElementString("WorkingDirectory", this.AppWorkingDirectory);
     writer.WriteElementString("BuildId", this.BuildId);
     writer.WriteElementString("CommandLineArgs", this.CommandLineArgs);
     writer.WriteElementString("CommandLineExe", this.CommandLineExe);
     writer.WriteElementString("CoverageTrend", this.CoverageTrend);
     writer.WriteElementString("CoverageMetrics", this.CoverageMetrics.ToString());
     writer.WriteElementString("CoverageFile", this.CoverageFile);
     writer.WriteElementString("CoverAll", this.CoverAllProcesses);
     writer.WriteElementString("CoverChildProcess", this.CoverProcessNamesFilter);
     XmlSerializeHelper.WriteArrayOfStrings(writer, "CoverServiceArguments", "Argument", this.CoverServiceArguments);
     writer.WriteElementString("CoverServiceName", this.CoverServiceName);
     writer.WriteElementString("LiteralMode", this.DontModifySettingsForUsability);
     XmlSerializeHelper.WriteArrayOfStrings(writer, "ExcludeAssemblies", "Assembly", this.ExcludeAssemblies);
     XmlSerializeHelper.WriteArrayOfStrings(writer, "ExcludeAttributes", "Attribute", this.ExcludeAttributes);
     XmlSerializeHelper.WriteArrayOfStrings(writer, "ExcludeTypes", "TypeName", this.ExcludeTypeNames);
     XmlSerializeHelper.WriteArrayOfStrings(writer, "ExcludeFiles", "SourceFile", this.ExcludeFilePaths);
     XmlSerializeHelper.WriteArrayOfStrings(writer, "ExcludeMethods", "MethodName", this.ExcludeMethods);
     writer.WriteElementString("HtmlReportDir", this.HtmlReportDir);
     XmlSerializeHelper.WriteArrayOfStrings(writer, "IncludeAssemblies", "Assembly", this.IncludeAssemblies);
     XmlSerializeHelper.WriteArrayOfStrings(writer, "IncludeAttributes", "Attribute", this.IncludeAttributes);
     writer.WriteElementString("IncludeAutoGenCode", this.IncludeCompilerGeneratedCode);
     XmlSerializeHelper.WriteArrayOfStrings(writer, "IncludeTypes", "TypeName", this.IncludeTypeNames);
     XmlSerializeHelper.WriteArrayOfStrings(writer, "IncludeFiles", "SourceFile", this.IncludeFilePaths);
     writer.WriteElementString("LogFile", this.LogFile);
     writer.WriteElementString("LoggingLevel", this.LoggingLevel.ToString());
     writer.WriteElementString("OnlyAssembliesWithSource", this.OnlyAssembliesWithSource);
     writer.WriteElementString("ProjectName", this.ProjectName);
     writer.WriteElementString("RegisterForUser", this.RegisterForUser);
     writer.WriteElementString("SetupGlobalEnvironment", this.SetupGlobalEnvironment);
     writer.WriteElementString("SymbolSearchLocations", this.SymbolSearchPolicy.ToString());
     writer.WriteElementString("WaitForAppExit", this.WaitForAppExit);
     writer.WriteElementString("WaitForAppLoad", this.WaitForAppLoad);
 }
Exemplo n.º 2
0
        void IXmlSerializable.ReadXml(XmlReader reader)
        {
            string localName = reader.LocalName;

            while (reader.MoveToNextAttribute())
            {
                if (reader.LocalName == "version")
                {
                    string text2 = reader.Value;
                }
            }
            reader.ReadStartElement();
            while (XmlSerializeHelper.MoreContent(reader, localName))
            {
                switch (reader.LocalName)
                {
                case "WorkingDirectory":
                {
                    this.AppWorkingDirectory = XmlSerializeHelper.ReadStringElement(reader);
                    continue;
                }

                case "BuildId":
                {
                    this.BuildId = XmlSerializeHelper.ReadStringElement(reader);
                    continue;
                }

                case "CommandLineArgs":
                {
                    this.CommandLineArgs = XmlSerializeHelper.ReadStringElement(reader);
                    continue;
                }

                case "CommandLineExe":
                {
                    this.CommandLineExe = XmlSerializeHelper.ReadStringElement(reader);
                    continue;
                }

                case "CoverageTrend":
                {
                    this.CoverageTrend = XmlSerializeHelper.ReadStringElement(reader);
                    continue;
                }

                case "CoverageMetrics":
                {
                    this.CoverageMetrics = XmlSerializeHelper.ReadEnumElement <CoverageType>(reader);
                    continue;
                }

                case "CoverageFile":
                {
                    this.CoverageFile = XmlSerializeHelper.ReadStringElement(reader);
                    continue;
                }

                case "CoverAll":
                {
                    this.CoverAllProcesses = XmlSerializeHelper.ReadBooleanElement(reader);
                    continue;
                }

                case "CoverChildProcess":
                {
                    this.CoverProcessNamesFilter = XmlSerializeHelper.ReadStringElement(reader);
                    continue;
                }

                case "CoverServiceArguments":
                {
                    this.CoverServiceArguments = XmlSerializeHelper.ReadArrayOfStrings(reader, "Argument").ToList <string>();
                    continue;
                }

                case "CoverServiceName":
                {
                    this.CoverServiceName = XmlSerializeHelper.ReadStringElement(reader);
                    continue;
                }

                case "ExpertMode":
                case "LiteralMode":
                {
                    this.DontModifySettingsForUsability = XmlSerializeHelper.ReadBooleanElement(reader);
                    continue;
                }

                case "ExcludeAssemblies":
                {
                    this.ExcludeAssemblies = XmlSerializeHelper.ReadArrayOfStrings(reader, "Assembly").ToList <string>();
                    continue;
                }

                case "ExcludeAttributes":
                {
                    this.ExcludeAttributes = XmlSerializeHelper.ReadArrayOfStrings(reader, "Attribute").ToList <string>();
                    continue;
                }

                case "ExcludeTypes":
                {
                    this.ExcludeTypeNames = XmlSerializeHelper.ReadArrayOfStrings(reader, "TypeName").ToList <string>();
                    continue;
                }

                case "ExcludeFiles":
                {
                    this.ExcludeFilePaths = XmlSerializeHelper.ReadArrayOfStrings(reader, "SourceFile").ToList <string>();
                    continue;
                }

                case "ExcludeMethods":
                {
                    this.ExcludeMethods = XmlSerializeHelper.ReadArrayOfStrings(reader, "MethodName").ToList <string>();
                    continue;
                }

                case "HtmlReportDir":
                {
                    this.HtmlReportDir = XmlSerializeHelper.ReadStringElement(reader);
                    continue;
                }

                case "IncludeAssemblies":
                {
                    this.IncludeAssemblies = XmlSerializeHelper.ReadArrayOfStrings(reader, "Assembly").ToList <string>();
                    continue;
                }

                case "IncludeAttributes":
                {
                    this.IncludeAttributes = XmlSerializeHelper.ReadArrayOfStrings(reader, "Attribute").ToList <string>();
                    continue;
                }

                case "IncludeAutoGenCode":
                {
                    this.IncludeCompilerGeneratedCode = XmlSerializeHelper.ReadBooleanElement(reader);
                    continue;
                }

                case "IncludeTypeNames":
                case "IncludeTypes":
                {
                    this.IncludeTypeNames = XmlSerializeHelper.ReadArrayOfStrings(reader, "TypeName").ToList <string>();
                    continue;
                }

                case "IncludeFilePaths":
                case "IncludeFiles":
                {
                    this.IncludeFilePaths = XmlSerializeHelper.ReadArrayOfStrings(reader, "SourceFile").ToList <string>();
                    continue;
                }

                case "LogFile":
                {
                    this.LogFile = XmlSerializeHelper.ReadStringElement(reader);
                    continue;
                }

                case "LoggingLevel":
                {
                    this.LoggingLevel = XmlSerializeHelper.ReadEnumElement <NCover.Interfaces.Enumerations.LogLevel>(reader);
                    continue;
                }

                case "OnlyAssembliesWithSource":
                {
                    this.OnlyAssembliesWithSource = XmlSerializeHelper.ReadBooleanElement(reader);
                    continue;
                }

                case "ProjectName":
                {
                    this.ProjectName = XmlSerializeHelper.ReadStringElement(reader);
                    continue;
                }

                case "RegisterForUser":
                {
                    this.RegisterForUser = XmlSerializeHelper.ReadBooleanElement(reader);
                    continue;
                }

                case "SetupForQuickTestPro":
                case "SetupGlobalEnvironment":
                {
                    this.SetupGlobalEnvironment = XmlSerializeHelper.ReadBooleanElement(reader);
                    continue;
                }

                case "SymbolSearchLocations":
                {
                    this.SymbolSearchPolicy = XmlSerializeHelper.ReadEnumElement <NCover.Interfaces.Enumerations.SymbolSearchPolicy>(reader);
                    continue;
                }

                case "WaitForAppExit":
                {
                    this.WaitForAppExit = XmlSerializeHelper.ReadIntElement(reader);
                    continue;
                }

                case "WaitForAppLoad":
                {
                    this.WaitForAppLoad = XmlSerializeHelper.ReadIntElement(reader);
                    continue;
                }
                }
                throw new InvalidOperationException("Unexpected element: '" + reader.LocalName + "' while deserializing " + base.GetType().Name);
            }
            if (!reader.EOF)
            {
                reader.ReadEndElement();
            }
        }