/// <summary> /// Gets or creates a named channel from a marker setup /// </summary> /// <returns>The named channel.</returns> /// <param name="marker">The channel marker instance that describes the channel.</param> /// <typeparam name="T">The channel type.</typeparam> public static IChannel <T> GetChannel <T>(ChannelMarkerWrapper <T> marker) { var scope = ChannelScope.Current; if (marker.TargetScope == ChannelNameScope.Parent) { scope = scope.ParentScope; } else if (marker.TargetScope == ChannelNameScope.Global) { scope = ChannelScope.Root; } return(GetChannel <T>(marker.Attribute, scope)); }
/// <summary> /// Gets or creates a channel /// </summary> /// <returns>The channel with the given name.</returns> /// <param name="marker">The <see cref="ChannelNameMarker"/> of the channel to create.</param> /// <typeparam name="T">The type of data in the channel.</typeparam> public IChannel <T> GetOrCreate <T>(ChannelMarkerWrapper <T> marker) { return(this.GetOrCreate <T>(marker.Attribute)); }
/// <summary> /// Gets or creates a named channel from a marker setup /// </summary> /// <returns>The named channel.</returns> /// <param name="marker">The channel marker instance that describes the channel.</param> /// <typeparam name="T">The channel type.</typeparam> public static IChannel <T> Get <T>(ChannelMarkerWrapper <T> marker) { return(ChannelManager.GetChannel <T>(marker)); }