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
- TimeSpanValidator.cs
- QilExpression.cs
- LeftCellWrapper.cs
- TreeNodeBinding.cs
- SlipBehavior.cs
- ToolStripPanelRenderEventArgs.cs
- WebPartManagerInternals.cs
- WindowsFormsSynchronizationContext.cs
- NavigationCommands.cs
- BaseComponentEditor.cs
- ValidationHelpers.cs
- RootProjectionNode.cs
- DynamicRendererThreadManager.cs
- MetadataWorkspace.cs
- DataGridItemCollection.cs
- FixedTextPointer.cs
- DuplicateWaitObjectException.cs
- ModelPerspective.cs
- serverconfig.cs
- ManipulationDelta.cs
- DBSqlParserColumn.cs
- AccessorTable.cs
- LongValidatorAttribute.cs
- PopupControlService.cs
- ResourceReferenceExpression.cs
- VisualTarget.cs
- ByteStack.cs
- PointHitTestParameters.cs
- ACE.cs
- AddInAttribute.cs
- ScriptControl.cs
- EnumerableCollectionView.cs
- ConstructorNeedsTagAttribute.cs
- ContainerFilterService.cs
- QueryCacheKey.cs
- CharKeyFrameCollection.cs
- XmlEntity.cs
- ObjectStateFormatter.cs
- DataSourceCacheDurationConverter.cs
- WebServiceClientProxyGenerator.cs
- CaseKeyBox.xaml.cs
- AdditionalEntityFunctions.cs
- ListViewGroupCollectionEditor.cs
- CodeArrayIndexerExpression.cs
- Collection.cs
- Message.cs
- SiteMap.cs
- ReferenceSchema.cs
- DeferredRunTextReference.cs
- VisualBasicSettingsHandler.cs
- MSHTMLHost.cs
- WebPartDisplayModeCancelEventArgs.cs
- ToolStripDesignerAvailabilityAttribute.cs
- TransformConverter.cs
- ConfigurationSectionGroup.cs
- WindowsBrush.cs
- BitmapEncoder.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- AttributeInfo.cs
- AxisAngleRotation3D.cs
- DataSourceHelper.cs
- RootBrowserWindow.cs
- MappingSource.cs
- StatusBarItem.cs
- LambdaCompiler.cs
- ScriptResourceHandler.cs
- ContainsRowNumberChecker.cs
- PropertyInformation.cs
- WpfKnownType.cs
- SplashScreen.cs
- SynthesizerStateChangedEventArgs.cs
- XmlSchemaComplexContent.cs
- ManifestSignatureInformation.cs
- CheckableControlBaseAdapter.cs
- DateTimeStorage.cs
- ControlCollection.cs
- TypeAccessException.cs
- CommonXSendMessage.cs
- CorrelationManager.cs
- ApplicationActivator.cs
- InitiatorServiceModelSecurityTokenRequirement.cs
- TextReturnReader.cs
- MailWebEventProvider.cs
- AssemblyNameEqualityComparer.cs
- Classification.cs
- Missing.cs
- InternalDispatchObject.cs
- QueryStringParameter.cs
- ConnectionInterfaceCollection.cs
- ToolboxCategory.cs
- XMLUtil.cs
- GridViewPageEventArgs.cs
- FixedFlowMap.cs
- CopyCodeAction.cs
- SByte.cs
- ValueQuery.cs
- DoWhile.cs
- SapiRecoContext.cs
- ConfigurationStrings.cs
- documentsequencetextcontainer.cs