ProjectStatus.cs :  » Build-Systems » CruiseControl.NET » ThoughtWorks » CruiseControl » Remote » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Build Systems » CruiseControl.NET 
CruiseControl.NET » ThoughtWorks » CruiseControl » Remote » ProjectStatus.cs
using System;
using System.Xml.Serialization;

namespace ThoughtWorks.CruiseControl.Remote{
  /// <summary>
  /// Value type that contains extensive details about a project's most recent
  /// integration.
  /// </summary>
  /// <remarks>
  /// This class is serialized to persist CruiseControl.NET's state for a
  /// particular project, hence is is marked with a <see cref="SerializableAttribute"/>.
  /// </remarks>
  [Serializable]
    [XmlRoot("projectStatus")]
  public class ProjectStatus
  {
    private ProjectIntegratorState status;
    private IntegrationStatus buildStatus;
    private ProjectActivity activity = ProjectActivity.Sleeping;
    private string name;
    private string category;
    private string webURL;
    private SerializableDateTime lastBuildDate = SerializableDateTime.Default;
    private string lastBuildLabel;
    private string lastSuccessfulBuildLabel;
    private SerializableDateTime nextBuildTime = SerializableDateTime.Default;
        private string currentBuildStage;
        private string _serverName = Environment.MachineName;       // Store the machine name that this project is running on
        private Message[] messages = new Message[0];
        private string queue;
        private int queuePriority;

        /// <summary>
        /// Initialises a new blank <see cref="ProjectStatus"/>.
        /// </summary>
    public ProjectStatus()
    {}

        /// <summary>
        /// Initialise a new populated <see cref="ProjectStatus"/>.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="buildStatus"></param>
        /// <param name="lastBuildDate"></param>
    public ProjectStatus(string name, IntegrationStatus buildStatus, DateTime lastBuildDate)
    {
      this.name = name;
      this.buildStatus = buildStatus;
      this.lastBuildDate = new SerializableDateTime(lastBuildDate);
    }

        /// <summary>
        /// Initialise a new populated <see cref="ProjectStatus"/>.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="category"></param>
        /// <param name="activity"></param>
        /// <param name="buildStatus"></param>
        /// <param name="status"></param>
        /// <param name="webURL"></param>
        /// <param name="lastBuildDate"></param>
        /// <param name="lastBuildLabel"></param>
        /// <param name="lastSuccessfulBuildLabel"></param>
        /// <param name="nextBuildTime"></param>
        /// <param name="buildStage"></param>
        /// <param name="queue"></param>
        /// <param name="queuePriority"></param>
        public ProjectStatus(string name, string category, ProjectActivity activity, IntegrationStatus buildStatus, ProjectIntegratorState status, string webURL, DateTime lastBuildDate, string lastBuildLabel, string lastSuccessfulBuildLabel, DateTime nextBuildTime, string buildStage, string queue, int queuePriority)
    {
      this.status = status;
      this.buildStatus = buildStatus;
      this.activity = activity;
      this.name = name;
      this.category = category;
      this.webURL = webURL;
      this.lastBuildDate = new SerializableDateTime(lastBuildDate);
      this.lastBuildLabel = lastBuildLabel;
      this.lastSuccessfulBuildLabel = lastSuccessfulBuildLabel;
      this.nextBuildTime = new SerializableDateTime(nextBuildTime);
            this.currentBuildStage = buildStage;
            this.queue = queue;
            this.queuePriority = queuePriority;
    }

        /// <summary>
        /// The current stage of the build.
        /// </summary>
        [XmlAttribute("stage")]
        public string BuildStage
        {
            get { return currentBuildStage; }
            set { currentBuildStage = value; }
        }

        /// <summary>
        /// The name of the server this status is from.
        /// </summary>
        [XmlAttribute("serverName")]
        public string ServerName
        {
            get { return _serverName; }
            set { _serverName = value; }
        }

        /// <summary>
        /// The current status of the project.
        /// </summary>
        [XmlAttribute("status")]
    public ProjectIntegratorState Status
    {
      get { return status; }
            set { status = value; }
    }

        /// <summary>
        /// The current integration status.
        /// </summary>
        [XmlAttribute("buildStatus")]
    public IntegrationStatus BuildStatus
    {
      get { return buildStatus; }
            set { buildStatus = value; }
    }

        /// <summary>
        /// The current project activity.
        /// </summary>
        [XmlElement("activity")]
    public ProjectActivity Activity
    {
      get { return activity; }
            set { activity = value; }
    }

        /// <summary>
        /// The name of the project.
        /// </summary>
        [XmlAttribute("name")]
    public string Name
    {
      get { return name; }
            set { name = value; }
    }

        /// <summary>
        /// The description of the project (optional).
        /// </summary>
        [XmlAttribute("description")]
        public string Description { get; set; }

        /// <summary>
        /// The category of the project.
        /// </summary>
        [XmlAttribute("category")]
    public string Category
    {
      get { return category; }
            set { category = value; }
    }

        /// <summary>
        /// The name of the queue that the project belongs to.
        /// </summary>
        [XmlAttribute("queueName")]
        public string Queue
        {
            get { return this.queue; }
            set { this.queue = value; }
        }

        /// <summary>
        /// The project of this project within the queue.
        /// </summary>
        [XmlAttribute("queuePriority")]
        public int QueuePriority
        {
            get { return this.queuePriority; }
            set { this.queuePriority = value; }
        }

        /// <summary>
        /// The URL for viewing the project details.
        /// </summary>
        [XmlAttribute("url")]
        public string WebURL
    {
      get { return webURL; }
            set { webURL = value; }
    }

        /// <summary>
        /// The date the project last built.
        /// </summary>
        [XmlAttribute("lastBuildDate")]
    public DateTime LastBuildDate
    {
      get { return lastBuildDate.DateTime; }
            set { lastBuildDate = new SerializableDateTime(value); }
    }

        /// <summary>
        /// The label of the last build.
        /// </summary>
        [XmlAttribute("lastBuildLabel")]
    public string LastBuildLabel
    {
      get { return lastBuildLabel; }
            set { lastBuildLabel = value; }
    }

        /// <summary>
        /// The label of the last successful build.
        /// </summary>
        [XmlAttribute("lastSuccessfulBuildLabel")]
    public string LastSuccessfulBuildLabel
    {
      get { return lastSuccessfulBuildLabel; }
            set { lastSuccessfulBuildLabel = value; }
    }

        /// <summary>
        /// The time the build will next be checked.
        /// </summary>
        [XmlAttribute("nextBuildTime")]
    public DateTime NextBuildTime
    {
      get { return nextBuildTime.DateTime; }
            set { nextBuildTime = new SerializableDateTime(value); }
    }

        /// <summary>
        /// Any messages for a build.
        /// </summary>
        [XmlElement("message")]
        public Message[] Messages
        {
            get { return messages ?? new Message[0]; }
            set { messages = value; }
        }
    
        /// <summary>
        /// The most current message in the build.
        /// </summary>
        [XmlIgnore]
    public string CurrentMessage
    {
      get
      {
        if (Messages.Length > 0) return Messages[Messages.Length-1].ToString();
        return string.Empty;
      }
    }
  }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.