public void OnProjectFinished(string projectFile, bool succeeded, string message = null, string helpKeyword = null)
        {
            ProjectFinishedEventArgs args = new ProjectFinishedEventArgs(message, helpKeyword, projectFile, succeeded);

            ProjectFinished?.Invoke(this, args);
            OnAnyEventRaised(args);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Raise one of the events that is appropriate for the type of the BuildEventArgs
        /// </summary>
        public void Dispatch(BuildEventArgs buildEvent)
        {
            if (buildEvent is BuildMessageEventArgs)
            {
                MessageRaised?.Invoke(null, (BuildMessageEventArgs)buildEvent);
            }
            else if (buildEvent is TaskStartedEventArgs)
            {
                TaskStarted?.Invoke(null, (TaskStartedEventArgs)buildEvent);
            }
            else if (buildEvent is TaskFinishedEventArgs)
            {
                TaskFinished?.Invoke(null, (TaskFinishedEventArgs)buildEvent);
            }
            else if (buildEvent is TargetStartedEventArgs)
            {
                TargetStarted?.Invoke(null, (TargetStartedEventArgs)buildEvent);
            }
            else if (buildEvent is TargetFinishedEventArgs)
            {
                TargetFinished?.Invoke(null, (TargetFinishedEventArgs)buildEvent);
            }
            else if (buildEvent is ProjectStartedEventArgs)
            {
                ProjectStarted?.Invoke(null, (ProjectStartedEventArgs)buildEvent);
            }
            else if (buildEvent is ProjectFinishedEventArgs)
            {
                ProjectFinished?.Invoke(null, (ProjectFinishedEventArgs)buildEvent);
            }
            else if (buildEvent is BuildStartedEventArgs)
            {
                BuildStarted?.Invoke(null, (BuildStartedEventArgs)buildEvent);
            }
            else if (buildEvent is BuildFinishedEventArgs)
            {
                BuildFinished?.Invoke(null, (BuildFinishedEventArgs)buildEvent);
            }
            else if (buildEvent is CustomBuildEventArgs)
            {
                CustomEventRaised?.Invoke(null, (CustomBuildEventArgs)buildEvent);
            }
            else if (buildEvent is BuildStatusEventArgs)
            {
                StatusEventRaised?.Invoke(null, (BuildStatusEventArgs)buildEvent);
            }
            else if (buildEvent is BuildWarningEventArgs)
            {
                WarningRaised?.Invoke(null, (BuildWarningEventArgs)buildEvent);
            }
            else if (buildEvent is BuildErrorEventArgs)
            {
                ErrorRaised?.Invoke(null, (BuildErrorEventArgs)buildEvent);
            }

            AnyEventRaised?.Invoke(null, buildEvent);
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ProjectFinished = await _context.ProjectFinished.FirstOrDefaultAsync(m => m.ID == id);

            if (ProjectFinished == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> OnPostAsync(int?id, Boolean Positive, String Comment)
        {
            if (id == null)
            {
                return(NotFound());
            }
            Feedback Feedback = new Feedback();

            Feedback.Positive = Positive;
            Feedback.Comment  = Comment;

            Projects = await _context.ProjectAssigned
                       .Include(e => e.Technician)
                       .Include(d => d.Client).ToListAsync();

            Projects = Projects.Where(s => s.ID.Equals(id)).ToList();;

            Project = Projects[0];

            if (!ModelState.IsValid)
            {
                return(Page());
            }

            if (Project != null)
            {
                _context.Feedback.Add(Feedback);

                ProjectFinished NewProject = new ProjectFinished();
                NewProject.ID          = Project.ID;
                NewProject.Specialty   = Project.Specialty;
                NewProject.Level       = Project.Level;
                NewProject.Description = Project.Description;
                NewProject.NHours      = Project.NHours;
                NewProject.Technician  = Project.Technician;
                NewProject.Client      = Project.Client;
                NewProject.Feedback    = Feedback;

                _context.ProjectAssigned.Remove(Project);
                _context.ProjectFinished.Add(NewProject);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Ejemplo n.º 5
0
        public void FeedbackTest()
        {
            Feedback        feed  = new Feedback();
            ProjectFinished proj2 = new ProjectFinished();

            int    id  = 3;
            bool   pos = true;
            string com = "Buen Trabajo";

            feed.ID       = id;
            feed.Comment  = com;
            feed.Positive = pos;

            proj2.Feedback = feed;


            Assert.Equal(feed, proj2.Feedback);
        }
Ejemplo n.º 6
0
 internal void RaiseProjectFinished()
 {
     ProjectFinished?.Invoke(this, EventArgs.Empty);
 }
Ejemplo n.º 7
0
 private void EventSourceOnProjectFinished(object sender, ProjectFinishedEventArgs e)
 {
     ProjectFinished?.Invoke(sender, e);
 }