-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from goodtrailer/simplify-api
Core: Remove sync duplicate methods
- Loading branch information
Showing
15 changed files
with
41 additions
and
526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
// Copyright (c) Alden Wu <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENSE file in the repository root for full licence text. | ||
|
||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using DailyDesktop.Core.Util; | ||
|
@@ -23,56 +22,27 @@ public interface IReadOnlyConfiguration | |
/// </summary> | ||
bool IsAutoSerializing { get; } | ||
|
||
/// <summary> | ||
/// Event published on calls to <see cref="Update"/>. | ||
/// </summary> | ||
event EventHandler OnUpdate; | ||
|
||
/// <summary> | ||
/// Asynchronous event published on calls to <see cref="UpdateAsync"/>. | ||
/// </summary> | ||
event AsyncEventHandler OnUpdateAsync; | ||
|
||
/// <summary> | ||
/// Event published on successful calls to <see cref="Serialize"/>. | ||
/// </summary> | ||
event EventHandler OnSerialize; | ||
|
||
/// <summary> | ||
/// Asynchronous event published on successful calls to <see cref="SerializeAsync"/>. | ||
/// </summary> | ||
event AsyncEventHandler OnSerializeAsync; | ||
|
||
/// <summary> | ||
/// Automatically called upon setting properties. Can be called manually to | ||
/// publish to <see cref="OnUpdateAsync"/> and serialize (in case <see cref="IsAutoSerializing"/> is true). | ||
/// </summary> | ||
void Update(); | ||
|
||
/// <summary> | ||
/// Automatically called upon setting properties. Can be called manually to asynchronously | ||
/// publish to <see cref="OnUpdateAsync"/> and serialize (in case <see cref="IsAutoSerializing"/> is true). | ||
/// </summary> | ||
Task UpdateAsync(CancellationToken cancellationToken); | ||
|
||
/// <summary> | ||
/// Serialize configuration to a JSON file (located at <see cref="JsonPath"/>). | ||
/// </summary> | ||
void Serialize(); | ||
|
||
/// <summary> | ||
/// Asynchronously serialize configuration to a JSON file (located at <see cref="JsonPath"/>). | ||
/// </summary> | ||
Task SerializeAsync(CancellationToken cancellationToken); | ||
|
||
/// <summary> | ||
/// Try to serialize configuration to a JSON file (located at <see cref="JsonPath"/>). | ||
/// </summary> | ||
/// <returns> | ||
/// Whether or not the serialiazation was successful. | ||
/// </returns> | ||
bool TrySerialize(); | ||
|
||
/// <summary> | ||
/// Try to asynchronously serialize configuration to a JSON file (located at <see cref="JsonPath"/>). | ||
/// </summary> | ||
|
Oops, something went wrong.