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 / PageClientProxyGenerator.cs / 1 / PageClientProxyGenerator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Script.Services { using System.Web; using System.Web.UI; internal class PageClientProxyGenerator : ClientProxyGenerator { private string _path; internal PageClientProxyGenerator(IPage page, bool debug) : this(page.Request.FilePath, debug) { } internal PageClientProxyGenerator(string path, bool debug) { _path = path; _debugMode = debug; } internal static string GetClientProxyScript(HttpContext context, IPage page, bool debug) { // Do nothing during unit tests which have no context or page if (context == null || page == null) return null; WebServiceData webServiceData = WebServiceData.GetWebServiceData(context, page.AppRelativeVirtualPath, false /*failIfNoData*/, true /*pageMethods */); if (webServiceData == null) return null; PageClientProxyGenerator proxyGenerator = new PageClientProxyGenerator(page, debug); return proxyGenerator.GetClientProxyScript(webServiceData); } protected override void GenerateTypeDeclaration(WebServiceData webServiceData, bool genClass) { if (genClass) { _builder.Append("PageMethods.prototype = "); } else { _builder.Append("var PageMethods = "); } } protected override string GetProxyTypeName(WebServiceData data) { return "PageMethods"; } protected override string GetProxyPath() { return _path; } } } // 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.Web; using System.Web.UI; internal class PageClientProxyGenerator : ClientProxyGenerator { private string _path; internal PageClientProxyGenerator(IPage page, bool debug) : this(page.Request.FilePath, debug) { } internal PageClientProxyGenerator(string path, bool debug) { _path = path; _debugMode = debug; } internal static string GetClientProxyScript(HttpContext context, IPage page, bool debug) { // Do nothing during unit tests which have no context or page if (context == null || page == null) return null; WebServiceData webServiceData = WebServiceData.GetWebServiceData(context, page.AppRelativeVirtualPath, false /*failIfNoData*/, true /*pageMethods */); if (webServiceData == null) return null; PageClientProxyGenerator proxyGenerator = new PageClientProxyGenerator(page, debug); return proxyGenerator.GetClientProxyScript(webServiceData); } protected override void GenerateTypeDeclaration(WebServiceData webServiceData, bool genClass) { if (genClass) { _builder.Append("PageMethods.prototype = "); } else { _builder.Append("var PageMethods = "); } } protected override string GetProxyTypeName(WebServiceData data) { return "PageMethods"; } protected override string GetProxyPath() { return _path; } } } // 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
- EndOfStreamException.cs
- DefaultAuthorizationContext.cs
- XmlCustomFormatter.cs
- Pair.cs
- PackageDigitalSignature.cs
- DataGridTablesFactory.cs
- MouseButtonEventArgs.cs
- ListView.cs
- ExpandSegmentCollection.cs
- FactoryId.cs
- InvokeWebService.cs
- DbConnectionStringCommon.cs
- DesignerCategoryAttribute.cs
- ApplicationFileParser.cs
- ManagedFilter.cs
- ImageInfo.cs
- SystemFonts.cs
- KnownTypeAttribute.cs
- CategoryEditor.cs
- DataRow.cs
- AccessDataSourceView.cs
- WebBrowserSiteBase.cs
- DataColumnPropertyDescriptor.cs
- NavigationEventArgs.cs
- WeakReferenceEnumerator.cs
- IsolatedStorageException.cs
- WorkflowEventArgs.cs
- TextEditorSpelling.cs
- CachedPathData.cs
- XmlIncludeAttribute.cs
- EnumType.cs
- ConfigXmlReader.cs
- BatchServiceHost.cs
- SimpleRecyclingCache.cs
- SimpleHandlerBuildProvider.cs
- Helper.cs
- EntityViewGenerator.cs
- ReferencedAssembly.cs
- KeyedCollection.cs
- PrePrepareMethodAttribute.cs
- NamedPipeAppDomainProtocolHandler.cs
- XmlValueConverter.cs
- CodeValidator.cs
- CaretElement.cs
- TcpClientChannel.cs
- ArgumentValidation.cs
- ActivationServices.cs
- SoapIncludeAttribute.cs
- BaseResourcesBuildProvider.cs
- ButtonFieldBase.cs
- EntityDataSourceWrapper.cs
- ParserOptions.cs
- Positioning.cs
- AttachInfo.cs
- ScriptingProfileServiceSection.cs
- RecognitionResult.cs
- DBSchemaTable.cs
- BindingSource.cs
- AsyncOperationManager.cs
- TextServicesDisplayAttribute.cs
- Model3D.cs
- ItemCollection.cs
- ComplexLine.cs
- DocumentViewer.cs
- TextEditorContextMenu.cs
- Point.cs
- DataGridTextBox.cs
- DateTimeFormat.cs
- EntityContainer.cs
- HttpStreamXmlDictionaryReader.cs
- AnnotationStore.cs
- TerminateSequence.cs
- MultiPartWriter.cs
- RelationshipNavigation.cs
- SQLInt16.cs
- CodeIdentifiers.cs
- VisualProxy.cs
- DownloadProgressEventArgs.cs
- formatter.cs
- IndicShape.cs
- DashStyle.cs
- CqlLexerHelpers.cs
- WebPartTransformer.cs
- RemoteCryptoTokenProvider.cs
- HttpProfileGroupBase.cs
- CodeMethodReturnStatement.cs
- NetWebProxyFinder.cs
- DbDataSourceEnumerator.cs
- Configuration.cs
- SequentialUshortCollection.cs
- RoutedUICommand.cs
- TypeNameConverter.cs
- ToolStripGrip.cs
- LambdaCompiler.Address.cs
- ExtendedPropertyDescriptor.cs
- SortedDictionary.cs
- SearchForVirtualItemEventArgs.cs
- ToolboxBitmapAttribute.cs
- ProxyWebPartManager.cs
- MdiWindowListStrip.cs