Sanely namespaces the project

This commit is contained in:
Cyberboss
2017-11-12 23:48:49 -05:00
parent cc364a75d6
commit 6e54f622de
154 changed files with 2434 additions and 2434 deletions
+36
View File
@@ -0,0 +1,36 @@
using System;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TGS.ControlPanel
{
/// <summary>
/// Used to provide an ATP function for calls into an <see cref="TGS.Interface.IServerInterface"/>
/// </summary>
#if !DEBUG
abstract class ServerOpForm : Form
#else
class ServerOpForm : Form
#endif
{
/// <summary>
/// Used to wrap <see cref="TGS.Interface.IServerInterface"/> calls in a non-blocking fashion while disabling the <see cref="Form"/> and enabling the wait cursor
/// </summary>
/// <param name="action">The <see cref="TGS.Interface.IServerInterface"/> operation to wrap</param>
/// <returns>A <see cref="Task"/> wrapping <paramref name="action"/></returns>
protected Task WrapServerOp(Action action)
{
Enabled = false;
UseWaitCursor = true;
try
{
return Task.Factory.StartNew(action);
}
finally
{
Enabled = true;
UseWaitCursor = false;
}
}
}
}