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
- OuterGlowBitmapEffect.cs
- FormsAuthenticationCredentials.cs
- WebPartConnectionsEventArgs.cs
- InternalBufferOverflowException.cs
- UdpContractFilterBehavior.cs
- Dispatcher.cs
- XmlDeclaration.cs
- Win32.cs
- WebPartExportVerb.cs
- RecordManager.cs
- StructuralCache.cs
- PropertyOrder.cs
- PerfCounters.cs
- BatchStream.cs
- MappingMetadataHelper.cs
- Rect.cs
- AppDomainResourcePerfCounters.cs
- _Rfc2616CacheValidators.cs
- SamlAction.cs
- FormsIdentity.cs
- NumericExpr.cs
- PackagingUtilities.cs
- MetaModel.cs
- ProxyGenerationError.cs
- QuotedPrintableStream.cs
- Select.cs
- __Filters.cs
- SettingsBindableAttribute.cs
- EndpointDiscoveryBehavior.cs
- DictionaryGlobals.cs
- TargetInvocationException.cs
- _OverlappedAsyncResult.cs
- HostVisual.cs
- NumberFormatInfo.cs
- BufferedWebEventProvider.cs
- EnumValAlphaComparer.cs
- StateWorkerRequest.cs
- WindowsFont.cs
- PropVariant.cs
- ModelTypeConverter.cs
- ProjectionRewriter.cs
- DesignerRegionMouseEventArgs.cs
- ExclusiveCanonicalizationTransform.cs
- DataChangedEventManager.cs
- ReturnEventArgs.cs
- Rotation3DAnimationBase.cs
- ImageEditor.cs
- MSAAEventDispatcher.cs
- DataGridTextBox.cs
- PixelShader.cs
- RowType.cs
- HttpServerVarsCollection.cs
- WebPartConnectVerb.cs
- PropertyConverter.cs
- PersistenceTypeAttribute.cs
- InputMethodStateTypeInfo.cs
- LogAppendAsyncResult.cs
- TextRangeEdit.cs
- TrailingSpaceComparer.cs
- WebBrowser.cs
- GreenMethods.cs
- SQLInt32.cs
- Identity.cs
- ProfileModule.cs
- AdapterSwitches.cs
- MgmtConfigurationRecord.cs
- XsltException.cs
- CriticalFinalizerObject.cs
- Native.cs
- ZipQueryOperator.cs
- SqlRecordBuffer.cs
- controlskin.cs
- StorageMappingItemCollection.cs
- AnnotationHelper.cs
- WorkflowLayouts.cs
- SctClaimSerializer.cs
- XamlDesignerSerializationManager.cs
- XmlAnyElementAttributes.cs
- DrawListViewColumnHeaderEventArgs.cs
- BooleanFunctions.cs
- xml.cs
- PageContentAsyncResult.cs
- ZipIOBlockManager.cs
- Ticks.cs
- TextEditorThreadLocalStore.cs
- LicenseContext.cs
- CounterSample.cs
- TextEffect.cs
- LogSwitch.cs
- ReverseInheritProperty.cs
- NullReferenceException.cs
- SQLConvert.cs
- Throw.cs
- SamlAttribute.cs
- NegationPusher.cs
- DocumentStatusResources.cs
- DateTimeFormatInfo.cs
- InputQueueChannelAcceptor.cs
- NotifyIcon.cs
- URLIdentityPermission.cs