當前位置: 首頁>>代碼示例>>C#>>正文


C# WindowsInstallerXml.Table類代碼示例

本文整理匯總了C#中Microsoft.Tools.WindowsInstallerXml.Table的典型用法代碼示例。如果您正苦於以下問題:C# Table類的具體用法?C# Table怎麽用?C# Table使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Table類屬於Microsoft.Tools.WindowsInstallerXml命名空間,在下文中一共展示了Table類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DecompileWixHttpUrlAceTable

        /// <summary>
        /// Decompile the WixHttpUrlAce table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompileWixHttpUrlAceTable(Table table)
        {
            foreach (Row row in table.Rows)
            {
                Http.UrlAce urlace = new Http.UrlAce();
                urlace.Id = (string)row[0];
                urlace.SecurityPrincipal = (string)row[2];
                switch (Convert.ToInt32(row[3]))
                {
                    case HttpConstants.GENERIC_ALL:
                    default:
                        urlace.Rights = Http.UrlAce.RightsType.all;
                        break;
                    case HttpConstants.GENERIC_EXECUTE:
                        urlace.Rights = Http.UrlAce.RightsType.register;
                        break;
                    case HttpConstants.GENERIC_WRITE:
                        urlace.Rights = [email protected];
                        break;
                }

                string reservationId = (string)row[1];
                Http.UrlReservation urlReservation = (Http.UrlReservation)this.Core.GetIndexedElement("WixHttpUrlReservation", reservationId);
                if (null != urlReservation)
                {
                    urlReservation.AddChild(urlace);
                }
                else
                {
                    this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, urlace.Id, "WixHttpUrlReservation_", reservationId, "WixHttpUrlReservation"));
                }
            }
        }
開發者ID:zooba,項目名稱:wix3,代碼行數:37,代碼來源:HttpDecompiler.cs

示例2: DecompileWixHttpUrlReservationTable

        /// <summary>
        /// Decompile the WixHttpUrlReservation table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompileWixHttpUrlReservationTable(Table table)
        {
            foreach (Row row in table.Rows)
            {
                Http.UrlReservation urlReservation = new Http.UrlReservation();
                urlReservation.Id = (string)row[0];
                switch((int)row[1])
                {
                    case HttpConstants.heReplace:
                    default:
                        urlReservation.HandleExisting = Http.UrlReservation.HandleExistingType.replace;
                        break;
                    case HttpConstants.heIgnore:
                        urlReservation.HandleExisting = Http.UrlReservation.HandleExistingType.ignore;
                        break;
                    case HttpConstants.heFail:
                        urlReservation.HandleExisting = Http.UrlReservation.HandleExistingType.fail;
                        break;
                }
                urlReservation.Sddl = (string)row[2];
                urlReservation.Url = (string)row[3];

                Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[4]);
                if (null != component)
                {
                    component.AddChild(urlReservation);
                }
                else
                {
                    this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerCore.PrimaryKeyDelimiter), "Component_", (string)row[2], "Component"));
                }
                this.Core.IndexElement(row, urlReservation);
            }
        }
開發者ID:zooba,項目名稱:wix3,代碼行數:38,代碼來源:HttpDecompiler.cs

示例3: Add

        /// <summary>
        /// Adds a table to the collection.
        /// </summary>
        /// <param name="table">Table to add to the collection.</param>
        /// <remarks>Indexes the table by name.</remarks>
        public void Add(Table table)
        {
            if (null == table)
            {
                throw new ArgumentNullException("table");
            }

            this.collection.Add(table.Name, table);
        }
開發者ID:bullshock29,項目名稱:Wix3.6Toolset,代碼行數:14,代碼來源:TableCollection.cs

