Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Description / OperationDescription.cs / 1 / OperationDescription.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Description { using System.Collections.Generic; using System.ServiceModel.Channels; using System.Xml; using System.Runtime.Serialization; using System.Reflection; using System.Collections.ObjectModel; using System.CodeDom; using System.Diagnostics; using System.Net.Security; using System.ServiceModel.Security; [DebuggerDisplay("Name={name}, IsInitiating={isInitiating}, IsTerminating={isTerminating}")] public class OperationDescription { XmlName name; bool isInitiating; bool isTerminating; ContractDescription declaringContract; FaultDescriptionCollection faults; MessageDescriptionCollection messages; KeyedByTypeCollectionbehaviors; Collection knownTypes; MethodInfo beginMethod; MethodInfo endMethod; MethodInfo syncMethod; ProtectionLevel protectionLevel; bool hasProtectionLevel; bool validateRpcWrapperName = true; bool hasNoDisposableParameters; public OperationDescription(string name, ContractDescription declaringContract) { if (name == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("name"); } if (name.Length == 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new ArgumentOutOfRangeException("name", SR.GetString(SR.SFxOperationDescriptionNameCannotBeEmpty))); } this.name = new XmlName(name, true /*isEncoded*/); if (declaringContract == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("declaringContract"); } this.declaringContract = declaringContract; this.isInitiating = true; this.isTerminating = false; this.faults = new FaultDescriptionCollection(); this.messages = new MessageDescriptionCollection(); this.behaviors = new KeyedByTypeCollection (); this.knownTypes = new Collection (); } internal OperationDescription(string name, ContractDescription declaringContract, bool validateRpcWrapperName): this(name, declaringContract) { this.validateRpcWrapperName = validateRpcWrapperName; } public KeyedByTypeCollection Behaviors { get { return behaviors; } } // Not serializable on purpose, metadata import/export cannot // produce it, only available when binding to runtime public MethodInfo SyncMethod { get { return this.syncMethod; } set { this.syncMethod = value; } } // Not serializable on purpose, metadata import/export cannot // produce it, only available when binding to runtime public MethodInfo BeginMethod { get { return this.beginMethod; } set { this.beginMethod = value; } } internal MethodInfo OperationMethod { get { return SyncMethod ?? BeginMethod; } } public ProtectionLevel ProtectionLevel { get { return this.protectionLevel; } set { if (!ProtectionLevelHelper.IsDefined(value)) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value")); this.protectionLevel = value; this.hasProtectionLevel = true; } } public bool HasProtectionLevel { get { return this.hasProtectionLevel; } } internal bool HasNoDisposableParameters { get { return this.hasNoDisposableParameters; } set { this.hasNoDisposableParameters = value; } } // Not serializable on purpose, metadata import/export cannot // produce it, only available when binding to runtime public MethodInfo EndMethod { get { return this.endMethod; } set { this.endMethod = value; } } public ContractDescription DeclaringContract { get { return this.declaringContract; } set { if (value == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("DeclaringContract"); } else { this.declaringContract = value; } } } public FaultDescriptionCollection Faults { get { return faults; } } public bool IsOneWay { get { return this.Messages.Count==1; } } public bool IsInitiating { get { return this.isInitiating; } set { this.isInitiating = value; } } internal bool IsServerInitiated() { EnsureInvariants(); return Messages[0].Direction == MessageDirection.Output; } public bool IsTerminating { get { return this.isTerminating; } set { this.isTerminating = value; } } public Collection KnownTypes { get { return this.knownTypes; } } // Messages[0] is the 'request' (first of MEP), and for non-oneway MEPs, Messages[1] is the 'response' (second of MEP) public MessageDescriptionCollection Messages { get { return messages; } } internal XmlName XmlName { get { return name; } } internal string CodeName { get { return name.DecodedName; } } public string Name { get { return name.EncodedName; } } internal bool IsValidateRpcWrapperName { get { return validateRpcWrapperName; } } internal void EnsureInvariants() { if (this.Messages.Count != 1 && this.Messages.Count != 2) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new System.InvalidOperationException(SR.GetString(SR.SFxOperationMustHaveOneOrTwoMessages, this.Name))); } } internal void ResetProtectionLevel() { this.protectionLevel = ProtectionLevel.None; this.hasProtectionLevel = false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Parameter.cs
- TableLayoutSettings.cs
- ExternalCalls.cs
- DataGridViewCellConverter.cs
- MarkupWriter.cs
- IOException.cs
- ConnectorDragDropGlyph.cs
- MachineKeySection.cs
- CompositeCollectionView.cs
- ParallelQuery.cs
- DrawingContext.cs
- SafeUserTokenHandle.cs
- CompositeDataBoundControl.cs
- ServiceDescriptionSerializer.cs
- ContextInformation.cs
- GroupBoxRenderer.cs
- CursorEditor.cs
- RolePrincipal.cs
- EntityViewContainer.cs
- BrowserDefinition.cs
- MarginsConverter.cs
- XamlReaderHelper.cs
- CounterSample.cs
- KeyPressEvent.cs
- HttpConfigurationContext.cs
- RegexCompilationInfo.cs
- ServiceHost.cs
- TextRangeEditTables.cs
- RuleRefElement.cs
- BStrWrapper.cs
- CodeMethodReturnStatement.cs
- ExpressionBindingsDialog.cs
- Image.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ReferenceConverter.cs
- PropertyValue.cs
- UriWriter.cs
- CatalogZoneBase.cs
- ProfileServiceManager.cs
- ConfigurationManager.cs
- MediaCommands.cs
- PKCS1MaskGenerationMethod.cs
- JavaScriptObjectDeserializer.cs
- BuiltInExpr.cs
- HWStack.cs
- InternalConfigSettingsFactory.cs
- VideoDrawing.cs
- InvalidDataException.cs
- EntityDataSourceState.cs
- NavigationEventArgs.cs
- BuildManagerHost.cs
- RenderData.cs
- OpenFileDialog.cs
- ContentElement.cs
- _NestedSingleAsyncResult.cs
- SQLMoney.cs
- GeneralTransform3DTo2D.cs
- AppDomainUnloadedException.cs
- TransformationRules.cs
- Page.cs
- BitmapEffectDrawingContent.cs
- XmlSchemaSimpleType.cs
- Light.cs
- DeflateStreamAsyncResult.cs
- Exception.cs
- CursorConverter.cs
- WsdlBuildProvider.cs
- BridgeDataReader.cs
- SecurityPolicySection.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- DaylightTime.cs
- ColorConvertedBitmap.cs
- SurrogateEncoder.cs
- SiteMapDataSource.cs
- DataSourceControlBuilder.cs
- ImageList.cs
- XmlTextReader.cs
- SmtpNetworkElement.cs
- RegistryDataKey.cs
- DrawingBrush.cs
- RelationHandler.cs
- TextCharacters.cs
- parserscommon.cs
- SystemFonts.cs
- UInt32Converter.cs
- AttachmentService.cs
- ListViewGroupCollectionEditor.cs
- ScrollBar.cs
- LogExtentCollection.cs
- UnknownBitmapEncoder.cs
- XmlSchemaComplexType.cs
- XmlSchemaFacet.cs
- Point4D.cs
- DelegateTypeInfo.cs
- LinkConverter.cs
- HeaderedContentControl.cs
- BindingList.cs
- ErrorReporting.cs
- SecurityException.cs
- DockPatternIdentifiers.cs