本文整理汇总了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"));
}
}
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
}
示例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];
}
示例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;
}
}
示例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);
}
}
示例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;
}
}
示例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));
}
}
示例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)
{
}
示例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;
//.........这里部分代码省略.........
示例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);
}
}
}
示例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);
}
}
示例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);
}
}