public static TTarget GetValueConnectedTry <TSource, TTarget>(this IReadOnlyDecoration sourceDecoration, DecorationKey <TSource> sourceDecorationKey, Func <TSource, TTarget> transformer, out bool found) { TTarget targetValue; found = sourceDecoration.TryGetValueConnected(sourceDecorationKey, transformer, out targetValue); return(targetValue); }
public static bool TryGetValueByType <T>(this IReadOnlyDecoration decoration, out T value) { object _value; bool found = decoration.TryGetValueTypelessByType <T>(out _value); value = found ? (T)_value : default(T); return(found); }
public static bool TryGetValueConnected <TSource, TTarget>(this IReadOnlyDecoration sourceDecoration, DecorationKey <TSource> sourceDecorationKey, Func <TSource, TTarget> transformer, out TTarget targetValue) { TSource sourceValue; bool found = sourceDecoration.TryGetValue(sourceDecorationKey, out sourceValue); targetValue = found ? transformer(sourceValue) : default(TTarget); return(found); }
public static T GetValueByType <T>(this IReadOnlyDecoration decoration) { T value; if (decoration.TryGetValueByType <T>(out value)) { return(value); } else { throw new KeyNotFoundException(); } }
public static T GetValueOrDefaultByType <T>(this IReadOnlyDecoration decoration) { T value; if (decoration.TryGetValueByType <T>(out value)) { return(value); } else { return(default(T)); } }
public static T GetValue <T>(this IReadOnlyDecoration decoration, IDecorationKey <T> key) { T value; if (decoration.TryGetValue(key, out value)) { return(value); } else { throw new KeyNotFoundException(); } }
public static T GetValueOrDefault <T>(this IReadOnlyDecoration decoration, IDecorationKey <T> key) { T value; if (decoration.TryGetValue(key, out value)) { return(value); } else { return(default(T)); } }
public DecorConnector(IReadOnlyDecoration decoration) { this.decoration = decoration; }
public static DecorConnector ToForms(this IReadOnlyDecoration decoration) { return(new DecorConnector(decoration)); }
public DecorationComposer(IReadOnlyDecoration primaryDecoration, IReadOnlyDecoration secondaryDecoration) { this.primaryDecoration = primaryDecoration; this.secondaryDecoration = secondaryDecoration; }
public static IReadOnlyDecoration Compose(this IReadOnlyDecoration primaryDecoration, IReadOnlyDecoration secondaryDecoration) { return(new DecorationComposer(primaryDecoration, secondaryDecoration)); }
public static bool TryGetValueTypelessByType <T>(this IReadOnlyDecoration decoration, out object value) { return(decoration.TryGetValueTypeless(typeof(T), out value)); }
public static bool ContainsKeyByType <T>(this IReadOnlyDecoration decoration) { return(decoration.ContainsKey(typeof(T))); }
public static DecorConnector ToSilverlight(this IReadOnlyDecoration decoration) { return(new DecorConnector(decoration)); }