Example #1
0
        /// <summary>
        /// Finalize the Perfmon table.
        /// </summary>
        /// <param name="tables">The collection of all tables.</param>
        /// <remarks>
        /// Since the PerfCounter element nests under a File element, but
        /// the Perfmon table does not have a foreign key relationship with
        /// the File table (instead it has a formatted string that usually
        /// refers to a file row - but doesn't have to), the nesting must
        /// be inferred during finalization.
        /// </remarks>
        private void FinalizePerfmonTable(TableCollection tables)
        {
            Table perfmonTable = tables["Perfmon"];

            if (null != perfmonTable)
            {
                foreach (Row row in perfmonTable.Rows)
                {
                    string           formattedFile = (string)row[1];
                    Util.PerfCounter perfCounter   = (Util.PerfCounter) this.Core.GetIndexedElement(row);

                    // try to "de-format" the File column's value to determine the proper parent File element
                    if ((formattedFile.StartsWith("[#") || formattedFile.StartsWith("[!")) && formattedFile.EndsWith("]"))
                    {
                        string fileId = formattedFile.Substring(2, formattedFile.Length - 3);

                        Wix.File file = (Wix.File) this.Core.GetIndexedElement("File", fileId);
                        if (null != file)
                        {
                            file.AddChild(perfCounter);
                        }
                        else
                        {
                            this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, perfmonTable.Name, row.GetPrimaryKey(DecompilerCore.PrimaryKeyDelimiter), "File", formattedFile, "File"));
                        }
                    }
                    else
                    {
                        // TODO: warn about this being undecompilable because its not well-formed
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// Decompile the Perfmon table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompilePerfmonTable(Table table)
        {
            foreach (Row row in table.Rows)
            {
                Util.PerfCounter perfCounter = new Util.PerfCounter();

                perfCounter.Name = (string)row[2];

                this.Core.IndexElement(row, perfCounter);
            }
        }
Example #3
0
        /// <summary>
        /// Decompile the Perfmon table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompilePerfmonTable(Table table)
        {
            foreach (Row row in table.Rows)
            {
                Util.PerfCounter perfCounter = new Util.PerfCounter();

                perfCounter.Name = (string)row[2];

                this.Core.IndexElement(row, perfCounter);
            }
        }