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


C# Framework.TaskStartedEventArgs类代码示例

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


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

示例1: VerifyEventType

        public void VerifyEventType()
        {
            BuildFinishedEventArgs buildFinished = new BuildFinishedEventArgs("Message", "Keyword", true);
            BuildStartedEventArgs buildStarted = new BuildStartedEventArgs("Message", "Help");
            BuildMessageEventArgs lowMessage = new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low);
            TaskStartedEventArgs taskStarted = new TaskStartedEventArgs("message", "help", "projectFile", "taskFile", "taskName");
            TaskFinishedEventArgs taskFinished = new TaskFinishedEventArgs("message", "help", "projectFile", "taskFile", "taskName", true);
            TaskCommandLineEventArgs commandLine = new TaskCommandLineEventArgs("commandLine", "taskName", MessageImportance.Low);
            BuildWarningEventArgs warning = new BuildWarningEventArgs("SubCategoryForSchemaValidationErrors", "MSB4000", "file", 1, 2, 3, 4, "message", "help", "sender");
            BuildErrorEventArgs error = new BuildErrorEventArgs("SubCategoryForSchemaValidationErrors", "MSB4000", "file", 1, 2, 3, 4, "message", "help", "sender");
            TargetStartedEventArgs targetStarted = new TargetStartedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile");
            TargetFinishedEventArgs targetFinished = new TargetFinishedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile", true);
            ProjectStartedEventArgs projectStarted = new ProjectStartedEventArgs(-1, "message", "help", "ProjectFile", "targetNames", null, null, null);
            ProjectFinishedEventArgs projectFinished = new ProjectFinishedEventArgs("message", "help", "ProjectFile", true);
            ExternalProjectStartedEventArgs externalStartedEvent = new ExternalProjectStartedEventArgs("message", "help", "senderName", "projectFile", "targetNames");

            VerifyLoggingPacket(buildFinished, LoggingEventType.BuildFinishedEvent);
            VerifyLoggingPacket(buildStarted, LoggingEventType.BuildStartedEvent);
            VerifyLoggingPacket(lowMessage, LoggingEventType.BuildMessageEvent);
            VerifyLoggingPacket(taskStarted, LoggingEventType.TaskStartedEvent);
            VerifyLoggingPacket(taskFinished, LoggingEventType.TaskFinishedEvent);
            VerifyLoggingPacket(commandLine, LoggingEventType.TaskCommandLineEvent);
            VerifyLoggingPacket(warning, LoggingEventType.BuildWarningEvent);
            VerifyLoggingPacket(error, LoggingEventType.BuildErrorEvent);
            VerifyLoggingPacket(targetStarted, LoggingEventType.TargetStartedEvent);
            VerifyLoggingPacket(targetFinished, LoggingEventType.TargetFinishedEvent);
            VerifyLoggingPacket(projectStarted, LoggingEventType.ProjectStartedEvent);
            VerifyLoggingPacket(projectFinished, LoggingEventType.ProjectFinishedEvent);
            VerifyLoggingPacket(externalStartedEvent, LoggingEventType.CustomEvent);
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:30,代码来源:NodePackets_Tests.cs

示例2: Task

 /// <summary>
 /// Initializes a new instance of the <see cref="Task"/> class.
 /// </summary>
 /// <param name="name">The name of the task.</param>
 /// <param name="taskStartedEvent">The <see cref="TaskStartedEventArgs"/> instance containing the event data.</param>
 /// <param name="assembly">The assembly from which the task originated.</param>
 public Task(string name, TaskStartedEventArgs taskStartedEvent, string assembly)
 {
     Name = name;
     Id = taskStartedEvent.BuildEventContext.TaskId;
     StartTime = taskStartedEvent.Timestamp;
     _fromAssembly = assembly;
 }
开发者ID:cameron314,项目名称:msbuild,代码行数:13,代码来源:Task.cs

示例3: EventArgsCtors

 public void EventArgsCtors()
 {
     TaskStartedEventArgs taskStartedEvent = new TaskStartedEventArgs2();
     taskStartedEvent = new TaskStartedEventArgs("Message", "HelpKeyword", "ProjectFile", "TaskFile", "TaskName");
     taskStartedEvent = new TaskStartedEventArgs("Message", "HelpKeyword", "ProjectFile", "TaskFile", "TaskName", DateTime.Now);
     taskStartedEvent = new TaskStartedEventArgs(null, null, null, null, null);
     taskStartedEvent = new TaskStartedEventArgs(null, null, null, null, null, DateTime.Now);
 }
开发者ID:cameron314,项目名称:msbuild,代码行数:8,代码来源:TaskStartedEventArgs_Tests.cs

