• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MessageImportance类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



MessageImportance类属于命名空间,在下文中一共展示了MessageImportance类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: LogEventsFromTextOutput

 /// <summary>
 /// Parses a single line of text to identify any errors or warnings in canonical format.
 /// </summary>
 /// <param name="singleLine">A single line of text for the method to parse.</param><param name="messageImportance">A value of <see cref="T:Microsoft.Build.Framework.MessageImportance"/> that indicates the importance level with which to log the message.</param>
 protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
 {
     if (!string.IsNullOrEmpty(singleLine))
     {
         base.LogEventsFromTextOutput(singleLine, messageImportance);
     }
 }
开发者ID:Xtremrules,项目名称:dot42,代码行数:11,代码来源:AdbToolTask.cs


示例2: LogEventsFromTextOutput

        protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
        {
            if (singleLine.StartsWith("Successfully created package"))
            {
                var outputPackage = singleLine.Split('\'').Skip(1).First();
                var outputPackageItem = new TaskItem(outputPackage);
                if (outputPackage.EndsWith(".symbols.nupkg", StringComparison.OrdinalIgnoreCase))
                {
                    OutputSymbolsPackage = new[] { outputPackageItem };
                }
                else
                {
                    OutputPackage = new[] { outputPackageItem };
                }
            }

            if (messageImportance == MessageImportance.High)
            {
                Log.LogError(singleLine);
                return;
            }

            if (singleLine.StartsWith("Issue:") || singleLine.StartsWith("Description:") || singleLine.StartsWith("Solution:"))
            {
                Log.LogWarning(singleLine);
                return;
            }

            base.LogEventsFromTextOutput(singleLine, messageImportance);
        }
开发者ID:kovalikp,项目名称:nuproj,代码行数:30,代码来源:NuGetPack.cs


示例3: LogCommentFromText

 /// <summary>
 /// Log a comment
 /// </summary>
 /// <param name="buildEventContext">Event context information which describes who is logging the event</param>
 /// <param name="importance">How important is the message, this will determine which verbosities the message will show up on. 
 /// The higher the importance the lower the verbosity needs to be for the message to be seen</param>
 /// <param name="message">Message to log</param>
 /// <exception cref="InternalErrorException">BuildEventContext is null</exception>
 /// <exception cref="InternalErrorException">Message is null</exception>
 public void LogCommentFromText(BuildEventContext buildEventContext, MessageImportance importance, string message)
 {
     lock (_lockObject)
     {
         this.LogCommentFromText(buildEventContext, importance, message, null);
     }
 }
开发者ID:JamesLinus,项目名称:msbuild,代码行数:16,代码来源:LoggingServiceLogMethods.cs


示例4: HandleMessage

 /// <summary>
 /// Handle a raised message. 
 /// </summary>
 /// <param name="message">
 /// The message.
 /// </param>
 /// <param name="importance">
 /// The importance.
 /// </param>
 public void HandleMessage(string message, MessageImportance importance = MessageImportance.Normal)
 {
     if (this.OutputMessage(importance))
     {
         NotificationWriter.Write(message);
     }
 }
开发者ID:Erls-Corporation,项目名称:Git-Source-Control-Provider,代码行数:16,代码来源:BuildNotificationLogger.cs


示例5: LogMessage

 protected void LogMessage(string message, MessageImportance importance = MessageImportance.High)
 {
     if (BuildEngine != null)
     {
         BuildEngine.LogMessageEvent(new BuildMessageEventArgs("CrmCross: " + message, "CrmCross", "CrmCross", importance));
     }
 }
开发者ID:syncromatics,项目名称:Xamarin.TestyDroid,代码行数:7,代码来源:AbstractTask.cs


示例6: BuildMessageEventArgs

 public BuildMessageEventArgs(string message,
     string helpKeyword,
     string senderName,
     MessageImportance importance)
     : base(message, helpKeyword, senderName)
 {
     this.importance = importance;
 }
开发者ID:Jedzia,项目名称:BackBock,代码行数:8,代码来源:BuildMessageEventArgs.cs


示例7: LogItemMetadata

 private static void LogItemMetadata(Task task, ITaskItem item, MessageImportance importance)
 {
     var metadata = item.CloneCustomMetadata();
     foreach (var name in metadata.Keys.Cast<string>())
     {
         LogMetadata(task, name, (string)metadata[name], importance);
     }
 }
