Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / Script / Services / ProxyGenerator.cs / 1305376 / ProxyGenerator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Script.Services { using System; using System.Globalization; using System.ServiceModel; using System.ServiceModel.Description; using System.Web.Resources; public static class ProxyGenerator { public static string GetClientProxyScript(Type type, string path, bool debug) { return GetClientProxyScript(type, path, debug, null); } public static string GetClientProxyScript(Type type, string path, bool debug, ServiceEndpoint serviceEndpoint) { if (type == null) { throw new ArgumentNullException("type"); } if (path == null) { throw new ArgumentNullException("path"); } WebServiceData webServiceData = null; ClientProxyGenerator proxyGenerator = null; if (IsWebServiceType(type)) { proxyGenerator = new WebServiceClientProxyGenerator(path, debug); webServiceData = new WebServiceData(type, false); } else if (IsPageType(type)) { proxyGenerator = new PageClientProxyGenerator(path, debug); webServiceData = new WebServiceData(type, true); } else if(IsWCFServiceType(type)){ return WCFServiceClientProxyGenerator.GetClientProxyScript(type, path, debug, serviceEndpoint); } else { throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, AtlasWeb.ProxyGenerator_UnsupportedType, type.FullName)); } return proxyGenerator.GetClientProxyScript(webServiceData); } private static bool IsPageType(Type type) { return typeof(System.Web.UI.Page).IsAssignableFrom(type); } private static bool IsWCFServiceType(Type type) { object[] attribs = type.GetCustomAttributes(typeof(ServiceContractAttribute), true); return (attribs.Length != 0); } private static bool IsWebServiceType(Type type) { object[] attribs = type.GetCustomAttributes(typeof(ScriptServiceAttribute), true); return (attribs.Length != 0); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ValueProviderWrapper.cs
- MasterPage.cs
- SqlMetaData.cs
- FlowPanelDesigner.cs
- SafeRightsManagementPubHandle.cs
- RuntimeEnvironment.cs
- EndPoint.cs
- ToolStripDropDownItem.cs
- NetworkStream.cs
- PageThemeCodeDomTreeGenerator.cs
- HierarchicalDataSourceDesigner.cs
- PagerStyle.cs
- NetworkAddressChange.cs
- HttpCacheVaryByContentEncodings.cs
- RoutedEvent.cs
- keycontainerpermission.cs
- ManagementObjectCollection.cs
- HtmlTable.cs
- DataGridCellEditEndingEventArgs.cs
- _SecureChannel.cs
- Opcode.cs
- StateMachine.cs
- RuleSettings.cs
- FormViewInsertedEventArgs.cs
- DeviceContexts.cs
- XmlToDatasetMap.cs
- Baml2006Reader.cs
- HttpListenerException.cs
- UpDownBase.cs
- StylusCollection.cs
- GeneralTransform2DTo3D.cs
- FormViewDeleteEventArgs.cs
- CodeTypeConstructor.cs
- ServerValidateEventArgs.cs
- BackgroundWorker.cs
- ObjectTypeMapping.cs
- SHA512Cng.cs
- SetterBase.cs
- EncryptedType.cs
- ActivityStatusChangeEventArgs.cs
- XamlToRtfParser.cs
- ResourceProviderFactory.cs
- NativeMethods.cs
- CharAnimationUsingKeyFrames.cs
- TabPageDesigner.cs
- AnimatedTypeHelpers.cs
- TagPrefixAttribute.cs
- SemaphoreFullException.cs
- UIElementPropertyUndoUnit.cs
- Compiler.cs
- LowerCaseStringConverter.cs
- Quad.cs
- DesignerCategoryAttribute.cs
- Annotation.cs
- InvalidProgramException.cs
- AlignmentXValidation.cs
- HijriCalendar.cs
- externdll.cs
- UserPersonalizationStateInfo.cs
- DateTimeUtil.cs
- Membership.cs
- HttpException.cs
- EnumValAlphaComparer.cs
- SpinWait.cs
- CodeObject.cs
- SettingsContext.cs
- ZipIOLocalFileBlock.cs
- FileDialogCustomPlacesCollection.cs
- ZipIOBlockManager.cs
- GradientStopCollection.cs
- XsdCachingReader.cs
- AppDomainAttributes.cs
- PointAnimationBase.cs
- SqlCachedBuffer.cs
- DrawingAttributeSerializer.cs
- propertyentry.cs
- TaskHelper.cs
- RouteTable.cs
- GridViewRowPresenterBase.cs
- ConfigurationSectionCollection.cs
- ActiveDocumentEvent.cs
- MgmtResManager.cs
- SqlTypesSchemaImporter.cs
- TypeBuilderInstantiation.cs
- CustomExpression.cs
- HttpHandlerAction.cs
- ImageField.cs
- Privilege.cs
- FormsAuthenticationTicket.cs
- HttpConfigurationContext.cs
- CdpEqualityComparer.cs
- SessionIDManager.cs
- SizeLimitedCache.cs
- JobInputBins.cs
- xmlfixedPageInfo.cs
- SamlAuthorityBinding.cs
- SchemaLookupTable.cs
- tibetanshape.cs
- DataTableCollection.cs
- BamlRecordHelper.cs