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 / ProxyGenerator.cs / 1 / ProxyGenerator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Script.Services { using System; using System.Globalization; using System.Security.Permissions; using System.ServiceModel; using System.Web.Resources; [AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] public static class ProxyGenerator { public static string GetClientProxyScript(Type type, string path, bool debug) { if (type == null) { throw new ArgumentNullException("type"); } if (path == null) { throw new ArgumentNullException("path"); } WebServiceData webServiceData = null; ClientProxyGenerator proxyGenerator = null; if (IsWebServiceType(type)) { proxyGenerator = new WebServiceClientProxyGenerator(path, debug); webServiceData = new WebServiceData(type, false); } else if (IsPageType(type)) { proxyGenerator = new PageClientProxyGenerator(path, debug); webServiceData = new WebServiceData(type, true); } else if(IsWCFServiceType(type)){ return WCFServiceClientProxyGenerator.GetClientProxyScript(type, path, debug); } else { throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, AtlasWeb.ProxyGenerator_UnsupportedType, type.FullName)); } return proxyGenerator.GetClientProxyScript(webServiceData); } private static bool IsPageType(Type type) { return typeof(System.Web.UI.Page).IsAssignableFrom(type); } private static bool IsWCFServiceType(Type type) { object[] attribs = type.GetCustomAttributes(typeof(ServiceContractAttribute), true); return (attribs.Length != 0); } private static bool IsWebServiceType(Type type) { object[] attribs = type.GetCustomAttributes(typeof(ScriptServiceAttribute), true); return (attribs.Length != 0); } } } // 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; using System.Globalization; using System.Security.Permissions; using System.ServiceModel; using System.Web.Resources; [AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] public static class ProxyGenerator { public static string GetClientProxyScript(Type type, string path, bool debug) { if (type == null) { throw new ArgumentNullException("type"); } if (path == null) { throw new ArgumentNullException("path"); } WebServiceData webServiceData = null; ClientProxyGenerator proxyGenerator = null; if (IsWebServiceType(type)) { proxyGenerator = new WebServiceClientProxyGenerator(path, debug); webServiceData = new WebServiceData(type, false); } else if (IsPageType(type)) { proxyGenerator = new PageClientProxyGenerator(path, debug); webServiceData = new WebServiceData(type, true); } else if(IsWCFServiceType(type)){ return WCFServiceClientProxyGenerator.GetClientProxyScript(type, path, debug); } else { throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, AtlasWeb.ProxyGenerator_UnsupportedType, type.FullName)); } return proxyGenerator.GetClientProxyScript(webServiceData); } private static bool IsPageType(Type type) { return typeof(System.Web.UI.Page).IsAssignableFrom(type); } private static bool IsWCFServiceType(Type type) { object[] attribs = type.GetCustomAttributes(typeof(ServiceContractAttribute), true); return (attribs.Length != 0); } private static bool IsWebServiceType(Type type) { object[] attribs = type.GetCustomAttributes(typeof(ScriptServiceAttribute), true); return (attribs.Length != 0); } } } // 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
- SrgsNameValueTag.cs
- CfgArc.cs
- TargetControlTypeAttribute.cs
- SpotLight.cs
- OptimizerPatterns.cs
- ContentDisposition.cs
- ISAPIWorkerRequest.cs
- FileUpload.cs
- DataGridTablesFactory.cs
- LocationSectionRecord.cs
- PathFigure.cs
- FlowchartDesigner.Helpers.cs
- EntityDataSourceStatementEditorForm.cs
- SqlXmlStorage.cs
- RootProfilePropertySettingsCollection.cs
- JapaneseLunisolarCalendar.cs
- RecordManager.cs
- DataGridColumnHeader.cs
- ConsoleCancelEventArgs.cs
- InkCanvasInnerCanvas.cs
- GrowingArray.cs
- SmtpMail.cs
- ExtendedProtectionPolicyElement.cs
- RTLAwareMessageBox.cs
- SqlDataSourceConfigureSortForm.cs
- SQLBytesStorage.cs
- SiteMap.cs
- _BasicClient.cs
- AxisAngleRotation3D.cs
- CheckBoxRenderer.cs
- SiteMapDataSource.cs
- DataViewSettingCollection.cs
- Color.cs
- RichTextBoxContextMenu.cs
- SkewTransform.cs
- ProcessModuleCollection.cs
- TextViewDesigner.cs
- Popup.cs
- DataServiceProcessingPipelineEventArgs.cs
- BlockUIContainer.cs
- XmlSchemaImport.cs
- Frame.cs
- DatePickerAutomationPeer.cs
- FontSizeConverter.cs
- ComplexLine.cs
- HttpFileCollection.cs
- XamlSerializerUtil.cs
- ExpressionLink.cs
- Rect3DConverter.cs
- SecureStringHasher.cs
- SchemaNotation.cs
- WebPartEditorOkVerb.cs
- QuaternionValueSerializer.cs
- DataSvcMapFileSerializer.cs
- DataGridRelationshipRow.cs
- prompt.cs
- altserialization.cs
- IndexedGlyphRun.cs
- GenericIdentity.cs
- AttachedPropertyMethodSelector.cs
- UpdateException.cs
- EqualityArray.cs
- DetailsViewInsertEventArgs.cs
- Operators.cs
- Bookmark.cs
- codemethodreferenceexpression.cs
- ISessionStateStore.cs
- GridPattern.cs
- PageResolution.cs
- SmiRecordBuffer.cs
- ToolStripItemClickedEventArgs.cs
- FormattedTextSymbols.cs
- GeometryCollection.cs
- TextBox.cs
- GeneralTransformCollection.cs
- TypeDescriptor.cs
- CellTreeNode.cs
- TableLayoutSettingsTypeConverter.cs
- NavigationPropertySingletonExpression.cs
- Hyperlink.cs
- SqlDeflator.cs
- OleDbWrapper.cs
- HttpWriter.cs
- OperationCanceledException.cs
- ComplexTypeEmitter.cs
- HuffmanTree.cs
- MsdtcWrapper.cs
- CompositeKey.cs
- SelectedDatesCollection.cs
- DataServiceClientException.cs
- entityreference_tresulttype.cs
- StyleCollection.cs
- SoapSchemaExporter.cs
- PermissionListSet.cs
- AnimatedTypeHelpers.cs
- Normalizer.cs
- ByteAnimationUsingKeyFrames.cs
- DrawingContext.cs
- MobileCapabilities.cs
- MenuDesigner.cs