开发者ID:JayBazuzi,项目名称:MSBuildTaskParameterLogger,代码行数:8,代码来源:LoggingTaskExtensions.cs


示例8: TaskCommandLineEventArgs

		public TaskCommandLineEventArgs (string commandLine,
						 string taskName,
						 MessageImportance importance)
			: base (commandLine, null, null, importance)
		{
			this.taskName = taskName;
			this.commandLine = commandLine;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:TaskCommandLineEventArgs.cs


示例9: OutputEventArgs

        /// <summary>
        /// Initializes a new instance of the OutputEventArgs class.
        /// </summary>
        /// <param name="text">The output text.</param>
        /// <param name="importance">The level of importance for this output event.</param>
        public OutputEventArgs(string text, MessageImportance importance)
        {
            Param.RequireNotNull(text, "text");
            Param.Ignore(importance);

            this.Output = text;
            this.Importance = importance;
        }
开发者ID:jonthegiant,项目名称:StyleCop,代码行数:13,代码来源:OutputEventArgs.cs


示例10: LogEventsFromTextOutput

        /// <summary>
        /// Parses a single line of text to identify any errors or warnings in canonical format.
        /// </summary>
        /// <param name="singleLine">A single line of text for the method to parse.</param>
        /// <param name="messageImportance">A value of <see cref="T:Microsoft.Build.Framework.MessageImportance"/> that indicates the importance level with which to log the message.</param>
        protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
        {
            bool isError = messageImportance == StandardErrorLoggingImportance;

            if (isError)
                base.LogEventsFromTextOutput(singleLine, messageImportance);
            else
                CommitHash = singleLine.Trim();
        }
开发者ID:kajanthan19,项目名称:TestProject,代码行数:14,代码来源:GitVersion.cs


示例11: LogInputs

        public static void LogInputs(this Task task, MessageImportance importance)
        {
            task.Log.LogMessage(importance, "Inputs:");

            foreach (var propertyInfo in GetInputProperties(task))
            {
                LogProperty(propertyInfo, importance, task);
            }
        }
开发者ID:JayBazuzi,项目名称:MSBuildTaskParameterLogger,代码行数:9,代码来源:LoggingTaskExtensions.cs


示例12: LogTaskItems

        private static void LogTaskItems(ITaskItem[] taskItems, string itemGroup, MessageImportance importance, Task task)
        {
            task.Log.LogMessage(importance, "  {0} =", itemGroup);

            foreach (var item in taskItems)
            {
                LogTaskItem(task, item, importance);
            }
        }
开发者ID:JayBazuzi,项目名称:MSBuildTaskParameterLogger,代码行数:9,代码来源:LoggingTaskExtensions.cs


示例13: LogEventsFromTextOutput

        protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
        {
            if ((Set == null || Set.Length == 0) && !String.IsNullOrWhiteSpace(singleLine) && !singleLine.StartsWith("WARNING", StringComparison.OrdinalIgnoreCase))
            {
                Value = singleLine;
            }

            base.LogEventsFromTextOutput(singleLine, messageImportance);
        }
开发者ID:CommonBuildToolset,项目名称:CBT.Modules,代码行数:9,代码来源:NuGetConfig.cs


示例14: LogEventsFromTextOutput

		/// <summary>
		/// Parse the output of the console and gets the Branch or Tag.
		/// </summary>
		/// <param name="singleLine">the line being parsed</param>
		/// <param name="messageImportance">message importance</param>
		protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
		{
			bool isError = messageImportance == StandardErrorLoggingImportance;

			if (isError)
				base.LogEventsFromTextOutput(singleLine, messageImportance);
			else if (IsBranchStatusLine(singleLine))
				Branch = ParseStatusLineOutput(singleLine);
		}
开发者ID:464884492,项目名称:msbuildtasks,代码行数:14,代码来源:GitBranch.cs


示例15: ConcurrentLoggingHelper

		public ConcurrentLoggingHelper (TaskLoggingHelper taskLog,
						StreamReader messageStream,
						MessageImportance messageImportance)
		{
			this.taskLog = taskLog;
			this.messageStream = messageStream;
			this.messageImportance = messageImportance;
			this.hasLoggedErrors = false;
		}
开发者ID:Profit0004,项目名称:mono,代码行数:9,代码来源:ConcurrentLoggingHelper.cs


示例16: LogEventsFromTextOutput

        protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
        {
            if (CommandVerbosity != CommandVerbosity.Detailed)
            {
                var match = SingleLineNuGetPackageRegex.Match(singleLine);

                if (match.Success)
                {
                    _packages.Add(new TaskItem($"{match.Groups["id"].Value}.{match.Groups["version"].Value}", new Dictionary<string, string>
                    {
                        {"Id", match.Groups["id"].Value},
                        {"Version", match.Groups["version"].Value},
                    }));
                }
            }
            else
            {
                if (_lastTaskItem == null)
                {
                    var match = MultiLineNuGetPackageIdRegex.Match(singleLine);

                    if (match.Success)
                    {
                        _lastTaskItem = new TaskItem(match.Groups["id"].Value, new Dictionary<string, string>
                        {
                            {"Id", match.Groups["id"].Value}
                        });
                    }
                }
                else
                {
                    if (String.Empty.Equals(singleLine))
                    {
                        _packages.Add(_lastTaskItem);

                        _lastTaskItem = null;
                    }
                    else
                    {
                        var match = MultiLineNuGetPackageVersionRegex.Match(singleLine);

                        if (match.Success)
                        {
                            _lastTaskItem.ItemSpec = $"{_lastTaskItem.ItemSpec}.{match.Groups["version"].Value}";
                            _lastTaskItem.SetMetadata("Version", match.Groups["version"].Value);
                        }
                        else
                        {
                            _lastTaskItem.SetMetadata("Description", singleLine.Trim());
                        }
                    }
                }
            }

            base.LogEventsFromTextOutput(singleLine, messageImportance);
        }
开发者ID:CommonBuildToolset,项目名称:CBT.Modules,代码行数:56,代码来源:NuGetList.cs


示例17: Log

        /// <summary>
        /// Logs the specified message.
        /// </summary>
        /// <param name="task">
        /// A task to provide actual logger.
        /// </param>
        /// <param name="message">
        /// Message.
        /// </param>
        /// <param name="messageImportance">
        /// Message importance.
        /// </param>
        public void Log(Task task, string message, MessageImportance messageImportance)
        {
            if (task == null)
                throw new ArgumentNullException("task");

            if (message == null)
                throw new ArgumentNullException("message");

            task.Log.LogMessageFromText(message, messageImportance);
        }
开发者ID:jwChung,项目名称:CIBuild,代码行数:22,代码来源:TaskLogger.cs


示例18: this

 /// <summary>
 /// Creates an instance of this class for the given task command line.
 /// </summary>
 /// <param name="commandLine">The command line used by a task to launch
 /// its underlying tool/executable.</param>
 /// <param name="taskName">The name of the task raising this event.</param>
 /// <param name="importance">Importance of command line -- controls whether
 /// the command line will be displayed by less verbose loggers.</param>
 public TaskCommandLineEventArgs
 (
     string commandLine,
     string taskName,
     MessageImportance importance
 )
     : this(commandLine, taskName, importance, DateTime.UtcNow)
 {
     // do nothing
 }
开发者ID:cameron314,项目名称:msbuild,代码行数:18,代码来源:TaskCommandLineEventArgs.cs


示例19: SelectStringBuilder

 private StringBuilder SelectStringBuilder(MessageImportance messageImportance)
 {
     switch (messageImportance)
     {
         case MessageImportance.High: return this._highImportanceStringBuilder;
         case MessageImportance.Normal: return this._normalImportanceStringBuilder;
         case MessageImportance.Low: return this._lowImportanceStringBuilder;
         default: throw new ArgumentOutOfRangeException("messageImportance");
     }
 }
开发者ID:JayBazuzi,项目名称:MSBuildTaskParameterLogger,代码行数:10,代码来源:HighImportanceStringLogger.cs


示例20: this

 /// <summary>
 /// This constuctor allows all event data to be initialized
 /// </summary>
 /// <param name="message">text message</param>
 /// <param name="helpKeyword">help keyword </param>
 /// <param name="senderName">name of event sender</param>
 /// <param name="importance">importance of the message</param>
 public BuildMessageEventArgs
 (
     string message,
     string helpKeyword,
     string senderName,
     MessageImportance importance
 )
     : this(message, helpKeyword, senderName, importance, DateTime.UtcNow)
 {
 }
开发者ID:JamesLinus,项目名称:msbuild,代码行数:17,代码来源:BuildMessageEventArgs.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MessageInfo类代码示例发布时间:2022-05-24
下一篇:
C# MessageHeaders类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap