[Mantisconnect-cvs] SF.net SVN: mantisconnect: [143] mantisconnect/trunk/clients/dotnet/Cropper .Ma
Brought to you by:
vboctor
From: <vb...@us...> - 2007-10-20 21:09:28
|
Revision: 143 http://mantisconnect.svn.sourceforge.net/mantisconnect/?rev=143&view=rev Author: vboctor Date: 2007-10-20 14:09:23 -0700 (Sat, 20 Oct 2007) Log Message: ----------- Fixed #349: Exception while typing the issue number Modified Paths: -------------- mantisconnect/trunk/clients/dotnet/Cropper.Mantis/Cropper.Mantis.csproj mantisconnect/trunk/clients/dotnet/Cropper.Mantis/ScreenshotDetailsForm.cs mantisconnect/trunk/clients/dotnet/Cropper.Mantis/SendToMantis.cs Modified: mantisconnect/trunk/clients/dotnet/Cropper.Mantis/Cropper.Mantis.csproj =================================================================== --- mantisconnect/trunk/clients/dotnet/Cropper.Mantis/Cropper.Mantis.csproj 2007-07-16 03:43:38 UTC (rev 142) +++ mantisconnect/trunk/clients/dotnet/Cropper.Mantis/Cropper.Mantis.csproj 2007-10-20 21:09:23 UTC (rev 143) @@ -39,6 +39,7 @@ <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> + <Reference Include="System.Web.Services" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> </ItemGroup> Modified: mantisconnect/trunk/clients/dotnet/Cropper.Mantis/ScreenshotDetailsForm.cs =================================================================== --- mantisconnect/trunk/clients/dotnet/Cropper.Mantis/ScreenshotDetailsForm.cs 2007-07-16 03:43:38 UTC (rev 142) +++ mantisconnect/trunk/clients/dotnet/Cropper.Mantis/ScreenshotDetailsForm.cs 2007-10-20 21:09:23 UTC (rev 143) @@ -25,6 +25,7 @@ private string filePath; private ProcessImageHandler processImageHandler; private SentToMantisFormat sendToMantis; + private string issueIdBeingFetched; public delegate void ProcessImageHandler(int issueId, string filePath, string fileName, string note); @@ -97,7 +98,12 @@ private void issueIdTextBox_TextChanged(object sender, EventArgs e) { this.EnableControls(); - this.getIssueBackgroundWorker.RunWorkerAsync(); + + if (String.IsNullOrEmpty(this.issueIdBeingFetched)) + { + this.issueIdBeingFetched = this.issueIdTextBox.Text; + this.getIssueBackgroundWorker.RunWorkerAsync(); + } } /// <summary> @@ -132,7 +138,7 @@ this.issueSummaryTextBox.Text = "Retrieving issue summary..."; int issueId; - if (Int32.TryParse(this.issueIdTextBox.Text, out issueId)) + if (Int32.TryParse(this.issueIdBeingFetched, out issueId)) { e.Result = this.sendToMantis.GetIssueSummary(issueId); } @@ -145,6 +151,14 @@ private void getIssueBackgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { this.issueSummaryTextBox.Text = (string)e.Result; + + string temp = this.issueIdBeingFetched; + this.issueIdBeingFetched = null; + + if (!String.Equals(this.issueIdTextBox.Text, temp, StringComparison.OrdinalIgnoreCase)) + { + this.issueIdTextBox_TextChanged(this, null); + } } } } \ No newline at end of file Modified: mantisconnect/trunk/clients/dotnet/Cropper.Mantis/SendToMantis.cs =================================================================== --- mantisconnect/trunk/clients/dotnet/Cropper.Mantis/SendToMantis.cs 2007-07-16 03:43:38 UTC (rev 142) +++ mantisconnect/trunk/clients/dotnet/Cropper.Mantis/SendToMantis.cs 2007-10-20 21:09:23 UTC (rev 143) @@ -17,6 +17,7 @@ using System.IO; using System.Runtime.CompilerServices; using System.Text; +using System.Web.Services.Protocols; using System.Windows.Forms; using Fusion8.Cropper.Extensibility; @@ -87,10 +88,9 @@ string message = "Snapshot successfully uploaded"; MessageBox.Show(message, "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); } - catch (Exception ex) + catch (SoapException ex) { MessageBox.Show(ex.Message, "Failure", MessageBoxButtons.OK, MessageBoxIcon.Error); - throw; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |