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
- TemplatedMailWebEventProvider.cs
- OptimisticConcurrencyException.cs
- KernelTypeValidation.cs
- FrameworkContentElement.cs
- DataSourceComponent.cs
- ManagementOperationWatcher.cs
- SelectionPatternIdentifiers.cs
- HandledMouseEvent.cs
- EnterpriseServicesHelper.cs
- StyleSelector.cs
- PropertyTabChangedEvent.cs
- TextLineResult.cs
- AssertUtility.cs
- DSASignatureFormatter.cs
- RemotingConfigParser.cs
- ApplicationProxyInternal.cs
- AsymmetricCryptoHandle.cs
- DataTableTypeConverter.cs
- ManagementOperationWatcher.cs
- assemblycache.cs
- WhiteSpaceTrimStringConverter.cs
- WebBaseEventKeyComparer.cs
- ChtmlFormAdapter.cs
- MouseCaptureWithinProperty.cs
- BufferedWebEventProvider.cs
- DelimitedListTraceListener.cs
- RadioButtonFlatAdapter.cs
- UIElementParaClient.cs
- RC2.cs
- DiagnosticTraceSource.cs
- ObjectHelper.cs
- CategoryAttribute.cs
- CodeGenerator.cs
- TreeNode.cs
- BuilderPropertyEntry.cs
- WebPartVerbsEventArgs.cs
- ClosableStream.cs
- DrawTreeNodeEventArgs.cs
- BaseConfigurationRecord.cs
- ActivationServices.cs
- EncoderReplacementFallback.cs
- XmlDataDocument.cs
- XmlEntity.cs
- PathFigureCollectionConverter.cs
- ExpressionSelection.cs
- ConfigurationErrorsException.cs
- ComboBox.cs
- DbProviderSpecificTypePropertyAttribute.cs
- HelpProvider.cs
- BamlTreeUpdater.cs
- CellTreeNodeVisitors.cs
- TargetException.cs
- DataRowExtensions.cs
- coordinatorfactory.cs
- SpecularMaterial.cs
- SqlFunctionAttribute.cs
- TextServicesManager.cs
- BinaryObjectWriter.cs
- CompositeCollectionView.cs
- LogAppendAsyncResult.cs
- _OverlappedAsyncResult.cs
- ArithmeticException.cs
- PtsHelper.cs
- PropertyEntry.cs
- AppLevelCompilationSectionCache.cs
- Filter.cs
- ModuleElement.cs
- ChangeTracker.cs
- NativeMethods.cs
- ToolStripLabel.cs
- SoapObjectReader.cs
- TypedTableBase.cs
- SortKey.cs
- ColumnResizeAdorner.cs
- DataGridHelper.cs
- MimeReflector.cs
- BinaryReader.cs
- SoapParser.cs
- BrowserCapabilitiesFactory.cs
- CodeNamespaceImport.cs
- DescendantBaseQuery.cs
- DummyDataSource.cs
- FileDataSourceCache.cs
- TypeLibConverter.cs
- XmlSchemaCollection.cs
- OciEnlistContext.cs
- BitmapVisualManager.cs
- RoutedEventValueSerializer.cs
- ISCIIEncoding.cs
- TrackingServices.cs
- SafeRightsManagementQueryHandle.cs
- XmlBinaryReader.cs
- NumberSubstitution.cs
- ThreadInterruptedException.cs
- SamlAuthorityBinding.cs
- UniqueID.cs
- OrderablePartitioner.cs
- ArrangedElementCollection.cs
- DeploymentSectionCache.cs
- BackgroundFormatInfo.cs