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);
 }
예제 #2
0
        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);
        }
        private BuildEventArgs ReadTargetStartedEventArgs()
        {
            var fields       = ReadBuildEventArgsFields();
            var targetName   = ReadOptionalString();
            var projectFile  = ReadOptionalString();
            var targetFile   = ReadOptionalString();
            var parentTarget = ReadOptionalString();
            // BuildReason was introduced in version 4
            var buildReason = fileFormatVersion > 3 ? (TargetBuiltReason)ReadInt32() : TargetBuiltReason.None;

            var e = new TargetStartedEventArgs2(
                fields.Message,
                fields.HelpKeyword,
                targetName,
                projectFile,
                targetFile,
                parentTarget,
                buildReason,
                fields.Timestamp);

            SetCommonFields(e, fields);
            return(e);
        }