[Mantisconnect-cvs] SF.net SVN: mantisconnect:[211] mantisconnect/trunk/clients/dotnet/ mantisconne
Brought to you by:
vboctor
From: <vb...@us...> - 2011-01-15 08:36:48
|
Revision: 211 http://mantisconnect.svn.sourceforge.net/mantisconnect/?rev=211&view=rev Author: vboctor Date: 2011-01-15 08:36:41 +0000 (Sat, 15 Jan 2011) Log Message: ----------- Fixed some StyleCop issues in Issue.cs - more to come later. Modified Paths: -------------- mantisconnect/trunk/clients/dotnet/mantisconnect/Issue.cs Modified: mantisconnect/trunk/clients/dotnet/mantisconnect/Issue.cs =================================================================== --- mantisconnect/trunk/clients/dotnet/mantisconnect/Issue.cs 2010-12-05 20:48:04 UTC (rev 210) +++ mantisconnect/trunk/clients/dotnet/mantisconnect/Issue.cs 2011-01-15 08:36:41 UTC (rev 211) @@ -1,13 +1,19 @@ -#region Copyright \xA9 2004-2005 Victor Boctor -// +//----------------------------------------------------------------------- +// <copyright file="Issue.cs" company="Microsoft Corporation"> +// Copyright (C) 2004-2011 All Rights Reserved +// </copyright> +// <summary> // MantisConnect is copyrighted to Victor Boctor // // This program is distributed under the terms and conditions of the GPL // See LICENSE file for details. // // For commercial applications to link with or modify MantisConnect, they require the -// purchase of a MantisConnect commerical license. -// +// purchase of a MantisConnect commercial license. +// </summary> +//----------------------------------------------------------------------- + +#region Copyright \xA9 2004-2005 Victor Boctor #endregion using System; @@ -23,49 +29,49 @@ /// which is stored in different tables in Mantis database. /// </remarks> [Serializable] - public sealed class Issue - { + public sealed class Issue + { /// <summary> /// Initializes a new instance of the <see cref="Issue"/> class. /// </summary> - public Issue() - { - } + public Issue() + { + } /// <summary> /// Initializes a new instance of the <see cref="Issue"/> class. /// </summary> /// <param name="issueData">Issue data from Webservice proxy.</param> - internal Issue( MantisConnectWebservice.IssueData issueData ) + internal Issue(MantisConnectWebservice.IssueData issueData) { - this.Id = Convert.ToInt32( issueData.id ); - this.Project = new ObjectRef( issueData.project ); - this.Category = new ObjectRef( issueData.category ); + this.Id = Convert.ToInt32(issueData.id); + this.Project = new ObjectRef(issueData.project); + this.Category = new ObjectRef(issueData.category); this.Summary = issueData.summary; - this.Description = StringUtils.WebserviceMultilineToNative( issueData.description ); - this.StepsToReproduce = issueData.steps_to_reproduce == null ? String.Empty : StringUtils.WebserviceMultilineToNative( issueData.steps_to_reproduce ); - this.AdditionalInformation = issueData.additional_information == null ? String.Empty : StringUtils.WebserviceMultilineToNative( issueData.additional_information ); - this.AssignedTo = issueData.handler == null ? null : new User( issueData.handler ); - this.ReportedBy = new User( issueData.reporter ); + this.Description = StringUtils.WebserviceMultilineToNative(issueData.description); + this.StepsToReproduce = issueData.steps_to_reproduce == null ? String.Empty : StringUtils.WebserviceMultilineToNative(issueData.steps_to_reproduce); + this.AdditionalInformation = issueData.additional_information == null ? String.Empty : StringUtils.WebserviceMultilineToNative(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.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 ); + this.Notes = IssueNote.ConvertArray(issueData.notes); + this.Attachments = Attachment.ConvertArray(issueData.attachments); + this.Relationships = IssueRelationship.ConvertArray(issueData.relationships); } /// <summary> @@ -79,9 +85,9 @@ issueData.id = this.Id.ToString(); issueData.category = this.Category.Name; issueData.summary = this.Summary; - issueData.description = StringUtils.NativeMultilineToWebservice( this.Description ); - issueData.additional_information = StringUtils.NativeMultilineToWebservice( this.AdditionalInformation ); - issueData.steps_to_reproduce = StringUtils.NativeMultilineToWebservice( this.StepsToReproduce ); + issueData.description = StringUtils.NativeMultilineToWebservice(this.Description); + issueData.additional_information = StringUtils.NativeMultilineToWebservice(this.AdditionalInformation); + issueData.steps_to_reproduce = StringUtils.NativeMultilineToWebservice(this.StepsToReproduce); issueData.build = this.ProductBuild; issueData.version = this.ProductVersion; issueData.os = this.Os; @@ -103,7 +109,7 @@ issueData.date_submitted = this.dateSubmitted; issueData.last_updated = this.lastUpdated; - issueData.notes = IssueNote.ConvertArrayToWebservice( this.Notes ); + issueData.notes = IssueNote.ConvertArrayToWebservice(this.Notes); // TODO: Attachments // TODO: Relationships @@ -116,21 +122,23 @@ /// </summary> /// <param name="issuesData">Issues data in webservice proxy type.</param> /// <returns>The array converted to this type.</returns> - internal static Issue[] ConvertArray( MantisConnectWebservice.IssueData[] issuesData ) + internal static Issue[] ConvertArray(MantisConnectWebservice.IssueData[] issuesData) { - if ( issuesData == null ) + 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] ); + for (int i = 0; i < issuesData.Length; ++i) + { + issues[i] = new Issue(issuesData[i]); + } return issues; } /// <summary> - /// Issue Id + /// Gets or sets the issue id. /// </summary> /// <value>A value greater than or equal to 0.</value> public int Id @@ -140,7 +148,7 @@ } /// <summary> - /// Project to which this issue belongs. Null means un-assigned yet. + /// Gets or sets the project to which this issue belongs. Null means un-assigned yet. /// </summary> /// <value>A value greater than 0.</value> public ObjectRef Project @@ -150,7 +158,7 @@ } /// <summary> - /// Name of category to which the issue belongs. This field is mandatory. + /// Gets or sets the name of category to which the issue belongs. This field is mandatory. /// </summary> public ObjectRef Category { @@ -159,7 +167,7 @@ } /// <summary> - /// Summary of the issue. This field is mandatory. + /// Gets or sets the summary of the issue. This field is mandatory. /// </summary> public string Summary { @@ -168,7 +176,7 @@ } /// <summary> - /// Description of the issue. This field is mandatory. + /// Gets or sets the description of the issue. This field is mandatory. /// </summary> public string Description { @@ -177,7 +185,7 @@ } /// <summary> - /// Steps to reproduce the issue. + /// Gets or sets the steps to reproduce the issue. /// </summary> public string StepsToReproduce { @@ -186,7 +194,7 @@ } /// <summary> - /// Additional information about the issue. + /// Gets or sets the additional information about the issue. /// </summary> public string AdditionalInformation { @@ -195,7 +203,7 @@ } /// <summary> - /// Id of user handling the issue. + /// Gets or sets the id of user handling the issue. /// </summary> /// <value>User id >= 0</value> public User AssignedTo @@ -205,7 +213,7 @@ } /// <summary> - /// Id of user who reported the issue. + /// Gets or sets the id of user who reported the issue. /// </summary> /// <value>User id > 0</value> public User ReportedBy @@ -215,7 +223,7 @@ } /// <summary> - /// Product version + /// Gets or sets the product version /// </summary> public string ProductVersion { @@ -224,7 +232,7 @@ } /// <summary> - /// Product build + /// Gets or sets the product build /// </summary> public string ProductBuild { @@ -233,7 +241,7 @@ } /// <summary> - /// Operating System + /// Gets or sets the Operating System /// </summary> public string Os { @@ -242,7 +250,7 @@ } /// <summary> - /// Operating System Build + /// Gets or sets the Operating System Build /// </summary> public string OsBuild { @@ -251,7 +259,7 @@ } /// <summary> - /// Platform (eg: i386) + /// Gets or sets the Platform (eg: i386) /// </summary> public string Platform { @@ -260,7 +268,7 @@ } /// <summary> - /// Fixed in version field. + /// Gets or sets the fixed in version field. /// </summary> /// <value> /// Has to be the name of a version that is defined for the project to @@ -273,7 +281,7 @@ } /// <summary> - /// Total sponsorships for this issue. + /// Gets or sets the Total sponsorships for this issue. /// </summary> /// <remarks> /// This field is usually populated when information is retrieved about an issue. @@ -285,7 +293,7 @@ } /// <summary> - /// Issue Reproducibility (eg: always, random, not tried, N/A, ...etc) + /// Gets or sets the Issue Reproducibility (eg: always, random, not tried, N/A, ...etc) /// </summary> /// <remarks> /// This matches the ids defined in the reproducibility enumeration in Mantis configuration @@ -298,7 +306,7 @@ } /// <summary> - /// Issue Resolution (eg: fixed, duplicate, not an issue) + /// Gets or sets the Issue Resolution (eg: fixed, duplicate, not an issue) /// </summary> /// <remarks> /// This matches the ids defined in the resolution enumeration in Mantis configuration @@ -311,7 +319,7 @@ } /// <summary> - /// Estimated Time of Arrival + /// Gets or sets the Estimated Time of Arrival /// </summary> /// <remarks> /// This matches the ids defined in the eta enumeration in Mantis configuration @@ -324,7 +332,7 @@ } /// <summary> - /// Issue status + /// Gets or sets the issue status /// </summary> /// <remarks> /// This matches the ids defined in the status enumeration in Mantis configuration @@ -337,7 +345,7 @@ } /// <summary> - /// Issue Priority + /// Gets or sets the Issue Priority /// </summary> /// <remarks> /// This matches the ids defined in the priority enumeration in Mantis configuration @@ -350,7 +358,7 @@ } /// <summary> - /// Issue Severity + /// Gets or sets the Issue Severity /// </summary> /// <remarks> /// This matches the ids defined in the severity enumeration in Mantis configuration @@ -363,7 +371,7 @@ } /// <summary> - /// Projection for the scope of the work associated with resolving the issue. + /// Gets or sets the Projection for the scope of the work associated with resolving the issue. /// </summary> public ObjectRef Projection { @@ -372,7 +380,7 @@ } /// <summary> - /// View state of the issue (eg: private vs. public) + /// Gets or sets the view state of the issue (eg: private vs. public) /// </summary> public ObjectRef ViewState { @@ -381,7 +389,7 @@ } /// <summary> - /// Timestamp when issue was submitted. + /// Gets or sets the timestamp when issue was submitted. /// </summary> public DateTime DateSubmitted { @@ -390,7 +398,7 @@ } /// <summary> - /// Timestamp when issue was last updated. + /// Gets or sets the timestamp when issue was last updated. /// </summary> public DateTime LastUpdated { @@ -436,35 +444,35 @@ { StringBuilder sb = new StringBuilder(); - sb.AppendFormat( "Id = '{0}'\n", id ); - sb.AppendFormat( "Category = '{0}'\n", category == null ? "null" : category.ToString() ); - sb.AppendFormat( "Summary = '{0}'\n", summary ); - sb.AppendFormat( "Description = '{0}'\n", description ); - sb.AppendFormat( "Product Version = '{0}'\n", this.ProductVersion ); - sb.AppendFormat( "Product Build = '{0}'\n", this.ProductBuild ); - sb.AppendFormat( "Steps to Reproduce = '{0}'\n", this.stepsToReproduce ); - sb.AppendFormat( "Additional Info = '{0}'\n", this.AdditionalInformation ); + sb.AppendFormat("Id = '{0}'\n", id); + sb.AppendFormat("Category = '{0}'\n", category == null ? "null" : category.ToString()); + sb.AppendFormat("Summary = '{0}'\n", summary); + sb.AppendFormat("Description = '{0}'\n", description); + sb.AppendFormat("Product Version = '{0}'\n", this.ProductVersion); + sb.AppendFormat("Product Build = '{0}'\n", this.ProductBuild); + sb.AppendFormat("Steps to Reproduce = '{0}'\n", this.stepsToReproduce); + sb.AppendFormat("Additional Info = '{0}'\n", this.AdditionalInformation); - sb.AppendFormat( "Project = {0}\n", project == null ? "null" : project.ToString() ); - sb.AppendFormat( "Reported By = {0}\n", ReportedBy == null ? "null" : ReportedBy.ToString() ); - sb.AppendFormat( "Assigned To = {0}\n", AssignedTo == null ? "null" : AssignedTo.ToString() ); - sb.AppendFormat( "Reproducibility = {0}\n", reproducibility == null ? "null" : reproducibility.ToString() ); - sb.AppendFormat( "Status = {0}\n", status == null ? "null" : status.ToString() ); - sb.AppendFormat( "Priority = {0}\n", priority == null ? "null" : priority.ToString() ); - sb.AppendFormat( "Severity = {0}\n", severity == null ? "null" : severity.ToString() ); - sb.AppendFormat( "Resolution = {0}\n", resolution == null ? "null" : resolution.ToString() ); - sb.AppendFormat( "Projection = {0}\n", projection == null ? "null" : projection.ToString() ); - sb.AppendFormat( "Eta = {0}\n", eta == null ? "null" : eta.ToString() ); - sb.AppendFormat( "View State = {0}\n", viewState == null ? "null" : viewState.ToString() ); + sb.AppendFormat("Project = {0}\n", project == null ? "null" : project.ToString()); + sb.AppendFormat("Reported By = {0}\n", ReportedBy == null ? "null" : ReportedBy.ToString()); + sb.AppendFormat("Assigned To = {0}\n", AssignedTo == null ? "null" : AssignedTo.ToString()); + sb.AppendFormat("Reproducibility = {0}\n", reproducibility == null ? "null" : reproducibility.ToString()); + sb.AppendFormat("Status = {0}\n", status == null ? "null" : status.ToString()); + sb.AppendFormat("Priority = {0}\n", priority == null ? "null" : priority.ToString()); + sb.AppendFormat("Severity = {0}\n", severity == null ? "null" : severity.ToString()); + sb.AppendFormat("Resolution = {0}\n", resolution == null ? "null" : resolution.ToString()); + sb.AppendFormat("Projection = {0}\n", projection == null ? "null" : projection.ToString()); + sb.AppendFormat("Eta = {0}\n", eta == null ? "null" : eta.ToString()); + sb.AppendFormat("View State = {0}\n", viewState == null ? "null" : viewState.ToString()); - sb.AppendFormat( "Sponsorship Total = '{0}'\n", sponsorshipTotal ); - sb.AppendFormat( "Fixed in Version = '{0}'\n", this.FixedInVersion ); - sb.AppendFormat( "OS = '{0}'\n", this.Os ); - sb.AppendFormat( "OS Build = '{0}'\n", this.OsBuild ); - sb.AppendFormat( "Platform = '{0}'\n", this.Platform ); + sb.AppendFormat("Sponsorship Total = '{0}'\n", sponsorshipTotal); + sb.AppendFormat("Fixed in Version = '{0}'\n", this.FixedInVersion); + sb.AppendFormat("OS = '{0}'\n", this.Os); + sb.AppendFormat("OS Build = '{0}'\n", this.OsBuild); + sb.AppendFormat("Platform = '{0}'\n", this.Platform); - sb.AppendFormat( "Date Submitted = '{0}'\n", this.DateSubmitted ); - sb.AppendFormat( "Last Updated = '{0}'\n", this.LastUpdated ); + sb.AppendFormat("Date Submitted = '{0}'\n", this.DateSubmitted); + sb.AppendFormat("Last Updated = '{0}'\n", this.LastUpdated); return sb.ToString(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |