From c87bb91b7c769efd5fbdafcc8c65aaa007748c7f Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 4 Dec 2010 15:51:07 +0100 Subject: [PATCH] dotnet plugin: Add some simple XML documentation to the C# code. --- bindings/csharp/collectd.cs | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/bindings/csharp/collectd.cs b/bindings/csharp/collectd.cs index 47ed63cc..061c16d3 100644 --- a/bindings/csharp/collectd.cs +++ b/bindings/csharp/collectd.cs @@ -347,6 +347,13 @@ namespace CollectdAPI } } /* }}} struct value_list_s */ + /// + /// This is the main class for interacting with collectd. + /// + /// + /// The functions exported by collectd are available from this class as + /// public static methods. + /// public class Collectd /* {{{ */ { private static Hashtable _readFunctions = new Hashtable (); @@ -370,36 +377,43 @@ namespace CollectdAPI [DllImport("__Internal", EntryPoint="dotnet_dispatch_values")] private extern static int _dispatchValues (value_list_s vl); - public static int DispatchValues (ValueList vl) - { - return (_dispatchValues (new value_list_s (vl))); - } - + /// Logs an error message. + /// Do not include a newline at the end. public static int LogError (string message) { return (_log (3, message)); } + /// Logs a warning message. + /// Do not include a newline at the end. public static int LogWarning (string message) { return (_log (4, message)); } + /// Logs a message with severity "notice". + /// Do not include a newline at the end. public static int LogNotice (string message) { return (_log (5, message)); } + /// Logs a message with severity "info". + /// Do not include a newline at the end. public static int LogInfo (string message) { return (_log (6, message)); } + /// Logs a debug message. + /// Do not include a newline at the end. public static int LogDebug (string message) { return (_log (7, message)); } + /// Register an init callback. + /// Name uniquely identifying the callback function. public static int RegisterInit (string name, CollectdInitCallback func) { if (_initFunctions.Contains (name)) @@ -409,6 +423,8 @@ namespace CollectdAPI return (_registerInit (name, func)); } /* int RegisterInit */ + /// Register a read callback. + /// Name uniquely identifying the callback function. public static int RegisterRead (string name, CollectdReadCallback func) { if (_readFunctions.Contains (name)) @@ -417,8 +433,13 @@ namespace CollectdAPI return (_registerRead (name, func)); } - } /* }}} class Collectd */ + /// Dispatches a ValueList to the daemon. + public static int DispatchValues (ValueList vl) + { + return (_dispatchValues (new value_list_s (vl))); + } + } /* }}} class Collectd */ } /* vim: set sw=2 sts=2 et fdm=marker : */ -- 2.11.0