當前位置: 首頁>>代碼示例>>C#>>正文


C# Framework.TargetStartedEventArgs類代碼示例

本文整理匯總了C#中Microsoft.Build.Framework.TargetStartedEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# TargetStartedEventArgs類的具體用法?C# TargetStartedEventArgs怎麽用?C# TargetStartedEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TargetStartedEventArgs類屬於Microsoft.Build.Framework命名空間,在下文中一共展示了TargetStartedEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: eventSource_TargetStarted

 void eventSource_TargetStarted(object sender, TargetStartedEventArgs e)
 {
     if (Verbosity == LoggerVerbosity.Detailed)
     {
         Console.WriteLine("Target Started: " + e.TargetName);
     }
 }
開發者ID:terryjintry,項目名稱:OLSource1,代碼行數:7,代碼來源:build-loggers_4.cs

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

示例3: EventArgsCtors

 public void EventArgsCtors()
 {
     TargetStartedEventArgs targetStartedEvent = new TargetStartedEventArgs2();
     targetStartedEvent = new TargetStartedEventArgs("Message", "HelpKeyword", "TargetName", "ProjectFile", "TargetFile");
     targetStartedEvent = new TargetStartedEventArgs("Message", "HelpKeyword", "TargetName", "ProjectFile", "TargetFile", "ParentTarget", DateTime.Now);
     targetStartedEvent = new TargetStartedEventArgs(null, null, null, null, null);
     targetStartedEvent = new TargetStartedEventArgs(null, null, null, null, null, null, DateTime.Now);
 }
開發者ID:ChronosWS,項目名稱:msbuild,代碼行數:8,代碼來源:TargetStartedEventArgs_Tests.cs

示例4: eventSource_TargetStarted

 public void eventSource_TargetStarted(object sender, TargetStartedEventArgs e)
 {
     if(e.TargetName.Equals("IceBuilder_Compile") ||IsVerbosityAtLeast(LoggerVerbosity.Detailed))
     {
         WriteMessage(String.Format("{0}:", e.TargetName));
     }
     Indent += IndentLevel;
 }
開發者ID:alux-xu,項目名稱:ice-builder-visualstudio,代碼行數:8,代碼來源:BuildLogger.cs

示例5: AddTarget

        /// <summary>
        /// Adds a new target node to the project.
        /// </summary>
        /// <param name="targetStartedEventArgs">The <see cref="TargetStartedEventArgs"/> instance containing the event data.</param>
        public void AddTarget(TargetStartedEventArgs targetStartedEventArgs)
        {
            var target = GetOrAddTargetByName(targetStartedEventArgs.TargetName, targetStartedEventArgs);

            if (!string.IsNullOrEmpty(targetStartedEventArgs.ParentTarget))
            {
                var parentTarget = GetOrAddTargetByName(targetStartedEventArgs.ParentTarget);
                parentTarget.AddChildTarget(target);
            }
            else
            {
                AddChildNode(target);
            }
        }
開發者ID:cameron314,項目名稱:msbuild,代碼行數:18,代碼來源:Project.cs

示例6: AssignmentTest

		public void AssignmentTest ()
		{
			TargetStartedEventArgs tsea;
			string message = "message";
			string helpKeyword = "helpKeyword";
			string targetName = "targetName";
			string projectFile = "projectFile";
			string targetFile = "targetFile";
			
			tsea = new TargetStartedEventArgs (message, helpKeyword, targetName, projectFile, targetFile);
			
			Assert.AreEqual (message, tsea.Message, "Message");
			Assert.AreEqual (helpKeyword, tsea.HelpKeyword, "HelpKeyword");
			Assert.AreEqual (targetName, tsea.TargetName, "TargetName");
			Assert.AreEqual (projectFile, tsea.ProjectFile, "ProjectFile");
			Assert.AreEqual (targetFile, tsea.TargetFile, "TargetFile");
		}
開發者ID:KonajuGames,項目名稱:SharpLang,代碼行數:17,代碼來源:TargetStartedEventArgsTest.cs

示例7: eventSource_TargetStarted

		void eventSource_TargetStarted(object sender, TargetStartedEventArgs e)
		{
			if (_output == null || String.IsNullOrEmpty(e.ProjectFile) || e.ProjectFile == _current) 
				return;

			CloseTarget();

			_current = e.ProjectFile;
			_output.WriteStartElement("project");

			string filename = e.ProjectFile;
			_output.WriteAttributeString("file", Path.GetFileName(filename));
			_output.WriteAttributeString("location", Path.GetDirectoryName(filename));
			
			if(!String.IsNullOrEmpty(e.TargetFile) )
				_output.WriteAttributeString("target", e.TargetFile);
		}
開發者ID:hivie7510,項目名稱:csharptest-net,代碼行數:17,代碼來源:XmlLogger.cs

