Loads Xml data via the Content system
View code on GitHub
Inheritance Hierarchy
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
The XmlContent type exposes the following members.
Constructors
Name | Description | |
---|---|---|
XmlContent | Initializes a new instance of the XmlContent class |
Methods
Name | Description | |
---|---|---|
CreateDefault | (Inherited from ContentData.) | |
Dispose | (Inherited from ContentData.) | |
DisposeData | (Overrides ContentData DisposeData .) | |
InternalCreateDefault | (Inherited from ContentData.) | |
LoadData | (Overrides ContentData LoadData(Stream).) | |
ToString | (Inherited from ContentData.) |
Fields
Name | Description | |
---|---|---|
ContentChanged | (Inherited from ContentData.) |
Properties
Name | Description | |
---|---|---|
AllowCreationIfContentNotFound | (Inherited from ContentData.) | |
Data | ||
IsDisposed | (Inherited from ContentData.) | |
MetaData | (Inherited from ContentData.) | |
Name | (Inherited from ContentData.) |
Remarks
Examples
[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