示例4: BuildMessage

 public BuildMessage(TaskStartedEventArgs args)
 {
     EventType = args.GetType().Name.Replace("EventArgs", "");
     Message = args.Message;
     ProjectFile = args.ProjectFile;
     TaskFile = args.TaskFile;
     TaskName = args.TaskName;
     HelpKeyword = args.HelpKeyword;
     SenderName = args.SenderName;
     Timestamp = args.Timestamp;
     ThreadId = args.ThreadId;
 }
开发者ID:perpetual-motion,项目名称:clrplus,代码行数:12,代码来源:Logger.cs

示例5: AssignmentTest

		public void AssignmentTest ()
		{
			TaskStartedEventArgs tsea;
			string message = "message";
			string helpKeyword = "helpKeyword";
			string projectFile = "projectFile";
			string taskFile = "taskFile";
			string taskName = "taskName";
			
			tsea = new TaskStartedEventArgs (message, helpKeyword, projectFile, taskFile, taskName);
			
			Assert.AreEqual (message, tsea.Message, "Message");
			Assert.AreEqual (helpKeyword, tsea.HelpKeyword, "HelpKeyword");
			Assert.AreEqual (projectFile, tsea.ProjectFile, "ProjectFile");
			Assert.AreEqual (taskFile, tsea.TaskFile, "TaskFile");
			Assert.AreEqual (taskName, tsea.TaskName, "TaskName");
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:17,代码来源:TaskStartedEventArgsTest.cs

示例6: eventSource_TaskStarted

 private void eventSource_TaskStarted(object sender, TaskStartedEventArgs e)
 {
     if (stop) {
         return;
     }
     Execute(new BuildMessage(e));
     if (stop) {
         KillThyself();
     }
 }
开发者ID:perpetual-motion,项目名称:clrplus,代码行数:10,代码来源:Logger.cs

示例7: TaskStartedHandler

 /// <summary>
 /// This is the delegate for TaskStartedHandler events.
 /// </summary>
 protected virtual void TaskStartedHandler(object sender, TaskStartedEventArgs buildEvent)
 {
     // NOTE: This may run on a background thread!
     QueueOutputEvent(MessageImportance.Low, buildEvent);
     IndentOutput();
 }
开发者ID:ChrisJamesSadler,项目名称:Cosmos,代码行数:9,代码来源:IDEBuildLogger.cs

示例8: TaskStarted

        void TaskStarted(object sender, TaskStartedEventArgs e)
        {
            buildTypeList.Push(BuildType.Task);

            XmlElement taskElemet = xmlDoc.CreateElement("Task");
            taskElements.Push(taskElemet);
            targetElements.Peek().AppendChild(taskElemet);

            taskElemet.Attributes.Append(CreateStartedAttribute(e.Timestamp));

            taskElemet.Attributes.Append(CreateAttribute("Name", e.TaskName));
        }
开发者ID:JustJenFelice,项目名称:sayed-samples,代码行数:12,代码来源:XmlLogger.cs

示例9: OnTaskStarted

			void OnTaskStarted(object sender, TaskStartedEventArgs e)
			{
				if (desc.taskname.Equals(e.TaskName, StringComparison.OrdinalIgnoreCase)) {
					CreateBaseLogger();
					if (baseLogger != null) {
						baseLogger.Initialize(eventSource);
						isActive = true;
					}
				}
			}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:10,代码来源:TaskBoundAdditionalLoggerDoozer.cs

示例10: TaskStarted

 private void TaskStarted(object sender, TaskStartedEventArgs e)
 {
     string line = string.Format(CultureInfo.InvariantCulture, "{0}", e.Message);
     this.WriteLine(line);
 }
开发者ID:simondmorias,项目名称:MSBuildExtensionPack,代码行数:5,代码来源:SecureFileLogger.cs

示例11: TaskStarted

 private void TaskStarted(object sender, TaskStartedEventArgs e)
 {
     this.LogStarted("task", e.TaskName, e.ProjectFile);
 }
开发者ID:hamidshahid,项目名称:MSBuildExtensionPack,代码行数:4,代码来源:XmlFileLogger.cs

示例12: RaiseTaskStartedEvent

        /// <summary>
        /// Raises a "task execution started" event to all registered loggers.
        /// </summary>
        /// <param name="sender">sender of the event</param>
        /// <param name="buildEvent">TaskStartedEventArgs</param>
        /// <exception cref="LoggerException">When EventHandler raises an logger exception the LoggerException is rethrown</exception>
        /// <exception cref="InternalLoggerException">Any exceptions which are not LoggerExceptions are wrapped in an InternalLoggerException</exception>
        /// <exception cref="Exception">ExceptionHandling.IsCriticalException exceptions will not be wrapped</exception>
        private void RaiseTaskStartedEvent(object sender, TaskStartedEventArgs buildEvent)
        {
            if (TaskStarted != null)
            {
                try
                {
                    TaskStarted(sender, buildEvent);
                }
                catch (LoggerException)
                {
                    // if a logger has failed politely, abort immediately
                    // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings
                    // if a fellow logger is throwing in an event handler.
                    this.UnregisterAllEventHandlers();
                    throw;
                }
                catch (Exception exception)
                {
                    // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings
                    // if a fellow logger is throwing in an event handler.
                    this.UnregisterAllEventHandlers();

                    if (ExceptionHandling.IsCriticalException(exception))
                    {
                        throw;
                    }

                    InternalLoggerException.Throw(exception, buildEvent, "FatalErrorWhileLogging", false);
                }
            }

            RaiseStatusEvent(sender, buildEvent);
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:41,代码来源:EventSourceSink.cs

示例13: TaskStartedHandler

        /// <summary>
        /// Handler for task started events
        /// </summary>
        /// <param name="sender">sender (should be null)</param>
        /// <param name="e">event arguments</param>
        public void TaskStartedHandler(object sender, TaskStartedEventArgs e)
        {
            InitializeBaseConsoleLogger(); // for compat: see DDB#136924

            _consoleLogger.TaskStartedHandler(sender, e);
        }
开发者ID:nikson,项目名称:msbuild,代码行数:11,代码来源:ConsoleLogger.cs

示例14: VerifyTaskStarted

 /// <summary>
 /// Compare two TaskStarted events
 /// </summary>
 private static void VerifyTaskStarted(TaskStartedEventArgs genericEvent, TaskStartedEventArgs newGenericEvent)
 {
     Assert.IsTrue(string.Compare(genericEvent.TaskFile, newGenericEvent.TaskFile, StringComparison.OrdinalIgnoreCase) == 0, "Expected TaskFile to Match");
     Assert.IsTrue(string.Compare(genericEvent.ProjectFile, newGenericEvent.ProjectFile, StringComparison.OrdinalIgnoreCase) == 0, "Expected ProjectFile to Match");
     Assert.IsTrue(string.Compare(genericEvent.TaskName, newGenericEvent.TaskName, StringComparison.OrdinalIgnoreCase) == 0, "Expected TaskName to Match");
 }
开发者ID:ChronosWS,项目名称:msbuild,代码行数:9,代码来源:CustomEventArgSerialization_Tests.cs

示例15: TestTaskStartedEventArgs

        public void TestTaskStartedEventArgs()
        {
            // Test using reasonable values
            TaskStartedEventArgs genericEvent = new TaskStartedEventArgs("Message", "HelpKeyword", "ProjectFile", "TaskFile", "TaskName");
            genericEvent.BuildEventContext = new BuildEventContext(5, 4, 3, 2);

            // Serialize
            genericEvent.WriteToStream(_writer);
            long streamWriteEndPosition = _stream.Position;

            // Deserialize and Verify
            _stream.Position = 0;
            TaskStartedEventArgs newGenericEvent = new TaskStartedEventArgs(null, null, null, null, null);
            newGenericEvent.CreateFromStream(_reader, _eventArgVersion);
            long streamReadEndPosition = _stream.Position;
            Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream End Positions Should Match");
            VerifyGenericEventArg(genericEvent, newGenericEvent);
            VerifyTaskStarted(genericEvent, newGenericEvent);

            _stream.Position = 0;
            // Make sure empty strings are passed correctly
            genericEvent = new TaskStartedEventArgs(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
            genericEvent.BuildEventContext = new BuildEventContext(5, 4, 3, 2);

            // Serialize
            genericEvent.WriteToStream(_writer);
            streamWriteEndPosition = _stream.Position;

            // Deserialize and Verify
            _stream.Position = 0;
            newGenericEvent = new TaskStartedEventArgs(null, null, null, null, null);
            newGenericEvent.CreateFromStream(_reader, _eventArgVersion);
            streamReadEndPosition = _stream.Position;
            Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream End Positions Should Match");
            VerifyGenericEventArg(genericEvent, newGenericEvent);
            VerifyTaskStarted(genericEvent, newGenericEvent);

            // Test using null strings
            _stream.Position = 0;
            // Make sure null string are passed correctly
            genericEvent = new TaskStartedEventArgs(null, null, null, null, null);
            genericEvent.BuildEventContext = null;

            // Serialize
            genericEvent.WriteToStream(_writer);
            streamWriteEndPosition = _stream.Position;

            // Deserialize and Verify
            _stream.Position = 0;
            newGenericEvent = new TaskStartedEventArgs("Something", "Something", "Something", "Something", "Something");
            newGenericEvent.CreateFromStream(_reader, _eventArgVersion);
            streamReadEndPosition = _stream.Position;
            Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream End Positions Should Match");
            VerifyGenericEventArg(genericEvent, newGenericEvent);
            VerifyTaskStarted(genericEvent, newGenericEvent);
        }
开发者ID:ChronosWS,项目名称:msbuild,代码行数:56,代码来源:CustomEventArgSerialization_Tests.cs


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