Skip to content

Commit

Permalink
Add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel15 committed Nov 26, 2011
1 parent f793e85 commit d084b26
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
4 changes: 3 additions & 1 deletion NTelepathy/Dbus/Constants.cs
Expand Up @@ -23,7 +23,9 @@ public abstract class Constants
/// Interface for accounts. /// Interface for accounts.
/// </summary> /// </summary>
public const string ACCOUNT_INTERFACE = "org.freedesktop.Telepathy.Account"; public const string ACCOUNT_INTERFACE = "org.freedesktop.Telepathy.Account";

/// <summary>
/// Interface for SimplePresence.
/// </summary>
public const string SIMPLEPRESENCE_INTERFACE = "org.freedesktop.Telepathy.Connection.Interface.SimplePresence"; public const string SIMPLEPRESENCE_INTERFACE = "org.freedesktop.Telepathy.Connection.Interface.SimplePresence";
} }
} }
Expand Down
19 changes: 19 additions & 0 deletions NTelepathy/Dbus/DbusBase.cs
Expand Up @@ -8,6 +8,10 @@ namespace NTelepathy
{ {
public abstract class DbusBase public abstract class DbusBase
{ {
/// <summary>
/// Gets or sets the properties implementation for this object
/// </summary>
/// <value>The properties object</value>
public Properties Properties { get; set; } public Properties Properties { get; set; }


/*protected string Interface /*protected string Interface
Expand All @@ -21,11 +25,26 @@ public abstract class DbusBase
} }
}*/ }*/


/// <summary>
/// Gets the value of the specified property.
/// </summary>
/// <returns>The property value</returns>
/// <param name='interface'>Interface to get property from</param>
/// <param name='name'>Property name</param>
/// <typeparam name='T'>Type of the property</typeparam>
protected T GetProperty<T>(string @interface, string name) protected T GetProperty<T>(string @interface, string name)
{ {
return (T)Properties.Get(@interface, name); return (T)Properties.Get(@interface, name);
} }


/// <summary>
/// Gets the value of the specified object property.
/// </summary>
/// <returns>The property value</returns>
/// <param name='interface'>Interface to get property from</param>
/// <param name='name'>Property name</param>
/// <param name='bus_name'>Name of the bus to get the object from</param>
/// <typeparam name='T'>Type of the property</typeparam>
protected T GetProperty<T>(string @interface, string name, string bus_name) where T : DbusBase protected T GetProperty<T>(string @interface, string name, string bus_name) where T : DbusBase
{ {
ObjectPath path = GetProperty<ObjectPath>(@interface, name); ObjectPath path = GetProperty<ObjectPath>(@interface, name);
Expand Down
14 changes: 14 additions & 0 deletions NTelepathy/Dbus/DbusHelper.cs
Expand Up @@ -7,6 +7,13 @@ namespace NTelepathy
{ {
public static class DbusHelper public static class DbusHelper
{ {
/// <summary>
/// Gets the specified DBus object along with its properties object
/// </summary>
/// <returns>The DBus object</returns>
/// <param name='bus_name'>Name of the bus to get the object from</param>
/// <param name='path'>Path to the object</param>
/// <typeparam name='T'>Type of the object</typeparam>
public static T GetWithProperties<T>(string bus_name, ObjectPath path) where T : DbusBase public static T GetWithProperties<T>(string bus_name, ObjectPath path) where T : DbusBase
{ {
T obj = Bus.Session.GetObject<T>(bus_name, path); T obj = Bus.Session.GetObject<T>(bus_name, path);
Expand All @@ -15,6 +22,13 @@ public static class DbusHelper
return obj; return obj;
} }


/// <summary>
/// Gets the specified DBus objects along with their properties objects
/// </summary>
/// <returns>The DBus objects</returns>
/// <param name='bus_name'>Name of the bus to get the object from</param>
/// <param name='paths'>Paths to the object</param>
/// <typeparam name='T'>Type of the objects</typeparam>
public static IEnumerable<T> GetWithProperties<T>(string bus_name, ObjectPath[] paths) where T : DbusBase public static IEnumerable<T> GetWithProperties<T>(string bus_name, ObjectPath[] paths) where T : DbusBase
{ {
IList<T> results = new List<T>(paths.Length); IList<T> results = new List<T>(paths.Length);
Expand Down
6 changes: 6 additions & 0 deletions NTelepathy/Telepathy.cs
Expand Up @@ -4,8 +4,14 @@


namespace NTelepathy namespace NTelepathy
{ {
/// <summary>
/// Base Telepathy class
/// </summary>
public static class Telepathy public static class Telepathy
{ {
/// <summary>
/// Get the Telepathy AccountManager
/// </summary>
public static AccountManager AccountManager public static AccountManager AccountManager
{ {
get get
Expand Down

0 comments on commit d084b26

Please sign in to comment.