Ejemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="issueData"></param>
        internal Issue(MantisConnectWebservice.IssueData issueData)
        {
            this.Id = Convert.ToInt32(issueData.id);
            this.Project = new ObjectRef(issueData.project);
            this.Category = new ObjectRef(issueData.category);
            this.Summary = issueData.summary;
            this.Description = issueData.description;
            this.StepsToReproduce = issueData.steps_to_reproduce == null ? String.Empty : issueData.steps_to_reproduce;
            this.AdditionalInformation = issueData.additional_information == null ? String.Empty : issueData.additional_information;
            this.AssignedTo = issueData.handler == null ? null : new User(issueData.handler);
            this.ReportedBy = new User(issueData.reporter);
            this.ProductVersion = issueData.version == null ? String.Empty : issueData.version;
            this.ProductBuild = issueData.build == null ? String.Empty : issueData.build;
            this.Os = issueData.os == null ? String.Empty : issueData.os;
            this.OsBuild = issueData.os_build == null ? String.Empty : issueData.os_build;
            this.Platform = issueData.platform == null ? String.Empty : issueData.platform;
            this.FixedInVersion = issueData.fixed_in_version == null ? String.Empty : issueData.fixed_in_version;
            this.SponsorshipTotal = Convert.ToInt32(issueData.sponsorship_total);
            this.Reproducibility = new ObjectRef(issueData.reproducibility);
            this.Resolution = new ObjectRef(issueData.resolution);
            this.Eta = new ObjectRef(issueData.eta);
            this.Status = new ObjectRef(issueData.status);
            this.Priority = new ObjectRef(issueData.priority);
            this.Severity = new ObjectRef(issueData.severity);
            this.Projection = new ObjectRef(issueData.projection);
            this.ViewState = new ObjectRef(issueData.view_state);

            this.Notes = IssueNote.ConvertArray(issueData.notes);
            this.Attachments = Attachment.ConvertArray(issueData.attachments);
            this.Relationships = IssueRelationship.ConvertArray(issueData.relationships);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="accountData"></param>
 internal User(MantisConnectWebservice.AccountData accountData)
 {
     this.Id = Convert.ToInt32(accountData.id);
     this.Name = accountData.name;
     this.RealName = accountData.real_name;
     this.Email = accountData.email;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectVersion"/> class.
        /// </summary>
        /// <param name="projectVersionData">Project version data.</param>
		internal ProjectVersion(MantisConnectWebservice.ProjectVersionData projectVersionData)
		{
			this.Id = Convert.ToInt32(projectVersionData.id);
			this.Name = projectVersionData.name;
			this.ProjectId = Convert.ToInt32(projectVersionData.project_id);
			this.DateOrder = projectVersionData.date_order;
			this.Description = projectVersionData.description;
			this.IsReleased = projectVersionData.released;
		}
Ejemplo n.º 4
0
		/// <summary>
		/// A constructs that creates an <see cref="IssueNote"/> from the corresponding 
		/// type in the webservice proxy.
		/// </summary>
		/// <param name="issueNoteData">The type defined by the webservice proxy for issue notes.</param>
		internal IssueNote(MantisConnectWebservice.IssueNoteData issueNoteData)
		{
			this.Id = Convert.ToInt32(issueNoteData.id);
			this.Author = new User(issueNoteData.reporter);
			this.Text = StringUtils.WebserviceMultilineToNative(issueNoteData.text);
			this.ViewState = new ObjectRef(issueNoteData.view_state);
			this.DateSubmitted = issueNoteData.date_submitted;
			this.LastModified = issueNoteData.last_modified;
		}
Ejemplo n.º 5
0
        /// <summary>
		/// Constructor
		/// </summary>
		/// <param name="filterData">The filter data stored in the webservice proxy data type.</param>
		internal Filter(MantisConnectWebservice.FilterData filterData)
		{
			this.id = Convert.ToInt32(filterData.id);
			this.owner = new User(filterData.owner);
			this.projectId = Convert.ToInt32(filterData.project_id);
			this.isPublic = filterData.is_public;
			this.name = filterData.name;
			this.filterString = filterData.filter_string;
		}
Ejemplo n.º 6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="attachmentData"></param>
 internal Attachment( MantisConnectWebservice.AttachmentData attachmentData )
 {
     this.id = Convert.ToInt32( attachmentData.id );
     this.fileName = attachmentData.filename;
     this.size = Convert.ToInt32( attachmentData.size );
     this.contentType = attachmentData.content_type;
     this.dateSubmitted = attachmentData.date_submitted;
     this.downloadUrl = attachmentData.download_url;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Constructor to create a project from the web service project data.
 /// </summary>
 /// <param name="projectData">An instance returned by the webservice.</param>
 internal Project(MantisConnectWebservice.ProjectData projectData)
 {
     this.Id = Convert.ToInt32(projectData.id);
     this.Name = projectData.name;
     this.Status = new ObjectRef(projectData.status);
     this.Enabled = projectData.enabled;
     this.ViewState = new ObjectRef(projectData.view_state);
     this.AccessMin = new ObjectRef(projectData.access_min);
     this.FilePath = projectData.file_path;
     this.Description = projectData.description;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Constructor from webservice object ref object.
 /// </summary>
 /// <param name="objRefFromWs">Object reference from webservice</param>
 public ObjectRef(MantisConnectWebservice.ObjectRef objRefFromWs)
 {
     if (objRefFromWs != null)
     {
         this.Id = Convert.ToInt32(objRefFromWs.id);
         this.Name = objRefFromWs.name;
     }
     else
     {
         this.Id = 0;
         this.Name = string.Empty;
     }
 }
        /// <summary>
        /// Converts an array of relationships from webservice proxy type to this type.
        /// </summary>
        /// <param name="relationshipsData">Relationships data.</param>
        /// <returns>An array of relationships in this type.</returns>
		internal static IssueRelationship[] ConvertArray(MantisConnectWebservice.RelationshipData[] relationshipsData)
		{
            if (relationshipsData == null)
            {
                return null;
            }

			IssueRelationship[] relationships = new IssueRelationship[relationshipsData.Length];

            for (int i = 0; i < relationshipsData.Length; ++i)
            {
                relationships[i] = new IssueRelationship(relationshipsData[i]);
            }

			return relationships;
		}
Ejemplo n.º 10
0
		/// <summary>
		/// Converts an array of filters from webservice data type to instances of <see cref="Filter"/> class.
		/// </summary>
		/// <param name="filtersData">An array of filters stored in webservice proxy data type.</param>
		/// <returns>An array of <see cref="Filter"/> instances.</returns>
		internal static Filter[] ConvertArray(MantisConnectWebservice.FilterData[] filtersData)
		{
            if (filtersData == null)
            {
                return null;
            }

			Filter[] filters = new Filter[filtersData.Length];

            for (int i = 0; i < filtersData.Length; ++i)
            {
                filters[i] = new Filter(filtersData[i]);
            }

			return filters;
		}
Ejemplo n.º 11
0
		/// <summary>
		/// A static method that converts an array of attachments from the webservice type
		/// to this instances of this class.
		/// </summary>
		/// <param name="attachmentData">An array of attachments in webservice data type</param>
		/// <returns>Array of Attachment instances.</returns>
		internal static Attachment[] ConvertArray(MantisConnectWebservice.AttachmentData[] attachmentData)
		{
			if (attachmentData == null)
			{
				return new Attachment[0];
			}

			Attachment[] attachments = new Attachment[attachmentData.Length];

            for (int i = 0; i < attachmentData.Length; ++i)
            {
                attachments[i] = new Attachment(attachmentData[i]);
            }

			return attachments;
		}
Ejemplo n.º 12
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="attachmentData"></param>
        /// <returns></returns>
        internal static Attachment[] ConvertArray( MantisConnectWebservice.AttachmentData[] attachmentData )
        {
            Attachment[] attachments = new Attachment[attachmentData.Length];

            for ( int i = 0; i < attachmentData.Length; ++i )
                attachments[i] = new Attachment( attachmentData[i] );

            return attachments;
        }
Ejemplo n.º 13
0
		/// <summary>
		/// A static method that converts an array of issue notes from webservice proxy format
		/// to an array of <see cref="IssueNote"/>
		/// </summary>
		/// <param name="issueNotesData">An array of issue notes in webservice proxy format.</param>
		/// <returns>An array of <see cref="IssueNote"/>.</returns>
		internal static IssueNote[] ConvertArray(MantisConnectWebservice.IssueNoteData[] issueNotesData)
		{
            if (issueNotesData == null)
            {
                return new IssueNote[0];
            }

			IssueNote[] notes = new IssueNote[issueNotesData.Length];

            for (int i = 0; i < issueNotesData.Length; ++i)
            {
                notes[i] = new IssueNote(issueNotesData[i]);
            }

			return notes;
		}
Ejemplo n.º 14
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="issuesData"></param>
        /// <returns></returns>
        internal static Issue[] ConvertArray(MantisConnectWebservice.IssueData[] issuesData)
        {
            if (issuesData == null)
                return null;

            Issue[] issues = new Issue[issuesData.Length];

            for (int i = 0; i < issuesData.Length; ++i)
                issues[i] = new Issue(issuesData[i]);

            return issues;
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Converts an array of projects from webservice type to this type.
        /// </summary>
        /// <param name="projectData">Project data.</param>
        /// <returns>An array of projects in this class type.</returns>
		internal static Project[] ConvertArray( MantisConnectWebservice.ProjectData[] projectData )
		{
            if (projectData == null)
            {
                return null;
            }

			Project[] projects = new Project[projectData.Length];

            for (int i = 0; i < projectData.Length; ++i)
            {
                projects[i] = new Project(projectData[i]);
            }

			return projects;
		}
Ejemplo n.º 16
0
        /// <summary>
        /// Converts an array of project versions from webservice proxy type to this type.
        /// </summary>
        /// <param name="projectVersionDataArray">Project version data array.</param>
        /// <returns>An array of project versions in this type.</returns>
		internal static ProjectVersion[] ConvertArray(MantisConnectWebservice.ProjectVersionData[] projectVersionDataArray)
		{
            if (projectVersionDataArray == null)
            {
                return null;
            }

			ProjectVersion[] projectVersions = new ProjectVersion[projectVersionDataArray.Length];

            for (int i = 0; i < projectVersionDataArray.Length; ++i)
            {
                projectVersions[i] = new ProjectVersion(projectVersionDataArray[i]);
            }

			return projectVersions;
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="IssueRelationship"/> class.
        /// </summary>
        /// <param name="relationshipData">Relationship data in webservice proxy type.</param>
		internal IssueRelationship(MantisConnectWebservice.RelationshipData relationshipData)
		{
			this.Type = new ObjectRef(relationshipData.type);
			this.IssueId = Convert.ToInt32(relationshipData.target_id);
		}
Ejemplo n.º 18
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="projectData"></param>
        /// <param name="prefix"></param>
        /// <returns></returns>
        internal static Project[] ConvertArray(MantisConnectWebservice.ProjectData[] projectData, string prefix)
        {
            if (projectData == null)
                return null;

            List<Project> projects = new List<Project>();

            for (int i = 0; i < projectData.Length; ++i)
            {
                var project = new Project(projectData[i]);
                project.Caption = prefix + project.Name;
                projects.Add(project);
                projects.AddRange(ConvertArray(projectData[i].subprojects, prefix + "   »"));
            }

            return projects.ToArray();
        }