public TargetChildDescriptor(ProjectTargetInstanceChild child)
 {
     _child = child;
 }
예제 #2
0
        /// <summary>
        /// Constructs a task logging context from a parent target context and a task node.
        /// </summary>
        internal TaskLoggingContext(TargetLoggingContext targetLoggingContext, string projectFullPath, ProjectTargetInstanceChild task)
            : base(targetLoggingContext)
        {
            _targetLoggingContext = targetLoggingContext;
            _task = task;

            ProjectTaskInstance taskInstance = task as ProjectTaskInstance;

            if (taskInstance != null)
            {
                _taskName = taskInstance.Name;
            }
            else
            {
                ProjectPropertyGroupTaskInstance propertyGroupInstance = task as ProjectPropertyGroupTaskInstance;
                if (propertyGroupInstance != null)
                {
                    _taskName = "PropertyGroup";
                }
                else
                {
                    ProjectItemGroupTaskInstance itemGroupInstance = task as ProjectItemGroupTaskInstance;
                    if (itemGroupInstance != null)
                    {
                        _taskName = "ItemGroup";
                    }
                    else
                    {
                        _taskName = "Unknown";
                    }
                }
            }

            this.BuildEventContext = LoggingService.LogTaskStarted2
                                     (
                targetLoggingContext.BuildEventContext,
                _taskName,
                projectFullPath,
                task.Location.File
                                     );
            this.IsValid = true;
        }
 public static IllegalProjectFileElement FromElement(ProjectTargetInstanceChild targetChild)
 {
     return(new IllegalProjectFileElement(new TargetChildDescriptor(targetChild)));
 }