示例8: BuildMessage

 public BuildMessage(TargetStartedEventArgs args)
 {
     EventType = args.GetType().Name.Replace("EventArgs", "");
     Message = args.Message;
     ParentTarget = args.ParentTarget;
     ProjectFile = args.ProjectFile;
     TargetFile = args.TargetFile;
     TargetName = args.TargetName;
     HelpKeyword = args.HelpKeyword;
     SenderName = args.SenderName;
     Timestamp = args.Timestamp;
     ThreadId = args.ThreadId;
 }
開發者ID:perpetual-motion,項目名稱:clrplus,代碼行數:13,代碼來源:Logger.cs

示例9: IsEquivalent

        /// <summary>
        /// Compare this build event context with another object to determine 
        /// equality. This means the values inside the object are identical.
        /// </summary>
        /// <param name="obj">Object to compare to this object</param>
        /// <returns>True if the object values are identical, false if they are not identical</returns>
        public static bool IsEquivalent(TargetStartedEventArgs args, TargetStartedEventArgs other)
        {
            if (!String.Equals(args.ProjectFile, other.ProjectFile, StringComparison.OrdinalIgnoreCase))
            {
                return false;
            }

            if (!String.Equals(args.TargetFile, other.TargetFile, StringComparison.OrdinalIgnoreCase))
            {
                return false;
            }

            if (!String.Equals(args.TargetName, other.TargetName, StringComparison.OrdinalIgnoreCase))
            {
                return false;
            }

            if (!String.Equals(args.ParentTarget, other.ParentTarget, StringComparison.OrdinalIgnoreCase))
            {
                return false;
            }
            return ((BuildEventArgs)args).IsEquivalent(other);
        }
開發者ID:JamesLinus,項目名稱:msbuild,代碼行數:29,代碼來源:BuildEventArgsExtension.cs

示例10: eventSource_TargetStarted

 private void eventSource_TargetStarted(object sender, TargetStartedEventArgs e)
 {
     if (stop) {
         return;
     }
     Execute(new BuildMessage(e));
     if (stop) {
         KillThyself();
     }
 }
開發者ID:perpetual-motion,項目名稱:clrplus,代碼行數:10,代碼來源:Logger.cs

示例11: TryUpdate

 /// <summary>
 /// Try to update the target data given a target started event. This is useful if the project
 /// was created (e.g. as a parent) before we saw the started event.
 /// </summary>
 /// <remarks>Does nothing if the data has already been set or the new data is null.</remarks>
 /// <param name="e">The <see cref="TargetStartedEventArgs"/> instance containing the event data.</param>
 public void TryUpdate(TargetStartedEventArgs e)
 {
     if (Id < 0 && e != null)
     {
         // = e.Timestamp;
         Id = e.BuildEventContext.TargetId;
     }
 }
開發者ID:cameron314,項目名稱:msbuild,代碼行數:14,代碼來源:Target.cs

示例12: LogTargetStarted

		void LogTargetStarted (Target target)
		{
			TargetStartedEventArgs tsea;
			string projectFile = project.FullFileName;
			tsea = new TargetStartedEventArgs (String.Format ("Target {0} started.", target.Name), null,
					target.Name, projectFile, target.TargetFile);
			target.Engine.EventSource.FireTargetStarted (this, tsea);
		}
開發者ID:REALTOBIZ,項目名稱:mono,代碼行數:8,代碼來源:TargetBatchingImpl.cs

示例13: eventSource_TargetStartedHandler

		private void eventSource_TargetStartedHandler(object sender, TargetStartedEventArgs e)
		{
            LogStageStarted(XmlLoggerElements.Target, e.TargetName, "", e.Timestamp);
		}
開發者ID:jlewin,項目名稱:Kobush.Build,代碼行數:4,代碼來源:XmlLogger.cs

示例14: TargetStartedHandler

 /// <summary>
 /// This is the delegate for TargetStartedHandler events.
 /// </summary>
 private void TargetStartedHandler(object sender, TargetStartedEventArgs buildEvent)
 {
     if (LogAtImportance(MessageImportance.Normal))
     {
         LogEvent(sender, buildEvent);
     }
     ++this.currentIndent;
 }
開發者ID:Jeremiahf,項目名稱:wix3,代碼行數:11,代碼來源:idebuildlogger.cs

示例15: onTargetStarted

        protected void onTargetStarted(object sender, TargetStartedEventArgs e)
        {
            if(!projects.ContainsKey(e.BuildEventContext.ProjectInstanceId)) {
                return;
            }

            switch(e.TargetName) {
                case "PreBuildEvent": {
                    library.Event.onProjectPre(projects[e.BuildEventContext.ProjectInstanceId].Name);
                    break;
                }
                case "PostBuildEvent": {
                    Project p = projects[e.BuildEventContext.ProjectInstanceId];
                    library.Event.onProjectPost(p.Name, p.HasErrors ? 0 : 1);
                    break;
                }
            }
        }
開發者ID:hilbertdu,項目名稱:vsSolutionBuildEvent,代碼行數:18,代碼來源:EventManager.cs


注:本文中的Microsoft.Build.Framework.TargetStartedEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。