C# Class System.Xml.Xsl.Runtime.XmlAttributeCache

This writer supports only writer methods which write attributes. Attributes are stored in a data structure until StartElementContent() is called, at which time the attributes are flushed to the wrapped writer. In the case of duplicate attributes, the last attribute's value is used.
Inheritance: System.Xml.XmlRawWriter, IRemovableWriter
Exibir arquivo Open project: gbarnett/shared-source-cli-2.0 Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Forward call to wrapped writer.

Flush ( ) : void

Forward call to wrapped writer.

Init ( XmlRawWriter wrapped ) : void

Initialize the cache. Use this method instead of a constructor in order to reuse the cache.

WriteComment ( string text ) : void
WriteEndAttribute ( ) : void

No-op.

WriteEntityRef ( string name ) : void
WriteProcessingInstruction ( string name, string text ) : void
WriteStartAttribute ( string prefix, string localName, string ns ) : void

Add an attribute to the cache. If an attribute if the same name already exists, replace it.

WriteStartElement ( string prefix, string localName, string ns ) : void
WriteString ( string text ) : void

Add a block of text to the cache. This text block makes up some or all of the untyped string value of the current attribute.

WriteValue ( object value ) : void

All other WriteValue methods are implemented by XmlWriter to delegate to WriteValue(object) or WriteValue(string), so only these two methods need to be implemented.

WriteValue ( string value ) : void

Private Methods

Method Description
EnsureAttributeCache ( ) : void

Ensure that attribute array has been created and is large enough for at least one additional entry.

FlushAttributes ( ) : void
SetWrappedWriter ( XmlRawWriter writer ) : void

The wrapped writer will callback on this method if it wishes to remove itself from the pipeline.

StartElementContent ( ) : void

Send cached, non-overriden attributes to the specified writer. Calling this method has the side effect of clearing the attribute cache.

WriteEndElement ( string prefix, string localName, string ns ) : void
WriteNamespaceDeclaration ( string prefix, string ns ) : void

Pass through namespaces to underlying writer. If any attributes have been cached, flush them.

Method Details

Close() public method

Forward call to wrapped writer.
public Close ( ) : void
return void

Flush() public method

Forward call to wrapped writer.
public Flush ( ) : void
return void

Init() public method

Initialize the cache. Use this method instead of a constructor in order to reuse the cache.
public Init ( XmlRawWriter wrapped ) : void
wrapped System.Xml.XmlRawWriter
return void

WriteComment() public method

public WriteComment ( string text ) : void
text string
return void

WriteEndAttribute() public method

No-op.
public WriteEndAttribute ( ) : void
return void

WriteEntityRef() public method

public WriteEntityRef ( string name ) : void
name string
return void

WriteProcessingInstruction() public method

public WriteProcessingInstruction ( string name, string text ) : void
name string
text string
return void

WriteStartAttribute() public method

Add an attribute to the cache. If an attribute if the same name already exists, replace it.
public WriteStartAttribute ( string prefix, string localName, string ns ) : void
prefix string
localName string
ns string
return void

WriteStartElement() public method

public WriteStartElement ( string prefix, string localName, string ns ) : void
prefix string
localName string
ns string
return void

WriteString() public method

Add a block of text to the cache. This text block makes up some or all of the untyped string value of the current attribute.
public WriteString ( string text ) : void
text string
return void

WriteValue() public method

All other WriteValue methods are implemented by XmlWriter to delegate to WriteValue(object) or WriteValue(string), so only these two methods need to be implemented.
public WriteValue ( object value ) : void
value object
return void

WriteValue() public method

public WriteValue ( string value ) : void
value string
return void