XmlContent ClassDelta Engine Documentation
Loads Xml data via the Content system View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Content ContentData
    DeltaEngine.Content.Xml XmlContent
      CreepyTowers DialoguesXml
      CreepyTowers.Enemy.Creeps GroupPropertiesXml
      CreepyTowers PropertiesXml
      DeltaEngine.Content.Mocks MockXmlContent
      DeltaEngine.Content.Xml InputCommands
      DeltaEngine.Content.Xml Localization
      DeltaEngine.Rendering2D.Fonts Font

Namespace: DeltaEngine.Content.Xml
Assembly: DeltaEngine.Content.Xml (in DeltaEngine.Content.Xml.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class XmlContent : ContentData

The XmlContent type exposes the following members.

Constructors

  NameDescription
Protected methodXmlContent
Initializes a new instance of the XmlContent class
Top
Methods

  NameDescription
Protected methodCreateDefault (Inherited from ContentData.)
Public methodDispose (Inherited from ContentData.)
Protected methodDisposeData (Overrides ContentData DisposeData .)
Public methodInternalCreateDefault (Inherited from ContentData.)
Protected methodLoadData (Overrides ContentData LoadData(Stream).)
Public methodToString (Inherited from ContentData.)
Top
Fields

  NameDescription
Protected fieldContentChanged (Inherited from ContentData.)
Top
Properties

  NameDescription
Protected propertyAllowCreationIfContentNotFound (Inherited from ContentData.)
Public propertyData
Public propertyIsDisposed (Inherited from ContentData.)
Public propertyMetaData (Inherited from ContentData.)
Public propertyName (Inherited from ContentData.)
Top
Remarks

Tests: DeltaEngine.Content.Xml.Tests.XmlContentTests
Examples

3 unit tests call DeltaEngine.Content.Xml.XmlContent
[Test]
public void LoadXmlContentFromMock()
{
    var xmlContent = ContentLoader.Load<XmlContent>("Test");
    Assert.False(xmlContent.IsDisposed);
    Assert.AreEqual("Root", xmlContent.Data.Name);
    Assert.AreEqual(1, xmlContent.Data.Children.Count);
    Assert.AreEqual("Hi", xmlContent.Data.Children[0].Name);
    xmlContent.Dispose();
}
[Test]
public void LoadXmlContentFromNonExistingFile()
{
    var xmlContent = ContentLoader.Load<XmlContent>("NonExisting");
    Assert.AreEqual("NonExisting", xmlContent.Data.Name);
}
[Test, Category("Slow"), Ignore]
public void LoadXmlContentFromFile()
{
    var xmlContent = ContentLoader.Load<XmlContent>("Test");
    Assert.False(xmlContent.IsDisposed);
    Assert.AreEqual("Root", xmlContent.Data.Name);
    Assert.AreEqual(1, xmlContent.Data.Children.Count);
    Assert.AreEqual("Hi", xmlContent.Data.Children[0].Name);
}
See Also