Skip to content

Commit

Permalink
Code maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewste committed Mar 17, 2013
1 parent 32dd75c commit 744dda2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Manager_WPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ void OnChecked(object sender, RoutedEventArgs e)
}
catch (Exception ex)
{
logging.AddToLog("Error enabling plugin: " + ex.Message, true);
logging.AddToLog("Error enabling plugin: " + ex.Message + " Inner Exception: " + ex.InnerException, true);
}
}

Expand Down
24 changes: 18 additions & 6 deletions OSA.Service/OSAEService.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
namespace OSAE.Service
{
#region Usings

using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceProcess;

#endregion

/// <summary>
/// The primary server used in the OSA infrastructure to process information
/// </summary>
partial class OSAEService : ServiceBase
{
#region Member Variables
/// <summary>
/// Used when generating messages to identify where the message came from
/// </summary>
Expand All @@ -36,6 +41,8 @@ partial class OSAEService : ServiceBase
/// </summary>
private System.Timers.Timer checkPlugins = new System.Timers.Timer();

#endregion

/// <summary>
/// The Main Thread: This is where your Service is Run.
/// </summary>
Expand Down Expand Up @@ -68,15 +75,16 @@ public OSAEService()
InitialiseOSAInEventLog();

// These Flags set whether or not to handle that specific
// type of event. Set to true if you need it, false otherwise.
// type of event. Set to true if you need it, false otherwise.

this.CanStop = true;
this.CanShutdown = true;
}
}

#region Standard Windows Service Methods

/// <summary>
/// OnStart: Put startup code here
/// - Start threads, get inital data, etc.
/// The service control manager has requested us to start
/// </summary>
/// <param name="args"></param>
protected override void OnStart(string[] args)
Expand Down Expand Up @@ -113,8 +121,7 @@ protected override void OnStart(string[] args)
}

/// <summary>
/// OnStop: Put your stop code here
/// - Stop threads, set final data, etc.
/// The service control manager has requested us to stop
/// </summary>
protected override void OnStop()
{
Expand All @@ -123,11 +130,16 @@ protected override void OnStop()
ShutDownSystems();
}

/// <summary>
/// The service control manager has requested us to shitdown
/// </summary>
protected override void OnShutdown()
{
logging.AddToLog("OnShutdown Invoked", false);

ShutDownSystems();
}

#endregion
}
}
7 changes: 4 additions & 3 deletions WebUI/logs.aspx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class logs : System.Web.UI.Page
Expand Down Expand Up @@ -51,7 +49,6 @@ private void GetLogs()
var list = from f in fileList
select new { logName = Path.GetFileNameWithoutExtension(f) };


gvLogs.DataKeyNames = new string[] { "logName" };

gvLogs.DataSource = list;
Expand All @@ -65,9 +62,13 @@ protected void gvLogs_RowDataBound(object sender, System.Web.UI.WebControls.Grid
{
e.Row.Attributes.Add("onmouseover", "this.style.cursor='hand';this.style.background='lightblue';");
if (e.Row.RowState == DataControlRowState.Alternate)
{
e.Row.Attributes.Add("onmouseout", "this.style.background='#fcfcfc url(Images/grd_alt.png) repeat-x top';");
}
else
{
e.Row.Attributes.Add("onmouseout", "this.style.background='none';");
}
e.Row.Attributes.Add("onclick", ClientScript.GetPostBackClientHyperlink(this, "gvLogs_" + e.Row.RowIndex.ToString()));
}

Expand Down

0 comments on commit 744dda2

Please sign in to comment.