当前位置: 首页>>代码示例>>C#>>正文


C# BuildItem.CreateFromStream方法代码示例

本文整理汇总了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;
 }
开发者ID:nikson,项目名称:msbuild,代码行数:77,代码来源:BuildResult.cs

示例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;
         }
     }
 }
开发者ID:nikson,项目名称:msbuild,代码行数:20,代码来源:BuildItemCacheEntry.cs


注:本文中的Microsoft.Build.BuildEngine.BuildItem.CreateFromStream方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。