Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- FontStretchConverter.cs
- TimersDescriptionAttribute.cs
- ZipIOCentralDirectoryBlock.cs
- ListView.cs
- _DomainName.cs
- MetabaseServerConfig.cs
- Stacktrace.cs
- CheckBoxField.cs
- IndentTextWriter.cs
- HttpModulesSection.cs
- DictationGrammar.cs
- EnlistmentTraceIdentifier.cs
- FileVersionInfo.cs
- FontStyleConverter.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- PointHitTestResult.cs
- ObjectConverter.cs
- XmlBuffer.cs
- ValidationErrorInfo.cs
- HttpWebResponse.cs
- WebPartConnectionsConnectVerb.cs
- DateTime.cs
- GeometryGroup.cs
- Collection.cs
- Transactions.cs
- XmlAttributeAttribute.cs
- Panel.cs
- FactoryMaker.cs
- SymmetricAlgorithm.cs
- DictionaryBase.cs
- ProviderBase.cs
- HttpWebResponse.cs
- ImportDesigner.xaml.cs
- ContentPresenter.cs
- OutputScope.cs
- ManagementNamedValueCollection.cs
- AlphabeticalEnumConverter.cs
- EntityContainerEntitySet.cs
- Win32MouseDevice.cs
- CompareValidator.cs
- SelectorAutomationPeer.cs
- EventSourceCreationData.cs
- ProfilePropertySettings.cs
- HttpListenerPrefixCollection.cs
- SiteMapNodeCollection.cs
- HttpPostProtocolReflector.cs
- SslStream.cs
- SpellerStatusTable.cs
- SignedXml.cs
- RectAnimationBase.cs
- DifferencingCollection.cs
- ResourceContainer.cs
- UIElement3D.cs
- SetterTriggerConditionValueConverter.cs
- BezierSegment.cs
- PerformanceCounterPermissionEntryCollection.cs
- SystemEvents.cs
- XamlDesignerSerializationManager.cs
- RectangleGeometry.cs
- XmlSchemaAnyAttribute.cs
- SqlConnection.cs
- ToolStripItemRenderEventArgs.cs
- XmlReflectionImporter.cs
- DbConnectionStringBuilder.cs
- FontFamilyConverter.cs
- ContextTokenTypeConverter.cs
- Int64Storage.cs
- QualificationDataAttribute.cs
- ProfilePropertyNameValidator.cs
- ASCIIEncoding.cs
- FieldBuilder.cs
- MatrixIndependentAnimationStorage.cs
- AuthenticationSection.cs
- SiteMapDesignerDataSourceView.cs
- ModuleBuilderData.cs
- PointCollectionValueSerializer.cs
- SelectionManager.cs
- AuthenticationServiceManager.cs
- BinaryNode.cs
- XmlJsonWriter.cs
- ExpressionNode.cs
- Thickness.cs
- EmbeddedMailObjectsCollection.cs
- InfoCardSymmetricCrypto.cs
- Expr.cs
- InspectionWorker.cs
- DBCommand.cs
- WebPartTransformerCollection.cs
- SqlSupersetValidator.cs
- OrderedDictionary.cs
- ContextProperty.cs
- _FixedSizeReader.cs
- returneventsaver.cs
- XmlAttributes.cs
- BitmapCodecInfo.cs
- BitmapFrameDecode.cs
- StrokeNodeOperations2.cs
- URLMembershipCondition.cs
- LineInfo.cs
- TriState.cs