In This Article

IXmlContext Interface

Provides the base requirements for information about the XML context of a certain offset within an ITextSnapshot.

public interface IXmlContext

Properties

ElementHierarchy

A read-only list of IXmlElementContext objects that describes the element hierarchy.

IList<IXmlElementContext>? ElementHierarchy { get; }

Property Value

IList<IXmlElementContext>

Remarks

The element hierarchy is the list of parent elements that contain the current offset.

InitializationSnapshotRange

The TextSnapshotRange with which the context was initialized.

TextSnapshotRange? InitializationSnapshotRange { get; }

Property Value

TextSnapshotRange?

NamespaceDeclarations

The mapping dictionary of namespace to namespace prefixes that are declared at the context.

IDictionary<string, string>? NamespaceDeclarations { get; }

Property Value

IDictionary<string, string>

Remarks

The dictionary keys are namespaces and the values are namespace prefixes.

SchemaResolver

The IXmlSchemaResolver to use.

IXmlSchemaResolver? SchemaResolver { get; }

Property Value

IXmlSchemaResolver

SnapshotOffset

The TextSnapshotOffset for which this context was created.

TextSnapshotOffset SnapshotOffset { get; }

Property Value

TextSnapshotOffset

TargetAttribute

The IXmlAttributeContext that contains context information related to the target attribute.

IXmlAttributeContext? TargetAttribute { get; }

Property Value

IXmlAttributeContext

Remarks

This property is only populated if the context is related to an attribute.

TargetElement

The IXmlElementContext that contains context information related to the target element.

IXmlElementContext? TargetElement { get; }

Property Value

IXmlElementContext

Remarks

This property is only populated if the context is related to an element or attribute.

Type

An XmlContextType that specifies the type of context.

XmlContextType Type { get; }

Property Value

XmlContextType

Extension Methods