コード例 #1
0
        /**
         * Writes dictionary values.
         */
        private static void WriteDictionaryValues(StreamWriter writer, CXmlDataBlock datablock)
        {
            writer.Write(PrettyString(XmlConsts.Kxml_panic_id, datablock.PanicId()));
            writer.Write(PrettyString(XmlConsts.Kxml_panic_category, datablock.PanicCategory()));
            writer.Write(PrettyString(XmlConsts.Kxml_panic_description, Regex.Replace(datablock.PanicDescription(), "<(.|\n)*?>", "")));
            writer.Write(PrettyString(XmlConsts.Kxml_language, datablock.Language()));

            if (!datablock.Process().Equals(XmlConsts.Kxml_unknown_process))
            {
                writer.Write(PrettyString(XmlConsts.Kxml_panicked_process, datablock.Process()));
            }

            writer.Write(PrettyString(XmlConsts.Kxml_network_country_code, datablock.NetworkCountry()));
            writer.Write(PrettyString(XmlConsts.Kxml_network_identity, datablock.NetworkIdentity()));
            writer.Write(PrettyString(XmlConsts.Kxml_s60version, datablock.S60Version()));
            writer.Write(PrettyString(XmlConsts.Kxml_product_code, datablock.ProductCode()));
            writer.Write(PrettyString(XmlConsts.Kxml_variant_version, datablock.VariantVersion()));

            if (datablock.ReportType() != string.Empty)
            {
                writer.Write(PrettyString(XmlConsts.Kxml_file_type, "1"));
            }
            else
            {
                writer.Write(PrettyString(XmlConsts.Kxml_file_type, "0"));
            }

            // Production mode
            if (datablock.ProductionMode() != -1)
            {
                if (datablock.ProductionMode() == 1)
                {
                    writer.Write(PrettyString(XmlConsts.Kxml_production_mode, XmlConsts.Kxml_production_mode_value));
                }
                else
                {
                    writer.Write(PrettyString(XmlConsts.Kxml_production_mode, XmlConsts.Kxml_rnd_mode_value));
                }
            }

            // Crash source
            if (datablock.CrashSource() != -1)
            {
                if (datablock.CrashSource() == 1)
                {
                    writer.Write(PrettyString(XmlConsts.Kxml_crash_source, XmlConsts.Kxml_crash_source_user));
                }
                else
                {
                    writer.Write(PrettyString(XmlConsts.Kxml_crash_source, XmlConsts.Kxml_crash_source_kernel));
                }
            }

            // Symbol file names
            if (datablock.SymbolFiles().Count > 0)
            {
                writer.Write(PrettyTitle(KTitleSymbolFileNames));
            }

            foreach (string fileName in datablock.SymbolFiles())
            {
                writer.WriteLine(fileName);
            }
        }
コード例 #2
0
        private static void WriteDictionaryValues(XmlWriter aOutput, CXmlDataBlock datablock)
        {
            // Dictionary values
            aOutput.WriteStartElement(XmlConsts.Kxml_dictionary_values);

            WriteDetail(aOutput, XmlConsts.Kxml_panic_id, datablock.PanicId());
            WriteDetail(aOutput, XmlConsts.Kxml_panic_category, datablock.PanicCategory());
            WriteDetail(aOutput, XmlConsts.Kxml_language, datablock.Language());

            if (!datablock.Process().Equals(XmlConsts.Kxml_unknown_process))
            {
                WriteDetail(aOutput, XmlConsts.Kxml_panicked_process, datablock.Process());
            }

            WriteDetail(aOutput, XmlConsts.Kxml_network_country_code, datablock.NetworkCountry());
            WriteDetail(aOutput, XmlConsts.Kxml_network_identity, datablock.NetworkIdentity());
            WriteDetail(aOutput, XmlConsts.Kxml_s60version, datablock.S60Version());
            WriteDetail(aOutput, XmlConsts.Kxml_product_code, datablock.ProductCode());
            WriteDetail(aOutput, XmlConsts.Kxml_variant_version, datablock.VariantVersion());

            aOutput.WriteStartElement(XmlConsts.Kxml_detail);
            aOutput.WriteAttributeString(XmlConsts.Kxml_name, XmlConsts.Kxml_file_type);
            if (datablock.ReportType() != string.Empty)
            {
                aOutput.WriteAttributeString(XmlConsts.Kxml_value, "1");
            }
            else
            {
                aOutput.WriteAttributeString(XmlConsts.Kxml_value, "0");
            }
            aOutput.WriteEndElement();

            // Production mode
            if (datablock.ProductionMode() != -1)
            {
                aOutput.WriteStartElement(XmlConsts.Kxml_detail);
                aOutput.WriteAttributeString(XmlConsts.Kxml_name, XmlConsts.Kxml_production_mode);
                if (datablock.ProductionMode() == 1)
                {
                    aOutput.WriteAttributeString(XmlConsts.Kxml_value, XmlConsts.Kxml_production_mode_value);
                }
                else
                {
                    aOutput.WriteAttributeString(XmlConsts.Kxml_value, XmlConsts.Kxml_rnd_mode_value);
                }
                aOutput.WriteEndElement();
            }

            // Crash source
            if (datablock.CrashSource() != -1)
            {
                aOutput.WriteStartElement(XmlConsts.Kxml_detail);
                aOutput.WriteAttributeString(XmlConsts.Kxml_name, XmlConsts.Kxml_crash_source);
                if (datablock.CrashSource() == 1)
                {
                    aOutput.WriteAttributeString(XmlConsts.Kxml_value, XmlConsts.Kxml_crash_source_user);
                }
                else
                {
                    aOutput.WriteAttributeString(XmlConsts.Kxml_value, XmlConsts.Kxml_crash_source_kernel);
                }
                aOutput.WriteEndElement();
            }

            WriteSymbolFileNames(aOutput, datablock);


            aOutput.WriteEndElement(); // dictionary values
        }