[Roam-commit] SF.net SVN: roam: [129] Trunk/Source
Status: Alpha
Brought to you by:
jonfroehlich
|
From: <jon...@us...> - 2008-03-19 08:42:14
|
Revision: 129
http://roam.svn.sourceforge.net/roam/?rev=129&view=rev
Author: jonfroehlich
Date: 2008-03-19 01:42:06 -0700 (Wed, 19 Mar 2008)
Log Message:
-----------
trying to fix https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=328786 in RoamForm
Modified Paths:
--------------
Trunk/Source/Roam.Test/Roam.Test.csproj
Trunk/Source/Roam.UI/Forms/RoamForm.cs
Modified: Trunk/Source/Roam.Test/Roam.Test.csproj
===================================================================
--- Trunk/Source/Roam.Test/Roam.Test.csproj 2008-03-16 08:40:19 UTC (rev 128)
+++ Trunk/Source/Roam.Test/Roam.Test.csproj 2008-03-19 08:42:06 UTC (rev 129)
@@ -564,7 +564,7 @@
<DependentUpon>TextBoxFilteredListTest.cs</DependentUpon>
</Compile>
<Compile Include="UI\Controls\FontTest.cs">
- <SubType>Form</SubType>
+ <SubType>Component</SubType>
</Compile>
<Compile Include="UI\Controls\FontTest.Designer.cs">
<DependentUpon>FontTest.cs</DependentUpon>
Modified: Trunk/Source/Roam.UI/Forms/RoamForm.cs
===================================================================
--- Trunk/Source/Roam.UI/Forms/RoamForm.cs 2008-03-16 08:40:19 UTC (rev 128)
+++ Trunk/Source/Roam.UI/Forms/RoamForm.cs 2008-03-19 08:42:06 UTC (rev 129)
@@ -35,7 +35,7 @@
private bool _isModal = false;
private bool _isClosed = false;
private bool _isDisposed = false;
- private object _objLock = new object();
+ //private object _objLock = new object();
#endregion Fields
#region Constructors
@@ -46,58 +46,103 @@
#endregion Constructors
#region Properties
+ //public bool IsClosed
+ //{
+ // get
+ // {
+ // lock (_objLock)
+ // {
+ // return _isClosed;
+ // }
+ // }
+ // protected set
+ // {
+ // lock (_objLock)
+ // {
+ // _isClosed = value;
+ // }
+ // }
+ //}
+
+ //public bool IsDisposed
+ //{
+ // get
+ // {
+ // lock (_objLock)
+ // {
+ // return _isDisposed;
+ // }
+ // }
+ // private set
+ // {
+ // lock (_objLock)
+ // {
+ // _isDisposed = value;
+ // }
+ // }
+ //}
+
+ //public bool IsModal
+ //{
+ // get
+ // {
+ // lock (_objLock)
+ // {
+ // return _isModal;
+ // }
+ // }
+ // private set
+ // {
+ // lock (_objLock)
+ // {
+ // _isModal = value;
+ // }
+ // }
+ //}
+
+ //public new DialogResult DialogResult
+ //{
+ // get { return base.DialogResult; }
+ // set
+ // {
+ // lock (_objLock)
+ // {
+ // base.DialogResult = value;
+
+ // //The following is a workaround relating to the differences between form.ShowDialog()
+ // //and Application2.ShowDialog()
+ // //
+ // //Setting the DialogResult property with a value from the DialogResult enumeration
+ // //sets the value of the dialog box result for the form, hides the modal
+ // //dialog box, and returns control to the calling form. However, this does
+ // //NOT work properly if the form was started using Application2.ShowDialog.
+ // //In this case, setting the dialog result does not infact hide the modal dialog
+ // //box. So we will do that ourselves here.
+ // //
+ // //In addition, if a form was shown via form.Show(), setting its DialogResult
+ // //has no effect. This changes that behavior such that it is consistent with
+ // //form.ShowDialog()
+ // if (!IsClosed) { this.Close(); }
+ // }
+ // }
+ //}
+
public bool IsClosed
{
- get
- {
- lock (_objLock)
- {
- return _isClosed;
- }
- }
- protected set
- {
- lock (_objLock)
- {
- _isClosed = value;
- }
- }
+ get { return _isClosed; }
+ protected set { _isClosed = value; }
}
public bool IsDisposed
{
- get
- {
- lock (_objLock)
- {
- return _isDisposed;
- }
- }
- private set
- {
- lock (_objLock)
- {
- _isDisposed = value;
- }
- }
+ get { return _isDisposed; }
+ private set { _isDisposed = value; }
}
public bool IsModal
{
- get
- {
- lock (_objLock)
- {
- return _isModal;
- }
- }
- private set
- {
- lock (_objLock)
- {
- _isModal = value;
- }
- }
+ get { return _isModal; }
+ private set { _isModal = value; }
}
public new DialogResult DialogResult
@@ -105,25 +150,30 @@
get { return base.DialogResult; }
set
{
- lock (_objLock)
+ try
{
base.DialogResult = value;
+ }
+ catch (ArgumentException ae)
+ {
+ //consume argument exception
+ //see https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=328786
+ }
- //The following is a workaround relating to the differences between form.ShowDialog()
- //and Application2.ShowDialog()
- //
- //Setting the DialogResult property with a value from the DialogResult enumeration
- //sets the value of the dialog box result for the form, hides the modal
- //dialog box, and returns control to the calling form. However, this does
- //NOT work properly if the form was started using Application2.ShowDialog.
- //In this case, setting the dialog result does not infact hide the modal dialog
- //box. So we will do that ourselves here.
- //
- //In addition, if a form was shown via form.Show(), setting its DialogResult
- //has no effect. This changes that behavior such that it is consistent with
- //form.ShowDialog()
- if (!IsClosed) { this.Close(); }
- }
+ //The following is a workaround relating to the differences between form.ShowDialog()
+ //and Application2.ShowDialog()
+ //
+ //Setting the DialogResult property with a value from the DialogResult enumeration
+ //sets the value of the dialog box result for the form, hides the modal
+ //dialog box, and returns control to the calling form. However, this does
+ //NOT work properly if the form was started using Application2.ShowDialog.
+ //In this case, setting the dialog result does not infact hide the modal dialog
+ //box. So we will do that ourselves here.
+ //
+ //In addition, if a form was shown via form.Show(), setting its DialogResult
+ //has no effect. This changes that behavior such that it is consistent with
+ //form.ShowDialog()
+ if (!IsClosed) { this.Close(); }
}
}
#endregion Properties
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|