示例4: Row

        /// <summary>
        /// Creates a row that belongs to a table.
        /// </summary>
        /// <param name="sourceLineNumbers">Original source lines for this row.</param>
        /// <param name="table">Table this row belongs to and should get its column definitions from.</param>
        /// <remarks>The compiler should use this constructor exclusively.</remarks>
        public Row(SourceLineNumberCollection sourceLineNumbers, Table table)
            : this(sourceLineNumbers, (null != table ? table.Definition : null))
        {
            if (null == table)
            {
                throw new ArgumentNullException("table");
            }

            this.table = table;
        }
開發者ID:bleissem,項目名稱:wix3,代碼行數:16,代碼來源:Row.cs

示例5: DecompileSoftwareIdentificationTag

        /// <summary>
        /// Decompile the SoftwareIdentificationTag table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompileSoftwareIdentificationTag(Table table)
        {
            foreach (Row row in table.Rows)
            {
                Tag.Tag tag = new Tag.Tag();

                tag.Regid = (string)row[1];

                this.Core.RootElement.AddChild(tag);
            }
        }
開發者ID:zooba,項目名稱:wix3,代碼行數:15,代碼來源:TagDecompiler.cs

示例6: FileRow

 /// <summary>
 /// Creates a File row that belongs to a table.
 /// </summary>
 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
 /// <param name="table">Table this File row belongs to and should get its column definitions from.</param>
 public FileRow(SourceLineNumberCollection sourceLineNumbers, Table table)
     : base(sourceLineNumbers, table)
 {
     this.assemblyType = FileAssemblyType.NotAnAssembly;
     this.previousSource = new string[1];
     this.previousSymbols = new string[1];
     this.previousRetainOffsets = new string[1];
     this.previousRetainLengths = new string[1];
     this.previousIgnoreOffsets = new string[1];
     this.previousIgnoreLengths = new string[1];
 }
開發者ID:zooba,項目名稱:wix3,代碼行數:16,代碼來源:FileRow.cs

示例7: DecompileTable

 /// <summary>
 /// Decompiles an extension table.
 /// </summary>
 /// <param name="table">The table to decompile.</param>
 public override void DecompileTable(Table table)
 {
     switch (table.Name)
     {
         case "SoftwareIdentificationTag":
             this.DecompileSoftwareIdentificationTag(table);
             break;
         default:
             base.DecompileTable(table);
             break;
     }
 }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:16,代碼來源:TagDecompiler.cs

示例8: DecompileSoftwareIdentificationTag

        /// <summary>
        /// Decompile the SoftwareIdentificationTag table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompileSoftwareIdentificationTag(Table table)
        {
            foreach (Row row in table.Rows)
            {
                Tag.Tag tag= new Tag.Tag();

                tag.Regid = (string)row[1];
                tag.Name = (string)row[2];
                tag.Licensed = null == row[3] ? Tag.YesNoType.NotSet : 1 == (int)row[3] ? Tag.YesNoType.yes : Tag.YesNoType.no;

                this.Core.RootElement.AddChild(tag);
            }
        }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:17,代碼來源:TagDecompiler.cs

示例9: DecompileTable

 /// <summary>
 /// Decompiles an extension table.
 /// </summary>
 /// <param name="table">The table to decompile.</param>
 public override void DecompileTable(Table table)
 {
     switch (table.Name)
     {
         case "WixHttpUrlReservation":
             this.DecompileWixHttpUrlReservationTable(table);
             break;
         case "WixHttpUrlAce":
             this.DecompileWixHttpUrlAceTable(table);
             break;
         default:
             base.DecompileTable(table);
             break;
     }
 }
開發者ID:zooba,項目名稱:wix3,代碼行數:19,代碼來源:HttpDecompiler.cs

