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
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
The DiskContentLoader type exposes the following members.
Methods
Name | Description | |
---|---|---|
ClearBufferedResourcesAndMetaData | (Inherited from ContentLoader.) | |
Dispose | (Inherited from ContentLoader.) | |
GetContentDataStream | (Inherited from ContentLoader.) | |
GetMetaData | (Overrides ContentLoader GetMetaData(String, Type).) | |
HasValidContentMetaDataFile | (Overrides ContentLoader HasValidContentMetaDataFile .) | |
ReloadContent | (Inherited from ContentLoader.) |
Fields
Name | Description | |
---|---|---|
metaData | (Inherited from ContentLoader.) |
Properties
Name | Description | |
---|---|---|
ContentMetaDataFilePath | (Inherited from ContentLoader.) | |
ContentProjectPath | (Inherited from ContentLoader.) | |
LastTimeUpdated | (Overrides ContentLoader LastTimeUpdated.) | |
StartedToRequestOnlineContent | (Inherited from ContentLoader.) |
Remarks
Examples
[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