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
- ImageListStreamer.cs
- KeyboardNavigation.cs
- Int16AnimationBase.cs
- TabItem.cs
- DockingAttribute.cs
- DerivedKeyCachingSecurityTokenSerializer.cs
- Globals.cs
- BindingList.cs
- TextDecorationCollectionConverter.cs
- Debug.cs
- ProtocolsConfiguration.cs
- PersistenceTypeAttribute.cs
- MatchingStyle.cs
- ListManagerBindingsCollection.cs
- GridViewDeleteEventArgs.cs
- DbProviderSpecificTypePropertyAttribute.cs
- TabItemAutomationPeer.cs
- ToolStripDropDownMenu.cs
- ButtonStandardAdapter.cs
- Quad.cs
- AppModelKnownContentFactory.cs
- ClrPerspective.cs
- WindowsListViewSubItem.cs
- ServiceParser.cs
- BinaryObjectReader.cs
- TextBlock.cs
- FlowDocumentReaderAutomationPeer.cs
- ForeignKeyConstraint.cs
- ObjectQueryState.cs
- InputMethodStateTypeInfo.cs
- ImmComposition.cs
- ImageSource.cs
- MediaContextNotificationWindow.cs
- AuthenticationService.cs
- StylusCollection.cs
- TrackingProfileSerializer.cs
- StateMachineWorkflowInstance.cs
- HttpSocketManager.cs
- SqlInternalConnection.cs
- ComContractElement.cs
- EnvironmentPermission.cs
- DataGridItemEventArgs.cs
- ReflectionPermission.cs
- DataRecord.cs
- WindowsContainer.cs
- TypeSystem.cs
- SetterBase.cs
- HttpValueCollection.cs
- CurrencyManager.cs
- FontWeights.cs
- CheckBoxRenderer.cs
- VisualStyleInformation.cs
- XmlSchemaSimpleTypeUnion.cs
- SubMenuStyle.cs
- SQLUtility.cs
- KeyToListMap.cs
- AdRotator.cs
- FlowDocumentPageViewerAutomationPeer.cs
- WMICapabilities.cs
- DllNotFoundException.cs
- FactoryMaker.cs
- PageParserFilter.cs
- ExcCanonicalXml.cs
- ClientReliableChannelBinder.cs
- ContentValidator.cs
- XmlQueryStaticData.cs
- TraceHelpers.cs
- WebPartEditorApplyVerb.cs
- OrderPreservingSpoolingTask.cs
- PolicyLevel.cs
- MiniMapControl.xaml.cs
- ParentControlDesigner.cs
- OSEnvironmentHelper.cs
- MappingSource.cs
- SwitchAttribute.cs
- BitmapMetadataBlob.cs
- SupportsPreviewControlAttribute.cs
- ControlEvent.cs
- Environment.cs
- TextEffectResolver.cs
- AutoGeneratedField.cs
- XmlSchemaDatatype.cs
- DataPointer.cs
- ColorContext.cs
- SiteMapProvider.cs
- FakeModelItemImpl.cs
- ReachBasicContext.cs
- MeasurementDCInfo.cs
- Panel.cs
- HashSetEqualityComparer.cs
- SubpageParagraph.cs
- IsolatedStorageFileStream.cs
- DefaultMemberAttribute.cs
- VectorCollection.cs
- TiffBitmapEncoder.cs
- BuiltInPermissionSets.cs
- CustomGrammar.cs
- TableRowCollection.cs
- DataServiceBehavior.cs
- ISO2022Encoding.cs