CustomBindingElement 类

定义

表示一个配置节,该配置节提供对用户消息堆栈的完全控制。Represents the configuration section that provides full control over the messaging stack for the user.

public ref class CustomBindingElement : System::ServiceModel::Configuration::NamedServiceModelExtensionCollectionElement<System::ServiceModel::Configuration::BindingElementExtensionElement ^>, System::Collections::Generic::ICollection<System::ServiceModel::Configuration::BindingElementExtensionElement ^>, System::Collections::Generic::IEnumerable<System::ServiceModel::Configuration::BindingElementExtensionElement ^>, System::ServiceModel::Configuration::IBindingConfigurationElement
public class CustomBindingElement : System.ServiceModel.Configuration.NamedServiceModelExtensionCollectionElement<System.ServiceModel.Configuration.BindingElementExtensionElement>, System.Collections.Generic.ICollection<System.ServiceModel.Configuration.BindingElementExtensionElement>, System.Collections.Generic.IEnumerable<System.ServiceModel.Configuration.BindingElementExtensionElement>, System.ServiceModel.Configuration.IBindingConfigurationElement
type CustomBindingElement = class
    inherit NamedServiceModelExtensionCollectionElement<BindingElementExtensionElement>
    interface ICollection<BindingElementExtensionElement>
    interface seq<BindingElementExtensionElement>
    interface IEnumerable
    interface IBindingConfigurationElement
Public Class CustomBindingElement
Inherits NamedServiceModelExtensionCollectionElement(Of BindingElementExtensionElement)
Implements IBindingConfigurationElement, ICollection(Of BindingElementExtensionElement), IEnumerable(Of BindingElementExtensionElement)
继承
实现

注解

自定义绑定提供对 Windows Communication Foundation (WCF) 消息传递堆栈的完全控制。Custom bindings provide full control over the Windows Communication Foundation (WCF) messaging stack. 单个绑定按照堆栈元素在堆栈上出现的顺序来指定它们的配置元素,从而定义消息堆栈。An individual binding defines the message stack by specifying the configuration elements for the stack elements in the order they appear on the stack. 每个元素都定义和配置了该堆栈的一个元素。Each element defines and configures the one element of the stack. 在每个自定义绑定中,必须有且只能有一个传输元素。There must be one and only one transport element in each custom binding. 如果没有该元素,消息堆栈将是不完整的。Without this element, the messaging stack is incomplete.

元素在堆栈中出现的顺序非常重要,因为在将操作应用于消息时会采用该顺序。The order in which elements appear in the stack matters, because it is the order in which operations are applied to the message. 建议的堆栈元素顺序如下:The recommended order of stack elements is the following:

  1. 事务(可选)Transactions (optional)

  2. 可靠消息(可选)Reliable Messaging (optional)

  3. 安全(可选)Security (optional)

  4. 传输Transport

  5. 编码器(可选)Encoder (optional)

构造函数

CustomBindingElement()

初始化 CustomBindingElement 类的新实例。Initializes a new instance of the CustomBindingElement class.

CustomBindingElement(String)

用指定的名称初始化 CustomBindingElement 类的新实例。Initializes a new instance of the CustomBindingElement class with the specified name.

属性

CloseTimeout

获取或设置为完成关闭操作而提供的时间间隔。Gets or sets the interval of time provided for a close operation to complete.

Count

获取此集合中的项数。Gets the number of items in this collection.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
CurrentConfiguration

获取对顶级 Configuration 实例的引用,该实例表示当前 ConfigurationElement 实例所属的配置层次结构。Gets a reference to the top-level Configuration instance that represents the configuration hierarchy that the current ConfigurationElement instance belongs to.

(继承自 ConfigurationElement)
ElementInformation

获取包含 ConfigurationElement 对象的不可自定义的信息和功能的 ElementInformation 对象。Gets an ElementInformation object that contains the non-customizable information and functionality of the ConfigurationElement object.

(继承自 ConfigurationElement)
ElementProperty

获取表示 ConfigurationElement 对象本身的 ConfigurationElementProperty 对象。Gets the ConfigurationElementProperty object that represents the ConfigurationElement object itself.

(继承自 ConfigurationElement)
EvaluationContext

获取 ConfigurationElement 对象的 ContextInformation 对象。Gets the ContextInformation object for the ConfigurationElement object.

(继承自 ConfigurationElement)
HasContext

获取一个值,该值指示 CurrentConfiguration 属性是否为 nullGets a value that indicates whether the CurrentConfiguration property is null.

(继承自 ConfigurationElement)
Item[ConfigurationProperty]

获取或设置此配置元素的属性或特性。Gets or sets a property or attribute of this configuration element.

