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
- XmlSchemaInfo.cs
- ParseChildrenAsPropertiesAttribute.cs
- ReflectionTypeLoadException.cs
- MailAddressCollection.cs
- ObjectListCommandEventArgs.cs
- DataGridViewRowStateChangedEventArgs.cs
- CodeCompiler.cs
- DataGridViewCellStyle.cs
- StreamGeometry.cs
- FixedSOMTableCell.cs
- CommandDesigner.cs
- EventProviderTraceListener.cs
- EventLogPermissionEntryCollection.cs
- WindowsProgressbar.cs
- SynchronizedKeyedCollection.cs
- QuaternionKeyFrameCollection.cs
- RuleProcessor.cs
- DesignerCapabilities.cs
- _Connection.cs
- FigureParaClient.cs
- ProcessStartInfo.cs
- ValidationUtility.cs
- FlowDocumentScrollViewer.cs
- DataObjectCopyingEventArgs.cs
- SecurityTokenValidationException.cs
- TabPage.cs
- TimeSpanStorage.cs
- Comparer.cs
- DocumentApplicationJournalEntry.cs
- EntityDesignerUtils.cs
- ZoneButton.cs
- WeakRefEnumerator.cs
- ColorConverter.cs
- DesignerEditorPartChrome.cs
- CodeThrowExceptionStatement.cs
- MimeTypeMapper.cs
- storepermission.cs
- CreateSequence.cs
- ToolboxItem.cs
- DoubleLink.cs
- WCFBuildProvider.cs
- Marshal.cs
- TdsParserSafeHandles.cs
- xamlnodes.cs
- BaseValidator.cs
- DataPagerFieldItem.cs
- FlowNode.cs
- BinaryCommonClasses.cs
- PriorityQueue.cs
- DbFunctionCommandTree.cs
- EdmProperty.cs
- PagePropertiesChangingEventArgs.cs
- JsonMessageEncoderFactory.cs
- PerformanceCounterManager.cs
- AccessDataSourceView.cs
- WindowsGrip.cs
- EnumerableWrapperWeakToStrong.cs
- Rotation3D.cs
- FontNameConverter.cs
- BindingListCollectionView.cs
- Configuration.cs
- CustomTrackingQuery.cs
- XmlChoiceIdentifierAttribute.cs
- EventBookmark.cs
- MembershipSection.cs
- Exception.cs
- WinFormsUtils.cs
- SqlBooleanMismatchVisitor.cs
- HScrollBar.cs
- UidManager.cs
- PanelStyle.cs
- Merger.cs
- SqlBulkCopyColumnMappingCollection.cs
- ConfigXmlWhitespace.cs
- XmlUTF8TextWriter.cs
- CodeMemberField.cs
- SecurityTokenParametersEnumerable.cs
- CustomErrorCollection.cs
- DataBoundControl.cs
- SubpageParagraph.cs
- MsmqHostedTransportManager.cs
- WebPartCatalogCloseVerb.cs
- PolicyValidationException.cs
- OutputCacheSection.cs
- PropertyChangedEventArgs.cs
- PageBuildProvider.cs
- Vector3DKeyFrameCollection.cs
- BinaryObjectWriter.cs
- SamlSubjectStatement.cs
- NamedPermissionSet.cs
- WebServiceHandler.cs
- IDictionary.cs
- Timeline.cs
- XmlSerializerOperationFormatter.cs
- QilVisitor.cs
- TablePatternIdentifiers.cs
- GrabHandleGlyph.cs
- StatusBarItem.cs
- RootBrowserWindowAutomationPeer.cs
- DiagnosticEventProvider.cs