Skip to content

Commit

Permalink
Merge pull request #8252 from Maniekko/docs/rcm
Browse files Browse the repository at this point in the history
[Documentation] Add XML documentation to ResourceContentManager
  • Loading branch information
SimonDarksideJ committed May 10, 2024
2 parents c59a9cf + 0316cb1 commit 6009fd6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions MonoGame.Framework/Content/ResourceContentManager.cs
Expand Up @@ -5,10 +5,22 @@

namespace Microsoft.Xna.Framework.Content
{
/// <summary>
/// Subclass of <see cref="ContentManager"/>, which is specialized to read
/// from <i>.resx</i> resource files rather than directly from individual files on disk.
/// </summary>
public class ResourceContentManager : ContentManager
{
private ResourceManager resource;

/// <summary>
/// Creates a new instance of <see cref="ResourceContentManager"/>.
/// </summary>
/// <param name="servicesProvider">
/// The service provider the <b>ResourceContentManager</b> should use to locate services.
/// </param>
/// <param name="resource">The resource manager for the <b>ResourceContentManager</b> to read from.</param>
/// <exception cref="ArgumentNullException"><paramref name="resource"/> is <see langword="null"/>.</exception>
public ResourceContentManager(IServiceProvider servicesProvider, ResourceManager resource)
: base(servicesProvider)
{
Expand All @@ -19,6 +31,15 @@ public ResourceContentManager(IServiceProvider servicesProvider, ResourceManager
this.resource = resource;
}

/// <summary>
/// Opens a stream for reading the specified resource.
/// Derived classes can replace this to implement pack files or asset compression.
/// </summary>
/// <param name="assetName">The name of the asset being read.</param>
/// <exception cref="ContentLoadException">
/// Error loading <paramref name="assetName"/>.
/// The resource was not a binary resource, or the resource was not found.
/// </exception>
protected override System.IO.Stream OpenStream(string assetName)
{
object obj = this.resource.GetObject(assetName);
Expand Down

0 comments on commit 6009fd6

Please sign in to comment.