本文整理汇总了C#中INodePacketTranslator类的典型用法代码示例。如果您正苦于以下问题:C# INodePacketTranslator类的具体用法?C# INodePacketTranslator怎么用?C# INodePacketTranslator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
INodePacketTranslator类属于命名空间,在下文中一共展示了INodePacketTranslator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DeserializeAndRoutePacket
/// <summary>
/// Creates and routes a packet with data from a binary stream.
/// </summary>
public void DeserializeAndRoutePacket(int nodeId, NodePacketType packetType, INodePacketTranslator translator)
{
// PERF: Not using VerifyThrow to avoid boxing of packetType in the non-error case
if (!_packetFactories.ContainsKey(packetType))
{
ErrorUtilities.ThrowInternalError("No packet handler for type {0}", packetType);
}
PacketFactoryRecord record = _packetFactories[packetType];
record.DeserializeAndRoutePacket(nodeId, translator);
}
开发者ID:cameron314,项目名称:msbuild,代码行数:14,代码来源:NodePacketFactory.cs
示例2: TranslateTargetFinishedEvent
/// <summary>
/// Translate the TargetOutputs for the target finished event.
/// </summary>
private static void TranslateTargetFinishedEvent(INodePacketTranslator translator, TargetFinishedEventArgs finishedEvent)
{
List<TaskItem> targetOutputs = null;
if (translator.Mode == TranslationDirection.WriteToStream)
{
if (finishedEvent.TargetOutputs != null)
{
targetOutputs = new List<TaskItem>();
foreach (TaskItem item in finishedEvent.TargetOutputs)
{
targetOutputs.Add(item);
}
}
}
translator.Translate<TaskItem>(ref targetOutputs, TaskItem.FactoryForDeserialization);
if (translator.Mode == TranslationDirection.ReadFromStream)
{
finishedEvent.TargetOutputs = targetOutputs;
}
}
开发者ID:cameron314,项目名称:msbuild,代码行数:25,代码来源:LogMessagePacket.cs
示例3:
/// <summary>
/// Writes the packet to the serializer.
/// Always send as ints, even if ushorts are being used: otherwise it'd
/// need a byte to discriminate and the savings would be microscopic.
/// </summary>
void INodePacketTranslatable.Translate(INodePacketTranslator translator)
{
ErrorUtilities.VerifyThrow(translator.Mode == TranslationDirection.WriteToStream, "write only");
string file = File;
int line = Line;
int column = Column;
translator.Translate(ref file);
translator.Translate(ref line);
translator.Translate(ref column);
}
开发者ID:cameron314,项目名称:msbuild,代码行数:16,代码来源:ElementLocation.cs
示例4: DeserializeAndRoutePacket
public void DeserializeAndRoutePacket(int nodeId, NodePacketType packetType, INodePacketTranslator translator)
{
throw new NotImplementedException();
}
开发者ID:JamesLinus,项目名称:msbuild,代码行数:4,代码来源:NodeEndpointInProc_Tests.cs
示例5: DeserializeAndRoutePacket
/// <summary>
/// Deserializes and routes a packet. Not used in the in-proc node.
/// </summary>
public void DeserializeAndRoutePacket(int nodeId, NodePacketType packetType, INodePacketTranslator translator)
{
// Not used
ErrorUtilities.ThrowInternalErrorUnreachable();
}
开发者ID:cameron314,项目名称:msbuild,代码行数:8,代码来源:NodeProviderInProc.cs
示例6: Translate
/// <summary>
/// Serializes or deserializes a packet.
/// </summary>
public void Translate(INodePacketTranslator translator)
{
translator.TranslateEnum(ref _reason, (int)_reason);
translator.TranslateDotNet(ref _exception);
}
开发者ID:cameron314,项目名称:msbuild,代码行数:8,代码来源:NodeShutdown.cs
示例7: Translate
public void Translate(INodePacketTranslator translator)
{
ErrorUtilities.VerifyThrow(translator.Mode == TranslationDirection.WriteToStream, "write only");
string assemblyName = AssemblyName;
string assemblyFile = AssemblyFile;
translator.Translate(ref assemblyName);
translator.Translate(ref assemblyFile);
}
开发者ID:cameron314,项目名称:msbuild,代码行数:8,代码来源:AssemblyLoadInfo.cs
示例8: FactoryForDeserialization
/// <summary>
/// The class factory for deserialization.
/// </summary>
internal static BuildParameters FactoryForDeserialization(INodePacketTranslator translator)
{
return new BuildParameters(translator);
}
开发者ID:JamesLinus,项目名称:msbuild,代码行数:7,代码来源:BuildParameters.cs
示例9: BuildRequest
/// <summary>
/// Private constructor for deserialization
/// </summary>
private BuildRequest(INodePacketTranslator translator)
{
Translate(translator);
}
开发者ID:cameron314,项目名称:msbuild,代码行数:7,代码来源:BuildRequest.cs
示例10: FactoryForDeserialization
/// <summary>
/// Factory for deserialization.
/// </summary>
internal static INodePacket FactoryForDeserialization(INodePacketTranslator translator)
{
TaskHostConfiguration configuration = new TaskHostConfiguration();
configuration.Translate(translator);
return configuration;
}
开发者ID:cameron314,项目名称:msbuild,代码行数:9,代码来源:TaskHostConfiguration.cs
示例11: Translate
/// <summary>
/// Translates the packet to/from binary form.
/// </summary>
/// <param name="translator">The translator to use.</param>
public void Translate(INodePacketTranslator translator)
{
translator.Translate(ref _nodeId);
translator.Translate(ref _startupDirectory);
translator.TranslateDictionary(ref _buildProcessEnvironment, StringComparer.OrdinalIgnoreCase);
translator.TranslateCulture(ref _culture);
translator.TranslateCulture(ref _uiCulture);
translator.TranslateDotNet(ref _appDomainSetup);
translator.Translate(ref _lineNumberOfTask);
translator.Translate(ref _columnNumberOfTask);
translator.Translate(ref _projectFileOfTask);
translator.Translate(ref _taskName);
translator.Translate(ref _taskLocation);
translator.TranslateDictionary(ref _taskParameters, StringComparer.OrdinalIgnoreCase, TaskParameter.FactoryForDeserialization);
translator.Translate(ref _continueOnError);
}
开发者ID:cameron314,项目名称:msbuild,代码行数:20,代码来源:TaskHostConfiguration.cs
示例12: WorkUnitResult
/// <summary>
/// Translator constructor
/// </summary>
private WorkUnitResult(INodePacketTranslator translator)
{
((INodePacketTranslatable)this).Translate(translator);
}
开发者ID:cameron314,项目名称:msbuild,代码行数:7,代码来源:WorkUnitResult.cs
示例13: FactoryForDeserialization
/// <summary>
/// Factory for serialization.
/// </summary>
static internal WorkUnitResult FactoryForDeserialization(INodePacketTranslator translator)
{
return new WorkUnitResult(translator);
}
开发者ID:cameron314,项目名称:msbuild,代码行数:7,代码来源:WorkUnitResult.cs
示例14: Translate
/// <summary>
/// Translator.
/// </summary>
public void Translate(INodePacketTranslator translator)
{
translator.TranslateEnum(ref _resultCode, (int)_resultCode);
translator.TranslateEnum(ref _actionCode, (int)_actionCode);
translator.TranslateDotNet(ref _exception);
}
开发者ID:cameron314,项目名称:msbuild,代码行数:9,代码来源:WorkUnitResult.cs
示例15: DeserializeAndRoutePacket
/// <summary>
/// Takes a serializer, deserializes the packet and routes it to the appropriate handler.
/// </summary>
/// <param name="nodeId">The node from which the packet was received.</param>
/// <param name="packetType">The packet type.</param>
/// <param name="translator">The translator containing the data from which the packet should be reconstructed.</param>
public void DeserializeAndRoutePacket(int nodeId, NodePacketType packetType, INodePacketTranslator translator)
{
throw new NotSupportedException("not used");
}
开发者ID:cameron314,项目名称:msbuild,代码行数:10,代码来源:TaskHostNodeManager.cs
示例16: BuildParameters
/// <summary>
/// Private constructor for translation
/// </summary>
private BuildParameters(INodePacketTranslator translator)
{
((INodePacketTranslatable)this).Translate(translator);
}
开发者ID:JamesLinus,项目名称:msbuild,代码行数:7,代码来源:BuildParameters.cs
示例17:
/// <summary>
/// Implementation of the serialization mechanism.
/// </summary>
void INodePacketTranslatable.Translate(INodePacketTranslator translator)
{
translator.Translate(ref _buildId);
/* No build thread priority during translation. We specifically use the default (which is ThreadPriority.Normal) */
translator.TranslateDictionary(ref _buildProcessEnvironment, StringComparer.OrdinalIgnoreCase);
translator.TranslateCulture(ref _culture);
translator.Translate(ref _defaultToolsVersion);
translator.Translate(ref _disableInProcNode);
translator.Translate(ref _enableNodeReuse);
translator.TranslateProjectPropertyInstanceDictionary(ref _environmentProperties);
/* No forwarding logger information sent here - that goes with the node configuration */
translator.TranslateProjectPropertyInstanceDictionary(ref _globalProperties);
/* No host services during translation */
/* No loggers during translation */
translator.Translate(ref _maxNodeCount);
translator.Translate(ref _memoryUseLimit);
translator.Translate(ref _nodeExeLocation);
/* No node id during translation */
translator.Translate(ref _onlyLogCriticalEvents);
translator.Translate(ref s_startupDirectory);
translator.TranslateCulture(ref _uiCulture);
translator.Translate(ref _toolsetProvider, Microsoft.Build.Evaluation.ToolsetProvider.FactoryForDeserialization);
translator.Translate(ref _useSynchronousLogging);
translator.Translate(ref _shutdownInProcNodeOnBuildFinish);
translator.Translate(ref _logTaskInputs);
translator.Translate(ref _logInitialPropertiesAndItems);
// ProjectRootElementCache is not transmitted.
// ResetCaches is not transmitted.
// LegacyThreadingSemantics is not transmitted.
}
开发者ID:JamesLinus,项目名称:msbuild,代码行数:34,代码来源:BuildParameters.cs
示例18: Translate
/// <summary>
/// Reads/writes this packet
/// </summary>
public void Translate(INodePacketTranslator translator)
{
translator.Translate(ref _submissionId);
translator.Translate(ref _configurationId);
translator.Translate(ref _globalRequestId);
translator.Translate(ref _parentGlobalRequestId);
translator.Translate(ref _nodeRequestId);
translator.Translate(ref _targets);
translator.Translate(ref _parentBuildEventContext);
translator.Translate(ref _buildEventContext);
translator.TranslateEnum(ref _buildRequestDataFlags, (int)_buildRequestDataFlags);
// UNDONE: (Compat) Serialize the host object.
}
开发者ID:cameron314,项目名称:msbuild,代码行数:17,代码来源:BuildRequest.cs
示例19: FactoryForTranslation
static public AssemblyLoadInfo FactoryForTranslation(INodePacketTranslator translator)
{
string assemblyName = null;
string assemblyFile = null;
translator.Translate(ref assemblyName);
translator.Translate(ref assemblyFile);
return Create(assemblyName, assemblyFile);
}
开发者ID:cameron314,项目名称:msbuild,代码行数:9,代码来源:AssemblyLoadInfo.cs
示例20: FactoryForDeserialization
/// <summary>
/// Factory for serialization.
/// </summary>
static internal INodePacket FactoryForDeserialization(INodePacketTranslator translator)
{
return new BuildRequest(translator);
}
开发者ID:cameron314,项目名称:msbuild,代码行数:7,代码来源:BuildRequest.cs
注:本文中的INodePacketTranslator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论