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
- StrokeCollection2.cs
- FontCacheUtil.cs
- DetailsViewInsertEventArgs.cs
- ColumnResizeUndoUnit.cs
- SqlCommandSet.cs
- CodeChecksumPragma.cs
- BaseDataList.cs
- HttpApplication.cs
- LinqDataSourceSelectEventArgs.cs
- ListViewSelectEventArgs.cs
- LicenseManager.cs
- SBCSCodePageEncoding.cs
- TextTreeDeleteContentUndoUnit.cs
- OdbcConnectionString.cs
- ButtonField.cs
- StateChangeEvent.cs
- SmtpSection.cs
- BinaryObjectInfo.cs
- XmlBinaryWriterSession.cs
- WpfXamlLoader.cs
- BitArray.cs
- XsltSettings.cs
- StylusDownEventArgs.cs
- BamlStream.cs
- Inflater.cs
- _SslStream.cs
- GridViewItemAutomationPeer.cs
- TimeSpanValidatorAttribute.cs
- XmlSchemaSimpleTypeList.cs
- SqlDelegatedTransaction.cs
- UriTemplateLiteralPathSegment.cs
- EmptyCollection.cs
- FatalException.cs
- DoWhileDesigner.xaml.cs
- PropertyGroupDescription.cs
- IBuiltInEvidence.cs
- HashFinalRequest.cs
- Int16Storage.cs
- FaultHandlingFilter.cs
- SelectionManager.cs
- CacheChildrenQuery.cs
- ModuleConfigurationInfo.cs
- UnhandledExceptionEventArgs.cs
- DispatchWrapper.cs
- CharStorage.cs
- UpDownBase.cs
- SqlDataSourceStatusEventArgs.cs
- ConnectionStringSettingsCollection.cs
- CompilerInfo.cs
- RsaKeyIdentifierClause.cs
- VisualBrush.cs
- ObjectContextServiceProvider.cs
- dtdvalidator.cs
- DesignerVerbCollection.cs
- DependencyPropertyChangedEventArgs.cs
- ReceiveContent.cs
- EntityTransaction.cs
- Vector3DCollectionConverter.cs
- DesignerDataColumn.cs
- WebPartsPersonalizationAuthorization.cs
- CompoundFileReference.cs
- glyphs.cs
- BitmapEffectDrawingContent.cs
- ReadOnlyTernaryTree.cs
- SimpleTypeResolver.cs
- CopyNodeSetAction.cs
- LookupTables.cs
- FormViewDeleteEventArgs.cs
- MappingItemCollection.cs
- CodeExporter.cs
- SHA384Cng.cs
- Invariant.cs
- SqlDuplicator.cs
- SchemaElementDecl.cs
- SerializationStore.cs
- UDPClient.cs
- Baml2006Reader.cs
- ActivityExecutionContextCollection.cs
- OperandQuery.cs
- HtmlInputHidden.cs
- DeflateStream.cs
- ImageBrush.cs
- TreeViewItem.cs
- ReaderWriterLock.cs
- Debugger.cs
- FixedTextSelectionProcessor.cs
- SqlServices.cs
- TTSEngineTypes.cs
- CryptoConfig.cs
- LightweightEntityWrapper.cs
- LinqDataSourceInsertEventArgs.cs
- StorageTypeMapping.cs
- SRGSCompiler.cs
- Token.cs
- DbConnectionClosed.cs
- ClientScriptItemCollection.cs
- PropertyGridView.cs
- AstNode.cs
- DataServiceExpressionVisitor.cs
- PageVisual.cs