Beispiel #1
0
        /// <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));
        }
Beispiel #2
0
 /// <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));
 }
Beispiel #3
0
 /// <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));
 }