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


C# INodePacketTranslator类代码示例

本文整理汇总了C#中INodePacketTranslator的典型用法代码示例。如果您正苦于以下问题:C# INodePacketTranslator类的具体用法?C# INodePacketTranslator怎么用?C# INodePacketTranslator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


INodePacketTranslator类属于命名空间,在下文中一共展示了INodePacketTranslator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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