Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Activation / ServiceHostFactory.cs / 1 / ServiceHostFactory.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Activation { using System.Reflection; using System.Collections.ObjectModel; public class ServiceHostFactory : ServiceHostFactoryBase { CollectionreferencedAssemblies = new Collection (); internal void AddAssemblyReference(string assemblyName) { this.referencedAssemblies.Add(assemblyName); } public override ServiceHostBase CreateServiceHost(string constructorString, Uri[] baseAddresses) { if (!ServiceHostingEnvironment.IsHosted) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.Hosting_ProcessNotExecutingUnderHostedContext, "ServiceHostFactory.CreateServiceHost"))); } if (string.IsNullOrEmpty(constructorString)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.Hosting_ServiceTypeNotProvided))); } Type type = Type.GetType(constructorString, false); if (type == null) { foreach (string assemblyName in this.referencedAssemblies) { Assembly assembly = Assembly.Load(assemblyName); type = assembly.GetType(constructorString, false); if (type != null) break; } } if (type == null) { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { type = assemblies[i].GetType(constructorString, false); if (type != null) break; } } if (type == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.Hosting_ServiceTypeNotResolved, constructorString))); } return CreateServiceHost(type, baseAddresses); } protected virtual ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) { return new ServiceHost(serviceType, baseAddresses); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MinMaxParagraphWidth.cs
- WsdlImporterElementCollection.cs
- ControlOperationInvoker.cs
- BinaryMessageFormatter.cs
- AppliedDeviceFiltersEditor.cs
- ToolBarButtonClickEvent.cs
- JournalEntryListConverter.cs
- ConfigurationManagerHelperFactory.cs
- LiteralControl.cs
- ControlPaint.cs
- EventSinkHelperWriter.cs
- PropertyGridCommands.cs
- OracleNumber.cs
- StylusOverProperty.cs
- XPathDocument.cs
- WebSysDisplayNameAttribute.cs
- OutputCacheEntry.cs
- MimeWriter.cs
- EntityDataSource.cs
- CaseKeyBox.xaml.cs
- HandleRef.cs
- ScrollItemProviderWrapper.cs
- KeyEventArgs.cs
- SmiRequestExecutor.cs
- ProcessModelSection.cs
- CustomValidator.cs
- APCustomTypeDescriptor.cs
- LinkArea.cs
- InputDevice.cs
- ToolStripDropDownMenu.cs
- odbcmetadatacollectionnames.cs
- ExpressionConverter.cs
- TaskExtensions.cs
- ConnectionPoolManager.cs
- EditorAttribute.cs
- AssemblyCollection.cs
- SizeLimitedCache.cs
- RotateTransform3D.cs
- Base64Decoder.cs
- QueueProcessor.cs
- HttpResponseWrapper.cs
- SqlFileStream.cs
- StrokeNodeEnumerator.cs
- XmlComment.cs
- TextBoxBase.cs
- RouteItem.cs
- ContextStaticAttribute.cs
- StdValidatorsAndConverters.cs
- MergeFailedEvent.cs
- HttpModuleActionCollection.cs
- ProxyGenerator.cs
- DataTableCollection.cs
- ConfigXmlCDataSection.cs
- WindowsListViewGroupSubsetLink.cs
- EntityClientCacheKey.cs
- TryExpression.cs
- NativeMethods.cs
- Literal.cs
- UnsafeNativeMethodsPenimc.cs
- MobileTextWriter.cs
- ResourceDescriptionAttribute.cs
- SapiGrammar.cs
- KeyValuePair.cs
- RegisteredHiddenField.cs
- StylusTip.cs
- TypedTableHandler.cs
- OdbcConnectionFactory.cs
- ToolStripMenuItemCodeDomSerializer.cs
- SizeAnimation.cs
- COM2ComponentEditor.cs
- GradientBrush.cs
- ConnectionsZoneAutoFormat.cs
- AuthStoreRoleProvider.cs
- ToolStripPanelRow.cs
- ObjectConverter.cs
- StrokeDescriptor.cs
- WebPartRestoreVerb.cs
- SoapFault.cs
- WorkflowElementDialog.cs
- PointValueSerializer.cs
- ElementInit.cs
- SocketConnection.cs
- FilterableData.cs
- ProfileServiceManager.cs
- TraceListener.cs
- TCEAdapterGenerator.cs
- Attributes.cs
- DataBindingHandlerAttribute.cs
- PixelFormatConverter.cs
- XPathNodeIterator.cs
- Latin1Encoding.cs
- Parsers.cs
- sortedlist.cs
- MemoryStream.cs
- SubMenuStyleCollectionEditor.cs
- MetafileHeaderWmf.cs
- IconBitmapDecoder.cs
- EventSinkHelperWriter.cs
- ObjectPersistData.cs
- SwitchLevelAttribute.cs