本文整理汇总了C#中Deployment.GetNullableInteger方法的典型用法代码示例。如果您正苦于以下问题:C# Deployment.GetNullableInteger方法的具体用法?C# Deployment.GetNullableInteger怎么用?C# Deployment.GetNullableInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Deployment
的用法示例。
在下文中一共展示了Deployment.GetNullableInteger方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Record
/// <summary>
/// Creates a new instance of the <see cref="Record"/> class copying values
/// from the <see cref="Deployment.WindowsInstaller.Record"/> object.
/// </summary>
/// <param name="record">The <see cref="Deployment.WindowsInstaller.Record"/> from which to copy values.</param>
/// <param name="columns">The <see cref="ColumnCollection"/> for a <see cref="Deployment.WindowsInstaller.View"/>.</param>
/// <param name="transform">The <see cref="TransformView"/> containing information about operations performed on this record.</param>
/// <param name="path">The path to the package that contains the record.</param>
internal Record(Deployment.WindowsInstaller.Record record, ColumnCollection columns, TransformView transform = null, string path = null)
{
// Internal constructor will assume valid parameters.
// Shared reference to the column collection.
this.Columns = columns;
this.Path = path;
// Cache the data from the record.
var primaryKeys = new List<string>();
this.Data = new List<object>(columns.Count);
for (int i = 0; i < columns.Count; ++i)
{
// Windows Installer uses 1-based indices.
var offset = i + 1;
var type = columns[i].Type;
if (type.IsEnum)
{
var value = record.GetNullableInteger(offset);
this.Data.Add(new AttributeColumn(type, value));
if (columns[i].IsPrimaryKey)
{
primaryKeys.Add(null != value ? value.Value.ToString(CultureInfo.InvariantCulture) : string.Empty);
}
}
else if (typeof(Stream) == type)
{
var buffer = CopyStream(record, offset);
this.Data.Add(buffer);
// Binary column types cannot be primary keys.
}
else
{
var data = record[offset];
this.Data.Add(data);
if (columns[i].IsPrimaryKey)
{
primaryKeys.Add(null != data ? data.ToString() : string.Empty);
}
}
}
if (0 < primaryKeys.Count)
{
this.PrimaryKey = primaryKeys.Join(Record.KeySeparator);
}
// Can only reliably get row operations performed on rows in a single table.
if (null != transform && 1 == columns.TableNames.Count())
{
var tableName = columns.TableNames[0];
this.Operation = transform.GetRowOperation(tableName, this.PrimaryKey);
}
else
{
this.Operation = RowOperation.None;
}
}