Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- HwndSource.cs
- SqlClientMetaDataCollectionNames.cs
- ScrollPatternIdentifiers.cs
- ParagraphVisual.cs
- XsltFunctions.cs
- XmlSignificantWhitespace.cs
- HostedTransportConfigurationBase.cs
- DependencySource.cs
- ScriptResourceHandler.cs
- Crc32Helper.cs
- Speller.cs
- BinarySecretSecurityToken.cs
- XsdBuilder.cs
- SqlProfileProvider.cs
- Item.cs
- Label.cs
- MimeFormatExtensions.cs
- MobileUserControl.cs
- XmlRawWriter.cs
- Int64Storage.cs
- MessageFilterException.cs
- UserControlBuildProvider.cs
- ButtonFieldBase.cs
- ParsedAttributeCollection.cs
- TextPenaltyModule.cs
- ReferenceConverter.cs
- DataGridViewCellParsingEventArgs.cs
- ToolStripPanelCell.cs
- PackagingUtilities.cs
- InspectionWorker.cs
- MetadataItem_Static.cs
- X509RecipientCertificateServiceElement.cs
- ReadOnlyAttribute.cs
- ToolStripManager.cs
- DataStreamFromComStream.cs
- TcpClientChannel.cs
- xsdvalidator.cs
- DataGridColumnHeadersPresenter.cs
- LateBoundBitmapDecoder.cs
- QilStrConcatenator.cs
- GeneratedCodeAttribute.cs
- ProfileServiceManager.cs
- WorkflowViewStateService.cs
- ColorDialog.cs
- WebPartMinimizeVerb.cs
- DeploymentSection.cs
- ListBoxChrome.cs
- CorrelationManager.cs
- ServiceHttpHandlerFactory.cs
- WsatTransactionInfo.cs
- ChannelTokenTypeConverter.cs
- XLinq.cs
- DoubleUtil.cs
- _SafeNetHandles.cs
- WriterOutput.cs
- RotateTransform.cs
- HyperLinkDesigner.cs
- LifetimeServices.cs
- FormViewPageEventArgs.cs
- Int64KeyFrameCollection.cs
- LoadRetryAsyncResult.cs
- MarshalDirectiveException.cs
- DataGridGeneralPage.cs
- SelectedDatesCollection.cs
- XmlChildNodes.cs
- TimelineCollection.cs
- WebPartDisplayModeCollection.cs
- TimerElapsedEvenArgs.cs
- ApplicationDirectory.cs
- ExtendedProperty.cs
- Light.cs
- SystemResources.cs
- UnsafeNativeMethods.cs
- WebPartsSection.cs
- PointLight.cs
- TemplateNameScope.cs
- processwaithandle.cs
- EntityParameter.cs
- ContentElementAutomationPeer.cs
- MetadataLocation.cs
- Rectangle.cs
- Tuple.cs
- WebPermission.cs
- arabicshape.cs
- HttpDebugHandler.cs
- FormViewDeleteEventArgs.cs
- PersonalizationStateInfoCollection.cs
- StringOutput.cs
- ClientScriptManager.cs
- BinaryWriter.cs
- Size.cs
- ObjectSet.cs
- Int32Collection.cs
- PersonalizableTypeEntry.cs
- ListenerElementsCollection.cs
- PropertyDescriptorComparer.cs
- StateMachineDesignerPaint.cs
- SID.cs
- MimeTypeAttribute.cs
- AnimationStorage.cs