/// <summary> /// Create a new instance of the channel. /// </summary> /// <param name="channelController">Controller used to process the client messages.</param> /// <exception cref="ArgumentException"><paramref name="channelController"/></exception> public HostService(ProtocolBinding binding) { this.Binding = binding ?? throw new ArgumentNullException(nameof(binding)); this.Binding.Listener.NetworkClientAccepted += AcceptNetworkClient; this.ChannelList = new ObservableCollection <Channel <TController> >(); this.Channels = new ReadOnlyObservableCollection <Channel <TController> >(this.ChannelList); }
/// <summary>EnumToString(NameIDFormat)</summary> /// <param name="protocolBinding">ProtocolBinding</param> /// <returns>string</returns> public static string EnumToString(ProtocolBinding protocolBinding) { string ret = ""; switch (protocolBinding) { case SAML2Enum.ProtocolBinding.HttpPost: ret = SAML2Const.UrnBindingsPost; break; case SAML2Enum.ProtocolBinding.HttpRedirect: ret = SAML2Const.UrnBindingsRedirect; break; } return(ret); }
/// <summary> /// Create a new instance of the channel based on channel controller. /// </summary> /// <typeparam name="TController">type of logical controller to the channel.</typeparam> /// <param name="channelController">logical controller to the channel.</param> /// <returns>New instance of <see cref="HostService"/></returns> public static async Task <HostService <TController> > CreateService <TController>(ProtocolBinding binding) where TController : class, IChannelController { return(await new HostService <TController>(binding).StartAsync()); }