本文整理汇总了C#中Microsoft.Build.BuildEngine.BuildItem.CreateFromStream方法的典型用法代码示例。如果您正苦于以下问题:C# BuildItem.CreateFromStream方法的具体用法?C# BuildItem.CreateFromStream怎么用?C# BuildItem.CreateFromStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.BuildEngine.BuildItem
的用法示例。
在下文中一共展示了BuildItem.CreateFromStream方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateFromStream
internal static BuildResult CreateFromStream(BinaryReader reader)
{
BuildResult buildResult = new BuildResult();
#region OutputsByTarget
if (reader.ReadByte() == 0)
{
buildResult.outputsByTarget = null;
}
else
{
int numberOfElements = reader.ReadInt32();
buildResult.outputsByTarget = new Hashtable(numberOfElements, StringComparer.OrdinalIgnoreCase);
for (int i = 0; i < numberOfElements; i++)
{
string key = reader.ReadString();
BuildItem[] value = null;
if (reader.ReadByte() != 0)
{
int sizeOfArray = reader.ReadInt32();
value = new BuildItem[sizeOfArray];
for (int j = 0; j < sizeOfArray; j++)
{
BuildItem itemToAdd = null;
if (reader.ReadByte() != 0)
{
itemToAdd = new BuildItem(null, string.Empty);
itemToAdd.CreateFromStream(reader);
}
value[j] = itemToAdd;
}
}
buildResult.outputsByTarget.Add(key, value);
}
}
#endregion
#region ResultsByTarget
//Write Number of HashItems
int numberOfHashKeyValuePairs = reader.ReadInt32();
buildResult.resultByTarget = new Hashtable(numberOfHashKeyValuePairs, StringComparer.OrdinalIgnoreCase);
for (int i = 0; i < numberOfHashKeyValuePairs; i++)
{
string key = reader.ReadString();
int value = reader.ReadInt32();
buildResult.resultByTarget.Add(key, (Target.BuildState)value);
}
#endregion
buildResult.flags = reader.ReadByte();
buildResult.handleId = reader.ReadInt32();
buildResult.requestId = reader.ReadInt32();
buildResult.projectId = reader.ReadInt32();
#region DefaultTargets
if (reader.ReadByte() == 0)
{
buildResult.defaultTargets = null;
}
else
{
buildResult.defaultTargets = reader.ReadString();
}
#endregion
#region InitialTargets
if (reader.ReadByte() == 0)
{
buildResult.initialTargets = null;
}
else
{
buildResult.initialTargets = reader.ReadString();
}
#endregion
#region Timing data
buildResult.totalTime = reader.ReadInt32();
buildResult.engineTime = reader.ReadInt32();
buildResult.taskTime = reader.ReadInt32();
#endregion
return buildResult;
}
示例2: CreateFromStream
internal override void CreateFromStream(BinaryReader reader)
{
base.CreateFromStream(reader);
buildItems = null;
if (reader.ReadByte() != 0)
{
int sizeOfArray = reader.ReadInt32();
buildItems = new BuildItem[sizeOfArray];
for (int j = 0; j < sizeOfArray; j++)
{
BuildItem itemToAdd = null;
if (reader.ReadByte() != 0)
{
itemToAdd = new BuildItem(null, string.Empty);
itemToAdd.CreateFromStream(reader);
}
buildItems[j] = itemToAdd;
}
}
}