예제 #1
0
#pragma warning restore CS0067 // The event is never used

        protected ServiceHostBase()
        {
            InternalBaseAddresses = new UriSchemeKeyedCollection(ThisLock);
            ChannelDispatchers    = new ChannelDispatcherCollection(this, ThisLock);
            _extensions           = new ExtensionCollection <ServiceHostBase>(this, ThisLock);
            _instances            = new InstanceContextManager(ThisLock);
        }
예제 #2
0
 protected ServiceHostBase()
 {
     this.baseAddresses      = new UriSchemeKeyedCollection(this.ThisLock);
     this.channelDispatchers = new ChannelDispatcherCollection(this, this.ThisLock);
     this.extensions         = new ExtensionCollection <ServiceHostBase>(this, this.ThisLock);
     this.instances          = new InstanceContextManager(this.ThisLock);
 }
예제 #3
0
        //public int IncrementManualFlowControlLimit(int incrementBy)
        //{
        //    throw new PlatformNotSupportedException();
        //}

        protected void InitializeDescription(UriSchemeKeyedCollection baseAddresses)
        {
            foreach (Uri baseAddress in baseAddresses)
            {
                InternalBaseAddresses.Add(baseAddress);
            }

            Description = CreateDescription(out _implementedContracts);
            _initializeDescriptionHasFinished = true;
        }
예제 #4
0
        protected void InitializeDescription(UriSchemeKeyedCollection baseAddresses)
        {
            foreach (Uri baseAddress in baseAddresses)
            {
                this.baseAddresses.Add(baseAddress);
            }

            description = CreateDescription(out implementedContracts);
            ApplyConfiguration();
            initializeDescriptionHasFinished = true;
        }
예제 #5
0
        internal static Uri GetVia(string scheme, Uri address, UriSchemeKeyedCollection baseAddresses)
        {
            Uri via = address;

            if (!via.IsAbsoluteUri)
            {
                if (!baseAddresses.Contains(scheme))
                {
                    return(null);
                }

                via = GetUri(baseAddresses[scheme], address);
            }
            return(via);
        }
예제 #6
0
        protected void InitializeDescription(UriSchemeKeyedCollection baseAddresses)
        {
            foreach (Uri baseAddress in baseAddresses)
            {
                this.baseAddresses.Add(baseAddress);
            }
            IDictionary <string, ContractDescription> implementedContracts = null;
            ServiceDescription description = CreateDescription(out implementedContracts);

            this.description          = description;
            this.implementedContracts = implementedContracts;

            ApplyConfiguration();
            initializeDescriptionHasFinished = true;
        }
예제 #7
0
        internal static string GetBaseAddressSchemes(UriSchemeKeyedCollection uriSchemeKeyedCollection)
        {
            StringBuilder buffer      = new StringBuilder();
            bool          firstScheme = true;

            foreach (Uri address in uriSchemeKeyedCollection)
            {
                if (firstScheme)
                {
                    buffer.Append(address.Scheme);
                    firstScheme = false;
                }
                else
                {
                    buffer.Append(CultureInfo.CurrentCulture.TextInfo.ListSeparator).Append(address.Scheme);
                }
            }

            return(buffer.ToString());
        }
예제 #8
0
        internal static Uri GetVia(string scheme, Uri address, UriSchemeKeyedCollection baseAddresses)
        {
            Uri via = address;

            if (!via.IsAbsoluteUri)
            {
                Uri baseAddress = null;
                foreach (var ba in baseAddresses)
                {
                    if (ba.Scheme.Equals(scheme))
                    {
                        baseAddress = ba;
                        break;
                    }
                }
                if (baseAddress == null)
                {
                    return(null);
                }

                via = GetUri(baseAddress, address);
            }
            return(via);
        }
예제 #9
0
        internal static Uri MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses)
        {
            Uri result = relativeOrAbsoluteUri;

            if (!result.IsAbsoluteUri)
            {
                if (binding.Scheme == string.Empty)
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.SFxCustomBindingWithoutTransport));
                }
                result = GetVia(binding.Scheme, result, baseAddresses);
                if (result == null)
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.SFxEndpointNoMatchingScheme, binding.Scheme, binding.Name, GetBaseAddressSchemes(baseAddresses))));
                }
            }

            return(result);
        }