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
- CellPartitioner.cs
- XXXInfos.cs
- IListConverters.cs
- DateTimeOffset.cs
- XPathSingletonIterator.cs
- PipeConnection.cs
- ZipIOCentralDirectoryFileHeader.cs
- XPathBinder.cs
- DesignerMetadata.cs
- BordersPage.cs
- WorkflowMarkupSerializationManager.cs
- Registry.cs
- EncoderParameter.cs
- ListViewUpdateEventArgs.cs
- FacetDescription.cs
- HuffCodec.cs
- RowType.cs
- RegionInfo.cs
- ListViewItemMouseHoverEvent.cs
- BuildProvider.cs
- ObjectRef.cs
- DocumentScope.cs
- SmtpReplyReaderFactory.cs
- EntityDescriptor.cs
- JulianCalendar.cs
- TdsRecordBufferSetter.cs
- ParameterModifier.cs
- elementinformation.cs
- TypedColumnHandler.cs
- XslAstAnalyzer.cs
- UIElementPropertyUndoUnit.cs
- CellParaClient.cs
- securitycriticaldataformultiplegetandset.cs
- HijriCalendar.cs
- TcpServerChannel.cs
- DebuggerAttributes.cs
- BufferedGraphics.cs
- ToolStripContextMenu.cs
- TableLayoutColumnStyleCollection.cs
- Hash.cs
- SQLGuidStorage.cs
- XsltSettings.cs
- AbandonedMutexException.cs
- EventProviderClassic.cs
- ReaderWriterLockWrapper.cs
- WebResourceAttribute.cs
- BaseProcessor.cs
- WindowsTab.cs
- ClientSettingsProvider.cs
- CodePropertyReferenceExpression.cs
- SqlDataSourceDesigner.cs
- ACE.cs
- ToolStripDropDown.cs
- ConfigurationException.cs
- DockingAttribute.cs
- DBCommandBuilder.cs
- Timer.cs
- DataStorage.cs
- EventWaitHandle.cs
- RemoteHelper.cs
- ListSortDescription.cs
- EnumerableRowCollectionExtensions.cs
- XmlObjectSerializerContext.cs
- Size3DConverter.cs
- BrowserCapabilitiesFactory.cs
- AccessViolationException.cs
- WebSysDisplayNameAttribute.cs
- WeakReferenceList.cs
- Debug.cs
- Tuple.cs
- ResourceExpressionBuilder.cs
- Control.cs
- EventLogQuery.cs
- Point3D.cs
- UndoUnit.cs
- TraceHandlerErrorFormatter.cs
- TreeView.cs
- Rect3DConverter.cs
- JsonQueryStringConverter.cs
- WebPartsSection.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- AuthenticationSection.cs
- ExternalFile.cs
- ParseChildrenAsPropertiesAttribute.cs
- LookupBindingPropertiesAttribute.cs
- HwndSubclass.cs
- Latin1Encoding.cs
- IDQuery.cs
- WindowVisualStateTracker.cs
- TrackingValidationObjectDictionary.cs
- UnsafeNativeMethods.cs
- MimeParameters.cs
- ColumnPropertiesGroup.cs
- EntityObject.cs
- MetadataSource.cs
- XmlQueryStaticData.cs
- StringFormat.cs
- Converter.cs
- BrowserInteropHelper.cs
- ReadOnlyHierarchicalDataSourceView.cs