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
- TrustManagerMoreInformation.cs
- DefaultValidator.cs
- Errors.cs
- UnsafeNativeMethods.cs
- CalendarAutomationPeer.cs
- XmlResolver.cs
- MatrixAnimationUsingPath.cs
- RawStylusSystemGestureInputReport.cs
- FormViewPageEventArgs.cs
- Size.cs
- DataGridViewTextBoxCell.cs
- AssemblyCollection.cs
- Soap12ProtocolReflector.cs
- SearchForVirtualItemEventArgs.cs
- SspiSafeHandles.cs
- DecimalAnimationUsingKeyFrames.cs
- TableLayoutSettingsTypeConverter.cs
- DelegatedStream.cs
- XmlSchemaImport.cs
- DataServiceRequest.cs
- XmlAttribute.cs
- QilName.cs
- PackagePart.cs
- ADMembershipProvider.cs
- UIEndRequest.cs
- SafeNativeMemoryHandle.cs
- OpenTypeLayout.cs
- TitleStyle.cs
- RequestCacheValidator.cs
- DBDataPermissionAttribute.cs
- SystemNetworkInterface.cs
- EditBehavior.cs
- JsonSerializer.cs
- uribuilder.cs
- SmiTypedGetterSetter.cs
- XmlReflectionMember.cs
- WebConfigurationFileMap.cs
- ThrowHelper.cs
- QueryOperationResponseOfT.cs
- SingleResultAttribute.cs
- DataGridColumn.cs
- RtfFormatStack.cs
- ContractMapping.cs
- InfoCardCryptoHelper.cs
- TreeChangeInfo.cs
- InvalidComObjectException.cs
- GatewayDefinition.cs
- Rotation3DAnimation.cs
- WhitespaceReader.cs
- QilNode.cs
- RadialGradientBrush.cs
- DropTarget.cs
- CodeArrayCreateExpression.cs
- util.cs
- HeaderLabel.cs
- TraceSection.cs
- Oid.cs
- SMSvcHost.cs
- LocationSectionRecord.cs
- OleCmdHelper.cs
- DBDataPermissionAttribute.cs
- GreenMethods.cs
- XmlSchemaAppInfo.cs
- XmlSchemaExternal.cs
- CollectionBase.cs
- SinglePhaseEnlistment.cs
- HttpHandlerActionCollection.cs
- ScriptReferenceBase.cs
- StandardBindingOptionalReliableSessionElement.cs
- DocumentsTrace.cs
- uribuilder.cs
- UIElement3D.cs
- ContainerCodeDomSerializer.cs
- PropertyTab.cs
- Confirm.cs
- CriticalFinalizerObject.cs
- KeysConverter.cs
- ResourceReader.cs
- Match.cs
- StringDictionary.cs
- QueueProcessor.cs
- GridViewItemAutomationPeer.cs
- SqlXml.cs
- DefaultExpressionVisitor.cs
- BitmapEffectGroup.cs
- StringAnimationBase.cs
- CommonProperties.cs
- PropertyInfoSet.cs
- ActivationArguments.cs
- FileUtil.cs
- Utils.cs
- IisTraceWebEventProvider.cs
- DynamicPropertyHolder.cs
- NamedPipeActivation.cs
- SchemaNames.cs
- DataGridViewRowCancelEventArgs.cs
- ObjectComplexPropertyMapping.cs
- ObjectSelectorEditor.cs
- SkewTransform.cs
- TextEditorCopyPaste.cs