/// <summary> /// Inserts a behavior into the proxy behasvior pipeline at the specified /// index. /// </summary> public static void InsertProxyBehavior(this object proxy, int index, IProxyBehavior behavior) { if (proxy is IProxy target) { target.Behaviors.Insert(index, behavior); } else { throw new ArgumentException(nameof(proxy)); } }
/// <summary> /// Adds a behavior to a proxy. /// </summary> public static void AddProxyBehavior(this object proxy, IProxyBehavior behavior) { if (proxy is IProxy target) { target.Behaviors.Add(behavior); } else { throw new ArgumentException(nameof(proxy)); } }
/// <summary> /// Adds a behavior to a proxy. /// </summary> public static TProxy AddBehavior <TProxy>(this TProxy proxy, IProxyBehavior behavior) { if (proxy is IProxy target) { target.Behaviors.Add(behavior); } else { throw new ArgumentException(nameof(proxy)); } return(proxy); }
/// <summary> /// Inserts a behavior into the proxy behasvior pipeline at the specified /// index. /// </summary> public static TProxy InsertBehavior <TProxy>(this TProxy proxy, int index, IProxyBehavior behavior) { if (proxy is IProxy target) { target.Behaviors.Insert(index, behavior); } else { throw new ArgumentException(nameof(proxy)); } return(proxy); }
/// <summary> /// Inserts a behavior into the proxy behavior pipeline at the specified /// index. /// </summary> public static IProxy InsertBehavior(this IProxy proxy, int index, IProxyBehavior behavior) { proxy.Behaviors.Insert(index, behavior); return(proxy); }
/// <summary> /// Adds a behavior to a proxy. /// </summary> public static IProxy AddBehavior(this IProxy proxy, IProxyBehavior behavior) { proxy.Behaviors.Add(behavior); return(proxy); }
/// <summary> /// Inserts a behavior into the proxy behavior pipeline at the specified /// index. /// </summary> public static void InsertProxyBehavior(this IProxy proxy, int index, IProxyBehavior behavior) { proxy.Behaviors.Insert(index, behavior); }
/// <summary> /// Adds a behavior to a proxy. /// </summary> public static void AddProxyBehavior(this IProxy proxy, IProxyBehavior behavior) { proxy.Behaviors.Add(behavior); }