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
- DataGridCell.cs
- ContentPlaceHolder.cs
- TextFormatterContext.cs
- ConnectionsZone.cs
- MaterialGroup.cs
- X509SecurityTokenAuthenticator.cs
- ListViewHitTestInfo.cs
- DateTimeOffsetConverter.cs
- SettingsPropertyCollection.cs
- StylusButton.cs
- CollectionViewGroupRoot.cs
- CharacterMetrics.cs
- ListItemCollection.cs
- AppDomainProtocolHandler.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- TextRangeAdaptor.cs
- TextShapeableCharacters.cs
- MulticastNotSupportedException.cs
- HostingPreferredMapPath.cs
- QueryConverter.cs
- Boolean.cs
- Command.cs
- FileChangesMonitor.cs
- ManualWorkflowSchedulerService.cs
- XPathAncestorQuery.cs
- EntityDataSourceMemberPath.cs
- MessageQueueException.cs
- TreeBuilder.cs
- ThemeConfigurationDialog.cs
- SendKeys.cs
- TypeCollectionPropertyEditor.cs
- CatalogZoneBase.cs
- MetadataArtifactLoaderCompositeFile.cs
- ArraySegment.cs
- HandlerFactoryWrapper.cs
- XmlSerializationWriter.cs
- ContentPresenter.cs
- StoryFragments.cs
- FormsAuthenticationUserCollection.cs
- TextParagraphView.cs
- WebPartManagerInternals.cs
- Stacktrace.cs
- DbDataSourceEnumerator.cs
- HostedTcpTransportManager.cs
- MarkupProperty.cs
- BuildManager.cs
- CroppedBitmap.cs
- CredentialCache.cs
- RoleGroupCollection.cs
- MarkupObject.cs
- CodeNamespaceImportCollection.cs
- TextServicesDisplayAttributePropertyRanges.cs
- CodeParameterDeclarationExpression.cs
- VarRefManager.cs
- SynchronizedKeyedCollection.cs
- NameNode.cs
- LabelEditEvent.cs
- GenericPrincipal.cs
- PictureBox.cs
- DelegatingConfigHost.cs
- SortableBindingList.cs
- PrintingPermissionAttribute.cs
- Positioning.cs
- AdPostCacheSubstitution.cs
- XmlSchemaSimpleContentExtension.cs
- VSWCFServiceContractGenerator.cs
- XPathNodeHelper.cs
- RegexNode.cs
- ZipIOFileItemStream.cs
- RewritingSimplifier.cs
- ContravarianceAdapter.cs
- OrderByBuilder.cs
- LongValidator.cs
- ConstructorExpr.cs
- XLinq.cs
- ItemType.cs
- PrefixQName.cs
- NamedElement.cs
- SqlRetyper.cs
- PerformanceCounterPermission.cs
- HierarchicalDataTemplate.cs
- Tuple.cs
- SelectionItemPatternIdentifiers.cs
- FormattedTextSymbols.cs
- BinaryNegotiation.cs
- FormCollection.cs
- OracleDataAdapter.cs
- DbConnectionPoolGroupProviderInfo.cs
- PowerStatus.cs
- InputProcessorProfiles.cs
- MediaPlayer.cs
- InstanceDataCollectionCollection.cs
- CrossContextChannel.cs
- LateBoundBitmapDecoder.cs
- DataGridTextBox.cs
- WebServiceHandlerFactory.cs
- InputLanguageManager.cs
- DataSourceXmlAttributeAttribute.cs
- LockedHandleGlyph.cs
- ComponentEvent.cs