Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / xsp / System / Web / Extensions / Script / Services / ProxyGenerator.cs / 1 / ProxyGenerator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Script.Services { using System; using System.Globalization; using System.Security.Permissions; using System.ServiceModel; using System.Web.Resources; [AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] public static class ProxyGenerator { public static string GetClientProxyScript(Type type, string path, bool debug) { 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); } 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. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Script.Services { using System; using System.Globalization; using System.Security.Permissions; using System.ServiceModel; using System.Web.Resources; [AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] public static class ProxyGenerator { public static string GetClientProxyScript(Type type, string path, bool debug) { 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); } 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
- OutputCacheProfile.cs
- MetaForeignKeyColumn.cs
- ValidationPropertyAttribute.cs
- IPeerNeighbor.cs
- AssemblyInfo.cs
- MachineKeyConverter.cs
- CodeVariableDeclarationStatement.cs
- PreservationFileWriter.cs
- Utils.cs
- _ConnectionGroup.cs
- BooleanAnimationBase.cs
- HitTestDrawingContextWalker.cs
- EUCJPEncoding.cs
- RegexCode.cs
- LayoutDump.cs
- OleDbPermission.cs
- BamlResourceContent.cs
- PersonalizationProvider.cs
- EncryptedXml.cs
- BrushValueSerializer.cs
- Symbol.cs
- PackageProperties.cs
- streamingZipPartStream.cs
- MissingMethodException.cs
- HostingEnvironment.cs
- HTMLTagNameToTypeMapper.cs
- ScriptRegistrationManager.cs
- SendActivityDesignerTheme.cs
- SafeArrayRankMismatchException.cs
- EndpointAddressAugust2004.cs
- JavaScriptSerializer.cs
- StreamingContext.cs
- View.cs
- PropertyInfoSet.cs
- TextFindEngine.cs
- DesignerTransaction.cs
- BinaryFormatterWriter.cs
- GridViewPageEventArgs.cs
- TextPointerBase.cs
- TemplateXamlParser.cs
- SQLDouble.cs
- Margins.cs
- MenuScrollingVisibilityConverter.cs
- Grammar.cs
- _HTTPDateParse.cs
- SignedPkcs7.cs
- CommandDesigner.cs
- WorkflowRuntimeEndpoint.cs
- FixedSOMPageElement.cs
- HtmlLink.cs
- SqlDataSourceFilteringEventArgs.cs
- SoapClientProtocol.cs
- QueueProcessor.cs
- WsatStrings.cs
- CursorInteropHelper.cs
- KeyGesture.cs
- XdrBuilder.cs
- WebBaseEventKeyComparer.cs
- UiaCoreTypesApi.cs
- FilteredSchemaElementLookUpTable.cs
- XpsFilter.cs
- MinimizableAttributeTypeConverter.cs
- GridViewRowPresenterBase.cs
- DataContractSet.cs
- ToolboxItemAttribute.cs
- XmlNavigatorFilter.cs
- DataReceivedEventArgs.cs
- RoutedEventConverter.cs
- MarkupExtensionSerializer.cs
- ImagingCache.cs
- ParserContext.cs
- mediaeventshelper.cs
- GeneralTransform3DTo2DTo3D.cs
- DesignerCategoryAttribute.cs
- SafeEventLogWriteHandle.cs
- HttpProcessUtility.cs
- SchemaImporterExtensionElement.cs
- GeneralTransformGroup.cs
- XomlSerializationHelpers.cs
- Assembly.cs
- NativeStructs.cs
- XmlNamespaceManager.cs
- HttpResponseMessageProperty.cs
- SafeFileMapViewHandle.cs
- Queue.cs
- ImportDesigner.xaml.cs
- FileLoadException.cs
- NetworkInformationPermission.cs
- ListBoxChrome.cs
- OuterGlowBitmapEffect.cs
- NavigationProperty.cs
- UrlMapping.cs
- QilStrConcatenator.cs
- ModuleConfigurationInfo.cs
- wmiprovider.cs
- NameValueSectionHandler.cs
- Property.cs
- RoleManagerSection.cs
- PropertyPathConverter.cs
- Int64AnimationUsingKeyFrames.cs