/// <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)); }
/// <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); }
/// <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)); }
/// <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); }
/// <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)); }