示例10: CopyTableRowsToOutputTable

        /// <summary>
        /// Copies a table's rows to an output table.
        /// </summary>
        /// <param name="table">Source table to copy rows from.</param>
        /// <param name="outputTable">Destination output table to copy rows into.</param>
        /// <param name="sectionId">Id of the section that the table lives in.</param>
        private void CopyTableRowsToOutputTable(Table table, OutputTable outputTable, string sectionId)
        {
            int[] localizedColumns = new int[table.Columns.Count];
            int localizedColumnCount = 0;

            // if there are localization strings, figure out which columns can be localized in this table
            if (null != this.localizer)
            {
                for (int i = 0; i < table.Columns.Count; i++)
                {
                    if (table.Columns[i].IsLocalizable)
                    {
                        localizedColumns[localizedColumnCount++] = i;
                    }
                }
            }

            // process each row in the table doing the string resource substitutions
            // then add the row to the output
            foreach (Row row in table.Rows)
            {
                if (row.IsUnreal)
                {
                    continue;
                }

                // localize all the values
                for (int i = 0; i < localizedColumnCount; i++)
                {
                    object val = row[localizedColumns[i]];

                    if (null != val)
                    {
                        row[localizedColumns[i]] = this.localizer.GetLocalizedValue(val.ToString());
                    }
                }

                outputTable.OutputRows.Add(new OutputRow(row, this.sectionIdOnTuples ? sectionId : null));
            }
        }
開發者ID:sillsdev,項目名稱:FwSupportTools,代碼行數:46,代碼來源:Linker.cs

示例11: BBControlRow

 /// <summary>
 /// Creates a Control row that belongs to a table.
 /// </summary>
 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
 /// <param name="table">Table this Control row belongs to and should get its column definitions from.</param>
 public BBControlRow(SourceLineNumberCollection sourceLineNumbers, Table table) :
     base(sourceLineNumbers, table)
 {
 }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:9,代碼來源:BBControlRow.cs

