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


C# INodePacketTranslator.TranslateDotNet方法代码示例

本文整理汇总了C#中INodePacketTranslator.TranslateDotNet方法的典型用法代码示例。如果您正苦于以下问题:C# INodePacketTranslator.TranslateDotNet方法的具体用法?C# INodePacketTranslator.TranslateDotNet怎么用?C# INodePacketTranslator.TranslateDotNet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在INodePacketTranslator的用法示例。


在下文中一共展示了INodePacketTranslator.TranslateDotNet方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: 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

示例3: 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

示例4: ReadFromStream

        /// <summary>
        /// Reads the logging packet from the translator.
        /// </summary>
        internal void ReadFromStream(INodePacketTranslator translator)
        {
            if (LoggingEventType.CustomEvent != _eventType)
            {
                _buildEvent = GetBuildEventArgFromId();

                // The other side is telling us whether the event knows how to log itself, or whether we're going to have 
                // to do it manually 
                int packetVersion = s_defaultPacketVersion;
                translator.Translate(ref packetVersion);

                bool eventCanSerializeItself = true;
                translator.Translate(ref eventCanSerializeItself);

                if (eventCanSerializeItself)
                {
                    MethodInfo methodInfo = null;
                    lock (s_readMethodCache)
                    {
                        if (!s_readMethodCache.TryGetValue(_eventType, out methodInfo))
                        {
                            Type eventDerivedType = _buildEvent.GetType();
                            methodInfo = eventDerivedType.GetMethod("CreateFromStream", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod);
                            s_readMethodCache.Add(_eventType, methodInfo);
                        }
                    }

                    ArgsReaderDelegate readerMethod = (ArgsReaderDelegate)CreateDelegateRobust(typeof(ArgsReaderDelegate), _buildEvent, methodInfo);

                    readerMethod(translator.Reader, packetVersion);
                    if (_eventType == LoggingEventType.TargetFinishedEvent && _targetFinishedTranslator != null)
                    {
                        _targetFinishedTranslator(translator, (TargetFinishedEventArgs)_buildEvent);
                    }
                }
                else
                {
                    _buildEvent = ReadEventFromStream(_eventType, translator);
                }
            }
            else
            {
                string fileLocation = null;
                translator.Translate(ref fileLocation);

                bool resolveAssembly = false;
                lock (s_lockObject)
                {
                    if (!s_customEventsLoaded.Contains(fileLocation))
                    {
                        resolveAssembly = true;
                    }

                    // If we are to resolve the assembly add it to the list of assemblies resolved
                    if (resolveAssembly)
                    {
                        s_customEventsLoaded.Add(fileLocation);
                    }
                }

                if (resolveAssembly)
                {
                    s_resolver = new TaskEngineAssemblyResolver();
                    s_resolver.InstallHandler();
                    s_resolver.Initialize(fileLocation);
                }

                try
                {
                    translator.TranslateDotNet(ref _buildEvent);
                }
                finally
                {
                    if (resolveAssembly)
                    {
                        s_resolver.RemoveHandler();
                        s_resolver = null;
                    }
                }
            }

            _eventType = GetLoggingEventId(_buildEvent);
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:86,代码来源:LogMessagePacketBase.cs

示例5: WriteToStream

        /// <summary>
        /// Writes the logging packet to the translator.
        /// </summary>
        internal void WriteToStream(INodePacketTranslator translator)
        {
            if (_eventType != LoggingEventType.CustomEvent)
            {
                MethodInfo methodInfo = null;
                lock (s_writeMethodCache)
                {
                    if (!s_writeMethodCache.TryGetValue(_eventType, out methodInfo))
                    {
                        Type eventDerivedType = _buildEvent.GetType();
                        methodInfo = eventDerivedType.GetMethod("WriteToStream", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod);
                        s_writeMethodCache.Add(_eventType, methodInfo);
                    }
                }

                int packetVersion = s_defaultPacketVersion;

                // Make sure the other side knows what sort of serialization is coming
                translator.Translate(ref packetVersion);

                bool eventCanSerializeItself = methodInfo != null;
                translator.Translate(ref eventCanSerializeItself);

                if (eventCanSerializeItself)
                {
                    // 3.5 or later -- we have custom serialization methods, so let's use them.  
                    ArgsWriterDelegate writerMethod = (ArgsWriterDelegate)CreateDelegateRobust(typeof(ArgsWriterDelegate), _buildEvent, methodInfo);
                    writerMethod(translator.Writer);

                    if (_eventType == LoggingEventType.TargetFinishedEvent && _targetFinishedTranslator != null)
                    {
                        _targetFinishedTranslator(translator, (TargetFinishedEventArgs)_buildEvent);
                    }
                }
                else
                {
                    WriteEventToStream(_buildEvent, _eventType, translator);
                }
            }
            else
            {
                string assemblyLocation = _buildEvent.GetType().Assembly.Location;
                translator.Translate(ref assemblyLocation);
                translator.TranslateDotNet(ref _buildEvent);
            }
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:49,代码来源:LogMessagePacketBase.cs

示例6:

 /// <summary>
 /// Reads or writes the packet to the serializer.
 /// </summary>
 void INodePacketTranslatable.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 _initialTargets);
     translator.Translate(ref _defaultTargets);
     translator.Translate(ref _circularDependency);
     translator.TranslateDotNet(ref _requestException);
     translator.TranslateDictionary<ConcurrentDictionary<string, TargetResult>, TargetResult>(ref _resultsByTarget, TargetResult.FactoryForDeserialization, CreateTargetResultDictionary);
     translator.Translate(ref _baseOverallResult);
     translator.Translate(ref _projectStateAfterBuild, ProjectInstance.FactoryForDeserialization);
     translator.Translate(ref _savedCurrentDirectory);
     translator.TranslateDictionary(ref _savedEnvironmentVariables, StringComparer.OrdinalIgnoreCase);
 }
开发者ID:cameron314,项目名称:msbuild,代码行数:20,代码来源:BuildResult.cs

示例7: Translate

 /// <summary>
 /// Translates the packet to/from binary form.
 /// </summary>
 /// <param name="translator">The translator to use.</param>
 public void Translate(INodePacketTranslator translator)
 {
     translator.TranslateEnum(ref _taskResult, (int)_taskResult);
     translator.TranslateDotNet(ref _taskException);
     translator.Translate(ref _taskExceptionMessage);
     translator.Translate(ref _taskExceptionMessageArgs);
     translator.TranslateDictionary(ref _taskOutputParameters, StringComparer.OrdinalIgnoreCase, TaskParameter.FactoryForDeserialization);
     translator.TranslateDictionary(ref _buildProcessEnvironment, StringComparer.OrdinalIgnoreCase);
 }
开发者ID:cameron314,项目名称:msbuild,代码行数:13,代码来源:TaskHostTaskComplete.cs

示例8: 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 _buildParameters, BuildParameters.FactoryForDeserialization);
     translator.TranslateArray(ref _forwardingLoggers, LoggerDescription.FactoryForTranslation);
     translator.TranslateDotNet(ref _appDomainSetup);
 }
开发者ID:cameron314,项目名称:msbuild,代码行数:11,代码来源:NodeConfiguration.cs


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