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
- InternalPermissions.cs
- OracleCommandSet.cs
- CompilerInfo.cs
- WmpBitmapEncoder.cs
- SecuritySessionClientSettings.cs
- ListViewGroup.cs
- PropertyEmitter.cs
- SqlResolver.cs
- DataGridViewColumnCollection.cs
- StringArrayConverter.cs
- ManagementQuery.cs
- Int64Converter.cs
- UInt64Converter.cs
- ResourceBinder.cs
- StickyNote.cs
- ApplicationSecurityInfo.cs
- SqlFileStream.cs
- assemblycache.cs
- DelimitedListTraceListener.cs
- ACL.cs
- CurrencyWrapper.cs
- WebConfigurationHost.cs
- NonVisualControlAttribute.cs
- RemotingConfigParser.cs
- PenContext.cs
- AnimationClockResource.cs
- PKCS1MaskGenerationMethod.cs
- SqlStatistics.cs
- BitConverter.cs
- CategoryGridEntry.cs
- ResourceReader.cs
- Pair.cs
- DBAsyncResult.cs
- CatalogPartDesigner.cs
- ContentValidator.cs
- SecurityContext.cs
- UInt64.cs
- SqlExpressionNullability.cs
- EventLogLink.cs
- TypeGeneratedEventArgs.cs
- CommandField.cs
- QueryConverter.cs
- SafeCryptContextHandle.cs
- RuleInfoComparer.cs
- XmlToDatasetMap.cs
- MsmqHostedTransportConfiguration.cs
- StickyNoteHelper.cs
- FixedLineResult.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- SyndicationLink.cs
- LicenseException.cs
- MultiBinding.cs
- MarkupExtensionSerializer.cs
- Root.cs
- DesignerDataConnection.cs
- OleDbConnection.cs
- SendKeys.cs
- MappedMetaModel.cs
- PagedDataSource.cs
- FixedSOMLineRanges.cs
- CheckBoxAutomationPeer.cs
- Path.cs
- PartitionerQueryOperator.cs
- RMPermissions.cs
- XmlAnyAttributeAttribute.cs
- StateMachineSubscription.cs
- ObjectDataSourceDisposingEventArgs.cs
- SmtpReplyReaderFactory.cs
- PartialList.cs
- BlobPersonalizationState.cs
- PointCollection.cs
- CodeCatchClauseCollection.cs
- XNodeNavigator.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- SecurityState.cs
- XMLSchema.cs
- XamlFigureLengthSerializer.cs
- InteropAutomationProvider.cs
- ImageKeyConverter.cs
- AutoCompleteStringCollection.cs
- HttpCookie.cs
- EntityTransaction.cs
- TextTreeUndo.cs
- WebPartVerbCollection.cs
- X509CertificateEndpointIdentity.cs
- EqualityComparer.cs
- ByteStreamMessageEncoder.cs
- SQLDoubleStorage.cs
- ProcessExitedException.cs
- DrawingContextWalker.cs
- SqlDataSourceConfigureFilterForm.cs
- GridItemCollection.cs
- SHA512Managed.cs
- SqlDependencyListener.cs
- StorageMappingItemLoader.cs
- DataGridViewBand.cs
- SafeFindHandle.cs
- DesignTimeTemplateParser.cs
- MultipleViewPattern.cs
- SamlConditions.cs