示例12: ReduceTransform

        /// <summary>
        /// Reduce the transform according to the patch references.
        /// </summary>
        /// <param name="transform">transform generated by torch.</param>
        /// <param name="patchRefTable">Table contains patch family filter.</param>
        /// <returns>true if the transform is not empty</returns>
        public static bool ReduceTransform(Output transform, Table patchRefTable)
        {
            // identify sections to keep
            Hashtable oldSections = new Hashtable(patchRefTable.Rows.Count);
            Hashtable newSections = new Hashtable(patchRefTable.Rows.Count);
            Hashtable tableKeyRows = new Hashtable();
            ArrayList sequenceList = new ArrayList();
            Hashtable componentFeatureAddsIndex = new Hashtable();
            Hashtable customActionTable = new Hashtable();
            Hashtable directoryTableAdds = new Hashtable();
            Hashtable featureTableAdds = new Hashtable();
            ArrayList keptComponentTableAdds = new ArrayList();
            Hashtable keptDirectories = new Hashtable();
            Hashtable keptFeatures = new Hashtable();

            foreach (Row patchRefRow in patchRefTable.Rows)
            {
                string tableName = (string)patchRefRow[0];
                string key = (string)patchRefRow[1];

                Table table = transform.Tables[tableName];
                if (table == null)
                {
                    // table not found
                    continue;
                }

                // index this table
                if (!tableKeyRows.Contains(tableName))
                {
                    Hashtable newKeyRows = new Hashtable();
                    foreach (Row newRow in table.Rows)
                    {
                        newKeyRows[newRow.GetPrimaryKey('/')] = newRow;
                    }
                    tableKeyRows[tableName] = newKeyRows;
                }
                Hashtable keyRows = (Hashtable)tableKeyRows[tableName];

                Row row = (Row)keyRows[key];
                if (row == null)
                {
                    // row not found
                    continue;
                }

                // Differ.sectionDelimiter
                string[] sections = row.SectionId.Split('/');
                oldSections[sections[0]] = row;
                newSections[sections[1]] = row;
            }

            // throw away sections not referenced
            int keptRows = 0;
            Table directoryTable = null;
            Table featureTable = null;
            foreach (Table table in transform.Tables)
            {
                if ("_SummaryInformation" == table.Name)
                {
                    continue;
                }

                if (table.Name == "AdminExecuteSequence"
                    || table.Name == "AdminUISequence"
                    || table.Name == "AdvtExecuteSequence"
                    || table.Name == "InstallUISequence"
                    || table.Name == "InstallExecuteSequence")
                {
                    sequenceList.Add(table);
                    continue;
                }

                for (int i = 0; i < table.Rows.Count; i++)
                {
                    Row row = table.Rows[i];

                    if (table.Name == "CustomAction")
                    {
                        customActionTable.Add(row[0], row);
                    }

                    if (table.Name == "Directory")
                    {
                        directoryTable = table;
                        if (RowOperation.Add == row.Operation)
                        {
                            directoryTableAdds.Add(row[0], row);
                        }
                    }

                    if (table.Name == "Feature")
                    {
                        featureTable = table;
//.........這裏部分代碼省略.........
開發者ID:bullshock29,項目名稱:Wix3.6Toolset,代碼行數:101,代碼來源:Patch.cs

示例13: DecompileSFPCatalogTable

        /// <summary>
        /// Decompile the SFPCatalog table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompileSFPCatalogTable(Table table)
        {
            foreach (Row row in table.Rows)
            {
                Wix.SFPCatalog sfpCatalog = new Wix.SFPCatalog();

                sfpCatalog.Name = Convert.ToString(row[0]);

                sfpCatalog.SourceFile = Convert.ToString(row[1]);

                this.core.IndexElement(row, sfpCatalog);
            }

            // nest the SFPCatalog elements
            foreach (Row row in table.Rows)
            {
                Wix.SFPCatalog sfpCatalog = (Wix.SFPCatalog)this.core.GetIndexedElement(row);

                if (null != row[2])
                {
                    Wix.SFPCatalog parentSFPCatalog = (Wix.SFPCatalog)this.core.GetIndexedElement("SFPCatalog", Convert.ToString(row[2]));

                    if (null != parentSFPCatalog)
                    {
                        parentSFPCatalog.AddChild(sfpCatalog);
                    }
                    else
                    {
                        sfpCatalog.Dependency = Convert.ToString(row[2]);

                        this.core.RootElement.AddChild(sfpCatalog);
                    }
                }
                else
                {
                    this.core.RootElement.AddChild(sfpCatalog);
                }
            }
        }
開發者ID:bullshock29,項目名稱:Wix3.6Toolset,代碼行數:43,代碼來源:Decompiler.cs

示例14: DecompileUITextTable

        /// <summary>
        /// Decompile the UIText table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompileUITextTable(Table table)
        {
            foreach (Row row in table.Rows)
            {
                Wix.UIText uiText = new Wix.UIText();

                uiText.Id = Convert.ToString(row[0]);

                uiText.Content = Convert.ToString(row[1]);

                this.core.UIElement.AddChild(uiText);
            }
        }
開發者ID:bullshock29,項目名稱:Wix3.6Toolset,代碼行數:17,代碼來源:Decompiler.cs

示例15: DecompileVerbTable

        /// <summary>
        /// Decompile the Verb table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompileVerbTable(Table table)
        {
            foreach (Row row in table.Rows)
            {
                Wix.Verb verb = new Wix.Verb();

                verb.Id = Convert.ToString(row[1]);

                if (null != row[2])
                {
                    verb.Sequence = Convert.ToInt32(row[2]);
                }

                if (null != row[3])
                {
                    verb.Command = Convert.ToString(row[3]);
                }

                if (null != row[4])
                {
                    verb.Argument = Convert.ToString(row[4]);
                }

                this.core.IndexElement(row, verb);
            }
        }
開發者ID:bullshock29,項目名稱:Wix3.6Toolset,代碼行數:30,代碼來源:Decompiler.cs


注:本文中的Microsoft.Tools.WindowsInstallerXml.Table類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。