DiskContentLoader ClassDelta Engine Documentation
Loads and caches files directly from disk using an xml file created earlier by ContentManager to get all content meta data (names, types, last time updated, pixel size, etc.) View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Content ContentLoader
    DeltaEngine.Content.Disk DiskContentLoader

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

public sealed class DiskContentLoader : ContentLoader

The DiskContentLoader type exposes the following members.

Methods

  NameDescription
Protected methodClearBufferedResourcesAndMetaData (Inherited from ContentLoader.)
Public methodDispose (Inherited from ContentLoader.)
Protected methodGetContentDataStream (Inherited from ContentLoader.)
Public methodGetMetaData (Overrides ContentLoader GetMetaData(String, Type).)
Protected methodHasValidContentMetaDataFile (Overrides ContentLoader HasValidContentMetaDataFile .)
Protected methodReloadContent (Inherited from ContentLoader.)
Top
Fields

  NameDescription
Protected fieldmetaData (Inherited from ContentLoader.)
Top
Properties

  NameDescription
Protected propertyContentMetaDataFilePath (Inherited from ContentLoader.)
Public propertyContentProjectPath (Inherited from ContentLoader.)
Public propertyLastTimeUpdated (Overrides ContentLoader LastTimeUpdated.)
Public propertyStartedToRequestOnlineContent (Inherited from ContentLoader.)
Top
Remarks

Tests: DeltaEngine.Content.Disk.Tests.DiskContentLoaderTests
Examples

11 unit tests call DeltaEngine.Content.Disk.DiskContentLoader
[TestFixtureSetUp]
public void Setup()
{
    CreateContentMetaDataAndRealFiles();
    ContentLoader.Use<DiskContentLoader>();
    image = ContentLoader.Load<MockImage>("DeltaEngineLogo");
}
[TestFixtureTearDown]
public void DisposeContentLoaderAndDeleteContentDirectory()
{
    ContentLoader.DisposeIfInitialized();
    DeleteDirectoryAndAllIncludingFiles(ContentProjectDirectoryName);
}
[Test]
public void LoadImageContent()
{
    Assert.AreEqual("DeltaEngineLogo", image.Name);
    Assert.IsFalse(image.IsDisposed);
    Assert.AreEqual(new Size(128, 128), image.PixelSize);
    var smallImage = ContentLoader.Load<MockImage>("SmallImage");
    Assert.AreEqual(new Size(32, 32), smallImage.PixelSize);
}
See Also