mirror of
https://github.com/osukey/osukey.git
synced 2025-04-29 10:47:22 +09:00
More xmldoc fixes
This commit is contained in:
parent
0d095c4bb7
commit
d2591368a6
@ -17,7 +17,7 @@ using Logger = osu.Framework.Logging.Logger;
|
|||||||
namespace osu.Game.Database
|
namespace osu.Game.Database
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An exporter which handles the common scenario of exporting a model to a zip-based archive, usually with a custom file extension.
|
/// Handles the common scenario of exporting a model to a zip-based archive, usually with a custom file extension.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class LegacyArchiveExporter<TModel> : LegacyExporter<TModel>
|
public abstract class LegacyArchiveExporter<TModel> : LegacyExporter<TModel>
|
||||||
where TModel : RealmObject, IHasNamedFiles, IHasGuidPrimaryKey
|
where TModel : RealmObject, IHasNamedFiles, IHasGuidPrimaryKey
|
||||||
@ -30,13 +30,6 @@ namespace osu.Game.Database
|
|||||||
public override void ExportToStream(TModel model, Stream outputStream, ProgressNotification? notification, CancellationToken cancellationToken = default)
|
public override void ExportToStream(TModel model, Stream outputStream, ProgressNotification? notification, CancellationToken cancellationToken = default)
|
||||||
=> exportZipArchive(model, outputStream, notification, cancellationToken);
|
=> exportZipArchive(model, outputStream, notification, cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Exports an item to Stream as a legacy (.zip based) package.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="model">The model to be exported.</param>
|
|
||||||
/// <param name="outputStream">The output stream to export to.</param>
|
|
||||||
/// <param name="notification">An optional target notification to update with ongoing export progress.</param>
|
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
|
||||||
private void exportZipArchive(TModel model, Stream outputStream, ProgressNotification? notification, CancellationToken cancellationToken = default)
|
private void exportZipArchive(TModel model, Stream outputStream, ProgressNotification? notification, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
using (var writer = new ZipWriter(outputStream, new ZipWriterOptions(CompressionType.Deflate)))
|
using (var writer = new ZipWriter(outputStream, new ZipWriterOptions(CompressionType.Deflate)))
|
||||||
|
@ -52,14 +52,11 @@ namespace osu.Game.Database
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Export the model to default folder.
|
/// Exports a model to the default export location.
|
||||||
|
/// This will create a notification tracking the progress of the export, visible to the user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="model">The model should export.</param>
|
/// <param name="model">The model to export.</param>
|
||||||
/// <param name="cancellationToken">
|
/// <param name="cancellationToken">A cancellation token.</param>
|
||||||
/// The Cancellation token that can cancel the exporting.
|
|
||||||
/// If specified CancellationToken, then use it. Otherwise use PostNotification's CancellationToken.
|
|
||||||
/// </param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task ExportAsync(Live<TModel> model, CancellationToken cancellationToken = default)
|
public async Task ExportAsync(Live<TModel> model, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
string itemFilename = model.PerformRead(s => GetFilename(s).GetValidFilename());
|
string itemFilename = model.PerformRead(s => GetFilename(s).GetValidFilename());
|
||||||
@ -105,23 +102,22 @@ namespace osu.Game.Database
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Export model to stream.
|
/// Exports a model to a provided stream.
|
||||||
/// </summary>
|
|
||||||
/// <param name="model">The model which have <see cref="IHasGuidPrimaryKey"/>.</param>
|
|
||||||
/// <param name="stream">The stream to export.</param>
|
|
||||||
/// <param name="notification">The notification will displayed to the user</param>
|
|
||||||
/// <param name="cancellationToken">The Cancellation token that can cancel the exporting.</param>
|
|
||||||
/// <returns>Whether the export was successful</returns>
|
|
||||||
public Task ExportToStreamAsync(Live<TModel> model, Stream stream, ProgressNotification? notification = null, CancellationToken cancellationToken = default) =>
|
|
||||||
Task.Run(() => { model.PerformRead(s => ExportToStream(s, stream, notification, cancellationToken)); }, cancellationToken);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Exports model to Stream.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="model">The model to export.</param>
|
/// <param name="model">The model to export.</param>
|
||||||
/// <param name="outputStream">The output stream to export to.</param>
|
/// <param name="outputStream">The output stream to export to.</param>
|
||||||
/// <param name="notification">The notification will displayed to the user</param>
|
/// <param name="notification">An optional notification to be updated with export progress.</param>
|
||||||
/// <param name="cancellationToken">The Cancellation token that can cancel the exporting.</param>
|
/// <param name="cancellationToken">A cancellation token.</param>
|
||||||
|
public Task ExportToStreamAsync(Live<TModel> model, Stream outputStream, ProgressNotification? notification = null, CancellationToken cancellationToken = default) =>
|
||||||
|
Task.Run(() => { model.PerformRead(s => ExportToStream(s, outputStream, notification, cancellationToken)); }, cancellationToken);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Exports a model to a provided stream.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">The model to export.</param>
|
||||||
|
/// <param name="outputStream">The output stream to export to.</param>
|
||||||
|
/// <param name="notification">An optional notification to be updated with export progress.</param>
|
||||||
|
/// <param name="cancellationToken">A cancellation token.</param>
|
||||||
public abstract void ExportToStream(TModel model, Stream outputStream, ProgressNotification? notification, CancellationToken cancellationToken = default);
|
public abstract void ExportToStream(TModel model, Stream outputStream, ProgressNotification? notification, CancellationToken cancellationToken = default);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user