Пример #1
0
 /// <summary>
 /// Creates the specified a Capability value.
 /// </summary>
 /// <param name="cap">The capability.</param>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 public static XCapabilityValue <T> Create(XCapability <T> cap, T value)
 {
     return(new Extensions.XCapabilityValue <T> {
         Capability = cap,
         Value = value
     });
 }
Пример #2
0
 /// <summary>
 /// Gets the capability.
 /// </summary>
 /// <typeparam name="T">Type of a capability value.</typeparam>
 /// <param name="capability">The capability.</param>
 /// <returns>Instance of XDs class.</returns>
 public XCapability <T> GetCapability <T>(TwCap capability)
 {
     return(XCapability <T> .Create(this, capability));
 }
Пример #3
0
 /// <summary>
 /// Sets value of a capability.
 /// </summary>
 /// <typeparam name="T">Type of a capability.</typeparam>
 /// <param name="capability">The capability.</param>
 /// <param name="callback">The callback function.</param>
 /// <returns>Instance of a capability.</returns>
 public static XCapability <T> Set <T>(this XCapability <T> capability, Func <XCapability <T>, T> callback)
 {
     capability.Set(callback(capability));
     return(capability);
 }
Пример #4
0
 /// <summary>
 /// Sets value of a capability.
 /// </summary>
 /// <typeparam name="T">Type of a capability.</typeparam>
 /// <param name="capability">The capability.</param>
 /// <param name="callback">The callback function.</param>
 /// <returns>Instance of a capability.</returns>
 public static XCapability <T> Set <T>(this XCapability <T> capability, Func <XCapability <T>, XCapabilityValue <T> > callback)
 {
     callback(capability)?.Set();
     return(capability);
 }