Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- MarginsConverter.cs
- DefaultAssemblyResolver.cs
- HttpHandlerActionCollection.cs
- QueryReaderSettings.cs
- ListViewGroupCollectionEditor.cs
- InternalCache.cs
- DbBuffer.cs
- Form.cs
- ContainerUIElement3D.cs
- MulticastNotSupportedException.cs
- Literal.cs
- SqlDataSourceFilteringEventArgs.cs
- SiteMapNode.cs
- ToolStripSeparator.cs
- PKCS1MaskGenerationMethod.cs
- InputBuffer.cs
- StreamInfo.cs
- FacetValues.cs
- securitymgrsite.cs
- MeasureItemEvent.cs
- CustomTypeDescriptor.cs
- Schedule.cs
- EntityDataSourceWrapper.cs
- ObjectManager.cs
- AstNode.cs
- ellipse.cs
- UIElementCollection.cs
- ButtonPopupAdapter.cs
- ApplicationServiceManager.cs
- UserControl.cs
- QuadraticBezierSegment.cs
- ConnectionManagementElement.cs
- ClockController.cs
- WindowsServiceCredential.cs
- WindowsBrush.cs
- MultipleViewPattern.cs
- IdnElement.cs
- FocusTracker.cs
- SamlAuthenticationStatement.cs
- StyleModeStack.cs
- PrinterResolution.cs
- SafeJobHandle.cs
- DataListItemCollection.cs
- DataTableMappingCollection.cs
- ConfigXmlText.cs
- ActiveXContainer.cs
- WebUtil.cs
- OdbcUtils.cs
- WebPartExportVerb.cs
- FontWeightConverter.cs
- FormattedTextSymbols.cs
- SchemaObjectWriter.cs
- linebase.cs
- ApplicationGesture.cs
- ClientUtils.cs
- WebHttpEndpoint.cs
- SwitchLevelAttribute.cs
- RewritingValidator.cs
- PageThemeCodeDomTreeGenerator.cs
- _ContextAwareResult.cs
- TripleDESCryptoServiceProvider.cs
- DataGridItemEventArgs.cs
- ImageListImage.cs
- Events.cs
- InvalidOleVariantTypeException.cs
- SafeHandles.cs
- HttpWebResponse.cs
- DataGridDesigner.cs
- TableParaClient.cs
- XmlNodeList.cs
- ImportFileRequest.cs
- BitmapEffectInput.cs
- LoadedEvent.cs
- WebConfigurationFileMap.cs
- Size.cs
- UnionCodeGroup.cs
- Errors.cs
- ZipPackage.cs
- TheQuery.cs
- ClearCollection.cs
- AnnotationComponentManager.cs
- ResourceExpressionEditor.cs
- RotateTransform3D.cs
- EventLog.cs
- CodePrimitiveExpression.cs
- ActivitySurrogate.cs
- X509ThumbprintKeyIdentifierClause.cs
- NavigationProperty.cs
- InProcStateClientManager.cs
- OracleTimeSpan.cs
- StylusShape.cs
- MarkerProperties.cs
- TimerElapsedEvenArgs.cs
- Parameter.cs
- HttpListenerRequest.cs
- CompilationUtil.cs
- PartialClassGenerationTask.cs
- ColorConvertedBitmap.cs
- ClientCultureInfo.cs
- SqlDataSourceCache.cs