示例#1
0
 /// <summary>
 /// Indicates if this object has a property.
 /// </summary>
 /// <param name="context">
 /// An API context.
 /// </param>
 /// <param name="name">
 /// The name of a property.
 /// </param>
 /// <returns>
 /// <c>true</c> if this object has the
 /// property; otherwise, <c>false</c>.
 /// </returns>
 public static bool HasProperty(this ApiContext context, string name)
 {
     return(context.GetPropertyBag().HasProperty(name));
 }
示例#2
0
 /// <summary>
 /// Clears a property.
 /// </summary>
 /// <param name="context">
 /// An API context.
 /// </param>
 /// <param name="name">
 /// The name of a property.
 /// </param>
 public static void ClearProperty(this ApiContext context, string name)
 {
     context.GetPropertyBag().ClearProperty(name);
 }
示例#3
0
 /// <summary>
 /// Gets a property.
 /// </summary>
 /// <param name="context">
 /// An API context.
 /// </param>
 /// <param name="name">
 /// The name of a property.
 /// </param>
 /// <returns>
 /// The value of the property.
 /// </returns>
 public static object GetProperty(this ApiContext context, string name)
 {
     return(context.GetPropertyBag().GetProperty(name));
 }
示例#4
0
 /// <summary>
 /// Sets a property.
 /// </summary>
 /// <param name="context">
 /// An API context.
 /// </param>
 /// <param name="name">
 /// The name of a property.
 /// </param>
 /// <param name="value">
 /// A value for the property.
 /// </param>
 public static void SetProperty(this ApiContext context, string name, object value)
 {
     context.GetPropertyBag().SetProperty(name, value);
 }
示例#5
0
 /// <summary>
 /// Gets a property.
 /// </summary>
 /// <typeparam name="T">
 /// The type of the property.
 /// </typeparam>
 /// <param name="context">
 /// An API context.
 /// </param>
 /// <param name="name">
 /// The name of a property.
 /// </param>
 /// <returns>
 /// The value of the property.
 /// </returns>
 public static T GetProperty <T>(this ApiContext context, string name)
 {
     return(context.GetPropertyBag().GetProperty <T>(name));
 }