Code:
/ DotNET / DotNET / 8.0 / untmp / Orcas / RTM / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SmiConnection.cs
- Clause.cs
- BamlResourceContent.cs
- ValidationError.cs
- HostingEnvironmentException.cs
- OleDbConnectionFactory.cs
- ResourceContainer.cs
- Dump.cs
- MSAAEventDispatcher.cs
- MimeMultiPart.cs
- DesignerTextBoxAdapter.cs
- SchemaReference.cs
- CultureInfoConverter.cs
- ThrowHelper.cs
- InstalledFontCollection.cs
- TileBrush.cs
- ScalarRestriction.cs
- Base64Decoder.cs
- DeclarationUpdate.cs
- UrlAuthFailedErrorFormatter.cs
- SecurityElement.cs
- OracleRowUpdatedEventArgs.cs
- QueryOpeningEnumerator.cs
- TreeNodeClickEventArgs.cs
- EntityWrapper.cs
- CapabilitiesState.cs
- Token.cs
- SelectionListComponentEditor.cs
- CommonDialog.cs
- ContextStack.cs
- StorageMappingFragment.cs
- PeerObject.cs
- DataGridViewSelectedColumnCollection.cs
- DynamicMethod.cs
- QueryPageSettingsEventArgs.cs
- FakeModelPropertyImpl.cs
- ValueUtilsSmi.cs
- Base64Stream.cs
- XPathDocument.cs
- ProfileManager.cs
- AssemblyCollection.cs
- HexParser.cs
- FormsAuthenticationEventArgs.cs
- Not.cs
- Symbol.cs
- TablePattern.cs
- AccessDataSourceWizardForm.cs
- ExclusiveCanonicalizationTransform.cs
- SerializationException.cs
- GraphicsPathIterator.cs
- Win32MouseDevice.cs
- PointAnimation.cs
- WebPartDesigner.cs
- DotAtomReader.cs
- ExtendLockAsyncResult.cs
- HttpModuleAction.cs
- XmlStreamStore.cs
- Stack.cs
- WindowsMenu.cs
- StylusTip.cs
- AxisAngleRotation3D.cs
- FixedHighlight.cs
- GridPatternIdentifiers.cs
- ListManagerBindingsCollection.cs
- CertificateElement.cs
- TableProviderWrapper.cs
- XmlSortKeyAccumulator.cs
- Rule.cs
- StringUtil.cs
- FixedSOMImage.cs
- EventLogPropertySelector.cs
- DodSequenceMerge.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- PropertyInfoSet.cs
- WebHttpBindingElement.cs
- DragAssistanceManager.cs
- XPathDocument.cs
- HijriCalendar.cs
- DiagnosticTraceSource.cs
- XmlWrappingReader.cs
- XdrBuilder.cs
- RangeBase.cs
- CanonicalFontFamilyReference.cs
- InstanceContextManager.cs
- AuthenticationException.cs
- XmlReaderSettings.cs
- XsdDuration.cs
- TypeConstant.cs
- SecurityContextCookieSerializer.cs
- TextSerializer.cs
- RIPEMD160Managed.cs
- FullTextBreakpoint.cs
- Matrix3D.cs
- OutputScope.cs
- AppSettingsExpressionBuilder.cs
- UnmanagedMemoryStreamWrapper.cs
- SmtpSection.cs
- _CookieModule.cs
- DataGridColumnHeader.cs
- ApplicationManager.cs