Skip to content

Commit

Permalink
Added a number code comments to help developers
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewste committed Mar 17, 2013
1 parent 30739a1 commit 32dd75c
Show file tree
Hide file tree
Showing 5 changed files with 562 additions and 539 deletions.
26 changes: 24 additions & 2 deletions OSA.Service/OSAEService.HelperCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Security;
using System.Security.Policy;
using System.ServiceModel;
using System.Threading;
using System.Timers;

partial class OSAEService
{
/// <summary>
/// Check if there is a OSA message container in the Event log and create one if not.
/// </summary>
private void InitialiseOSAInEventLog()
{
try
Expand All @@ -34,6 +35,9 @@ private static void DeleteStoreFiles()
File.Delete(f);
}

/// <summary>
/// Check if there is an object for the Service running on this machine in OSA, and create one if not.
/// </summary>
private void CreateServiceObject()
{
try
Expand All @@ -52,6 +56,9 @@ private void CreateServiceObject()
}
}

/// <summary>
/// Starts the various OSA threads that monitors the command Queue, and monitors plugins
/// </summary>
private void StartThreads()
{
Thread QueryCommandQueueThread = new Thread(new ThreadStart(QueryCommandQueue));
Expand All @@ -72,6 +79,9 @@ private void StartThreads()
updateThread.Start();
}

/// <summary>
/// Stops all the plugins & closes the WCF service
/// </summary>
private void ShutDownSystems()
{
logging.AddToLog("Stopping...", true);
Expand Down Expand Up @@ -175,6 +185,10 @@ private void QueryCommandQueue()
}
}

/// <summary>
/// Logs information about a method found in the Queue
/// </summary>
/// <param name="method">The method to log</param>
private void LogMethodInformation(OSAEMethod method)
{
logging.AddToLog("Found method in queue: " + method.MethodName, false);
Expand All @@ -184,6 +198,10 @@ private void LogMethodInformation(OSAEMethod method)
logging.AddToLog("-- object owner: " + method.Owner, false);
}

/// <summary>
/// Stops a plugin based on a method
/// </summary>
/// <param name="method">The method containing the information of the plugin to stop</param>
private void StopPlugin(OSAEMethod method)
{
foreach (Plugin p in plugins)
Expand All @@ -200,6 +218,10 @@ private void StopPlugin(OSAEMethod method)
}
}

/// <summary>
/// Starts a plugin based on a method
/// </summary>
/// <param name="method">The method containing the information of the plugin to stop</param>
private void StartPlugin(OSAEMethod method)
{
foreach (Plugin p in plugins)
Expand Down
14 changes: 11 additions & 3 deletions OSAE.API/OSAEObjectProperty/OSAEObjectPopertyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
using System.Data;
using MySql.Data.MySqlClient;

/// <summary>
/// Can be used to manager the properties of an object in OSA
/// </summary>
public class OSAEObjectPropertyManager
{
/// <summary>
/// Returns an OSAEObjectProperty whcih contains the value, type, ID, last updated, and name
/// </summary>
/// <param name="ObjectName"></param>
/// <param name="OSAEObjectProperty"></param>
/// <returns></returns>
/// <param name="ObjectName">The name of the object to get the property of</param>
/// <param name="OSAEObjectProperty">The property to be retieved</param>
/// <returns>the Property requested</returns>
public static OSAEObjectProperty GetObjectPropertyValue(string ObjectName, string ObjectProperty)
{
try
Expand Down Expand Up @@ -84,6 +87,11 @@ public static void ObjectPropertySet(string objectName, string propertyName, str
}
}

/// <summary>
/// The the properties of an object
/// </summary>
/// <param name="ObjectName">The object to get the proeprties of</param>
/// <returns>The properties associated to the object</returns>
public static OSAEObjectPropertyCollection GetObjectProperties(string ObjectName)
{
OSAEObjectPropertyCollection props = new OSAEObjectPropertyCollection();
Expand Down
8 changes: 4 additions & 4 deletions OSAE.API/OSAEObjectState/OSAEObjectStateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public class OSAEObjectStateManager
/// <summary>
/// Set the state of an object
/// </summary>
/// <param name="ObjectName"></param>
/// <param name="State"></param>
/// <param name="ObjectName">The name of the object to set the state of</param>
/// <param name="State">The state to set the object too</param>
/// <param name="source">Where the message was genreated from e.g. the plugin name (pName)</param>
public static void ObjectStateSet(string ObjectName, string State, string source)
{
Expand All @@ -36,8 +36,8 @@ public static void ObjectStateSet(string ObjectName, string State, string source
/// <summary>
/// Returns a OSAEObjectState object
/// </summary>
/// <param name="ObjectName"></param>
/// <returns></returns>
/// <param name="ObjectName">The object name to get the state of</param>
/// <returns>The state of the requested object</returns>
public static OSAEObjectState GetObjectStateValue(string ObjectName)
{
DataSet dataset = new DataSet();
Expand Down
93 changes: 39 additions & 54 deletions OSAE.API/OSAEObjectType/OSAEObjectType.cs
Original file line number Diff line number Diff line change
@@ -1,60 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OSAE
namespace OSAE
{
public class OSAEObjectType
{
private string _name;
private string _baseType;
private string _description;
private string _ownedBy;
private bool _owner;
private bool _container;
private bool _sysType;
private bool _hideRedundant;
/// <summary>
///
/// </summary>
public string Name { get; set; }

/// <summary>
///
/// </summary>
public string BaseType { get; set; }

/// <summary>
///
/// </summary>
public string Description { get; set; }

/// <summary>
///
/// </summary>
public string OwnedBy { get; set; }

/// <summary>
///
/// </summary>
public bool Owner { get; set; }

/// <summary>
///
/// </summary>
public bool Container { get; set; }

/// <summary>
///
/// </summary>
public bool SysType { get; set; }

public string Name
{
get { return _name; }
set { _name = value; }
}
public string BaseType
{
get { return _baseType; }
set { _baseType = value; }
}
public string Description
{
get { return _description; }
set { _description = value; }
}
public string OwnedBy
{
get { return _ownedBy; }
set { _ownedBy = value; }
}
public bool Owner
{
get { return _owner; }
set { _owner = value; }
}
public bool Container
{
get { return _container; }
set { _container = value; }
}
public bool SysType
{
get { return _sysType; }
set { _sysType = value; }
}
public bool HideRedundant
{
get { return _hideRedundant; }
set { _hideRedundant = value; }
}
/// <summary>
///
/// </summary>
public bool HideRedundant { get; set; }
}
}
Loading

0 comments on commit 32dd75c

Please sign in to comment.