Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Documentation] Add XML documentation to ResourceContentManager #8252

Merged
merged 1 commit into from May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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