(继承自 ConfigurationElement)
Item[Int32]

获取集合中指定索引处的项。Gets the item at the specified index within the collection.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
Item[String]

获取或设置此配置元素的属性、特性或子元素。Gets or sets a property, attribute, or child element of this configuration element.

(继承自 ConfigurationElement)
Item[Type]

获取集合中指定类型的项。Gets the item of the specified type within the collection.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
LockAllAttributesExcept

获取被锁定的特性的集合。Gets the collection of locked attributes.

(继承自 ConfigurationElement)
LockAllElementsExcept

获取被锁定的元素的集合。Gets the collection of locked elements.

(继承自 ConfigurationElement)
LockAttributes

获取被锁定的特性的集合。Gets the collection of locked attributes.

(继承自 ConfigurationElement)
LockElements

获取被锁定的元素的集合。Gets the collection of locked elements.

(继承自 ConfigurationElement)
LockItem

获取或设置一个值,该值指示是否已锁定该元素。Gets or sets a value indicating whether the element is locked.

(继承自 ConfigurationElement)
Name

获取或设置此集合的名称。Gets or sets the name of this collection.

(继承自 NamedServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
OpenTimeout

获取或设置为完成打开操作而提供的时间间隔。Gets or sets the interval of time provided for an open operation to complete.

Properties

获取一个 ConfigurationPropertyCollection 实例,该实例包含一个 ConfigurationProperty 对象集合,这些对象可以是此配置元素的特性或 ConfigurationElement 对象。Gets a ConfigurationPropertyCollection instance that contains a collection of ConfigurationProperty objects that can be attributes or ConfigurationElement objects of this configuration element.

ReceiveTimeout

获取或设置为完成接收操作提供的时间间隔。Gets or sets the interval of time provided for a receive operation to complete.

SendTimeout

获取或设置为完成发送操作提供的时间间隔。Gets or sets the interval of time provided for a send operation to complete.

方法

Add(BindingElementExtensionElement)

将指定元素添加到此配置节。Adds the specified element to this configuration section.

Add(TServiceModelExtensionElement)

将指定元素添加到此配置节。Adds the specified element to this configuration section.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
ApplyConfiguration(Binding)

将指定绑定的内容应用于此绑定配置元素。Applies the content of the specified binding to this binding configuration element. 不能继承此方法。This method cannot be inherited.

CanAdd(BindingElementExtensionElement)

将一个新的行为元素添加到此节,并返回一个指示操作是否成功的值。Adds a new behavior element to this section and returns a value indicating if the operation is successful.

CanAdd(TServiceModelExtensionElement)

将一个新的行为元素添加到此节,并返回一个指示操作是否成功的值。Adds a new behavior element to this section and returns a value that indicates whether the operation is successful.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
Clear()

删除此集合中的所有元素。Deletes all elements in this collection. 不能继承此方法。This method cannot be inherited.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
Contains(TServiceModelExtensionElement)

返回一个值,该值指示该集合是否包含特定元素。Returns a value that indicates whether this collection contains a specific element. 不能继承此方法。This method cannot be inherited.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
ContainsKey(String)

确定该集合是否包含指定名称的元素。Determines whether this collection contains an element of the specified name.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
ContainsKey(Type)

确定该集合是否包含指定类型的元素。Determines whether this collection contains an element of the specified type.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
CopyTo(TServiceModelExtensionElement[], Int32)

从目标数组的指定索引处开始,将整个集合复制到兼容的一维数组。Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array. 不能继承此方法。This method cannot be inherited.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
DeserializeElement(XmlReader, Boolean)

从配置文件读取 XML。Reads XML from the configuration file.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
Equals(Object)

将当前的 ConfigurationElement 实例与指定的对象进行比较。Compares the current ConfigurationElement instance to the specified object.

(继承自 ConfigurationElement)
GetEnumerator()

返回可遍历集合的 IEnumeratorReturns an IEnumerator that iterates through a collection. 不能继承此方法。This method cannot be inherited.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
GetHashCode()

获取表示当前 ConfigurationElement 实例的唯一值。Gets a unique value representing the current ConfigurationElement instance.

(继承自 ConfigurationElement)
GetTransformedAssemblyString(String)

返回指定程序集名称的转换版本。Returns the transformed version of the specified assembly name.

(继承自 ConfigurationElement)
GetTransformedTypeString(String)

返回指定类型名称的转换版本。Returns the transformed version of the specified type name.

(继承自 ConfigurationElement)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
Init()

ConfigurationElement 对象设置为其初始状态。Sets the ConfigurationElement object to its initial state.

(继承自 ConfigurationElement)
InitializeDefault()

用于初始化 ConfigurationElement 对象的默认值集。Used to initialize a default set of values for the ConfigurationElement object.

(继承自 ConfigurationElement)
IsModified()

指示自上次保存或加载该配置元素后并在派生类中实现该元素时,该元素是否已被修改。Indicates whether this configuration element has been modified since it was last saved or loaded, when implemented in a derived class.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
IsReadOnly()

获取一个值,该值指示 ConfigurationElement 对象是否为只读。Gets a value indicating whether the ConfigurationElement object is read-only.

(继承自 ConfigurationElement)
ListErrors(IList)

将此 ConfigurationElement 对象以及所有子元素中无效属性的错误添加到传递的列表中。Adds the invalid-property errors in this ConfigurationElement object, and in all subelements, to the passed list.

(继承自 ConfigurationElement)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
OnApplyConfiguration(Binding)

在将指定绑定元素的内容应用于此绑定配置元素时调用。Called when the content of a specified binding element is applied to this binding configuration element.

OnDeserializeUnrecognizedAttribute(String, String)

获取一个值,该值指示反序列化过程中是否遇到未知特性。Gets a value indicating whether an unknown attribute is encountered during deserialization.

(继承自 ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

获取一个值,该值指示反序列化过程中是否遇到未知元素。Gets a value that indicates whether an unknown element is encountered during deserialization.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
OnRequiredPropertyNotFound(String)

找不到所需属性时引发异常。Throws an exception when a required property is not found.

(继承自 ConfigurationElement)
PostDeserialize()

反序列化后调用。Called after deserialization.

(继承自 ConfigurationElement)
PreSerialize(XmlWriter)

在序列化之前调用。Called before serialization.

(继承自 ConfigurationElement)
Remove(TServiceModelExtensionElement)

从集合中移除指定的元素。Removes the specified element from the collection. 不能继承此方法。This method cannot be inherited.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
Reset(ConfigurationElement)

在派生类中重写时,会将此集合重置为其未修改时的状态。Resets this collection to its unmodified state when overridden in a derived class.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
ResetModified()

在派生的类中重写时,将 IsModified() 属性的值重置为 falseResets the value of the IsModified() property to false when overridden in a derived class.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
SerializeElement(XmlWriter, Boolean)

当在派生类中实现后,将此配置元素的内容写入配置文件。Writes the contents of this configuration element to the configuration file when implemented in a derived class.

(继承自 ConfigurationElement)
SerializeToXmlElement(XmlWriter, String)

当在派生类中实现后,将此配置元素的外部标记写入配置文件。Writes the outer tags of this configuration element to the configuration file when implemented in a derived class.

(继承自 ConfigurationElement)
SetIsModified()

为此集合设置 IsModified() 属性。Sets the IsModified() property for this collection.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

将属性设置为指定值。Sets a property to the specified value.

(继承自 ConfigurationElement)
SetReadOnly()

为此集合和所有子元素设置内部 IsReadOnly 属性。Sets the internal IsReadOnly property for this collection and for all sub-elements.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

反转从配置层次结构的不同级别合并配置信息的效果。Reverses the effect of merging configuration information from different levels of the configuration hierarchy.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)

显式界面实现

ICollection<TServiceModelExtensionElement>.IsReadOnly

获取一个值,该值指示此 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement> 是否为只读。Gets a value that indicates whether this ServiceModelExtensionCollectionElement<TServiceModelExtensionElement> is read-only.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)
IEnumerable.GetEnumerator()

返回可遍历集合的 IEnumeratorReturns an IEnumerator that iterates through a collection. 不能继承此方法。This method cannot be inherited.

(继承自 ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>)

扩展方法

CopyToDataTable<T>(IEnumerable<T>)

在给定其泛型参数 TDataTable 的输入 DataRow 对象的情况下,返回包含 IEnumerable<T> 对象副本的 DataRowReturns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>)

返回元素集合,其中包含源集合中每个节点的上级。Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName)

返回经过筛选的元素集合,其中包含源集合中每个节点的上级。Returns a filtered collection of elements that contains the ancestors of every node in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子代节点的集合。Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>)

返回元素集合,其中包含源集合中每个元素和文档的子代元素。Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName)

返回经过筛选的元素集合,其中包含源集合中每个元素和文档的子代元素。Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>)

返回源集合中每个元素和文档的子元素的集合。Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName)

返回源集合中经过筛选的每个元素和文档的子元素集合。Returns a filtered collection of the child elements of every element and document in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>)

返回节点集合(其中包含源集合中的所有节点),并按文档顺序排列。Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子节点集合。Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>)

将源集合中的每个节点从其父节点中移除。Removes every node in the source collection from its parent node.

适用于

另请参阅