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
- XmlSchemaType.cs
- Substitution.cs
- FilteredAttributeCollection.cs
- ObjectNotFoundException.cs
- XPathMessageFilterTable.cs
- XPathParser.cs
- StringBuilder.cs
- Command.cs
- SystemException.cs
- TemplateControl.cs
- FontCacheLogic.cs
- XmlSchemaObject.cs
- SecurityElement.cs
- UrlPath.cs
- Win32.cs
- CellNormalizer.cs
- LazyTextWriterCreator.cs
- SqlCharStream.cs
- TimersDescriptionAttribute.cs
- FullTrustAssembly.cs
- Menu.cs
- AutoScrollExpandMessageFilter.cs
- X509IssuerSerialKeyIdentifierClause.cs
- DynamicVirtualDiscoSearcher.cs
- SspiNegotiationTokenProvider.cs
- CaseExpr.cs
- MultipartContentParser.cs
- RegexGroupCollection.cs
- Line.cs
- Transform3DCollection.cs
- ReferentialConstraintRoleElement.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- TypedElement.cs
- PropertyValueUIItem.cs
- SizeKeyFrameCollection.cs
- _TimerThread.cs
- AtomMaterializerLog.cs
- DatePickerDateValidationErrorEventArgs.cs
- DataColumnCollection.cs
- ResourceType.cs
- _SslState.cs
- PropertyDescriptorCollection.cs
- LogicalExpr.cs
- ExtractorMetadata.cs
- TextDecorations.cs
- ImageListUtils.cs
- DataFieldConverter.cs
- StylusEventArgs.cs
- QuaternionRotation3D.cs
- StrokeDescriptor.cs
- GuidTagList.cs
- ToolStripHighContrastRenderer.cs
- cookiecollection.cs
- autovalidator.cs
- Panel.cs
- RegistryDataKey.cs
- TemplateParser.cs
- HttpModulesSection.cs
- MiniParameterInfo.cs
- RegionInfo.cs
- SerializerProvider.cs
- DragEvent.cs
- XmlSchemaSet.cs
- CharacterMetrics.cs
- EastAsianLunisolarCalendar.cs
- PerformanceCounterNameAttribute.cs
- RenderData.cs
- TabletDeviceInfo.cs
- querybuilder.cs
- UICuesEvent.cs
- NetDataContractSerializer.cs
- HttpCachePolicyWrapper.cs
- XmlSchemaAttributeGroup.cs
- SqlProfileProvider.cs
- BindingValueChangedEventArgs.cs
- OrderPreservingSpoolingTask.cs
- FixedHyperLink.cs
- MatrixTransform3D.cs
- SignatureHelper.cs
- Floater.cs
- QilReference.cs
- GeometryDrawing.cs
- Task.cs
- DataPointer.cs
- NamedPipeChannelListener.cs
- ConnectionStringsExpressionBuilder.cs
- FieldTemplateFactory.cs
- Parameter.cs
- ComponentEditorPage.cs
- RegistryConfigurationProvider.cs
- WmiEventSink.cs
- GridViewEditEventArgs.cs
- EnlistmentTraceIdentifier.cs
- ConfigLoader.cs
- RadialGradientBrush.cs
- Triplet.cs
- InputScopeConverter.cs
- ScrollChrome.cs
- CharKeyFrameCollection.cs
- ListViewItem.cs