feat(01-02): add Core models and WeakReferenceMessenger messages
- TenantProfile (plain class, mutable, fields match JSON schema: Name/TenantUrl/ClientId) - OperationProgress (record with Indeterminate factory, used by all feature services via IProgress<T>) - TenantSwitchedMessage (ValueChangedMessage<TenantProfile>, broadcast-ready) - LanguageChangedMessage (ValueChangedMessage<string>, broadcast-ready)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
using CommunityToolkit.Mvvm.Messaging.Messages;
|
||||
|
||||
namespace SharepointToolbox.Core.Messages;
|
||||
|
||||
public sealed class LanguageChangedMessage : ValueChangedMessage<string>
|
||||
{
|
||||
public LanguageChangedMessage(string cultureCode) : base(cultureCode) { }
|
||||
}
|
||||
9
SharepointToolbox/Core/Messages/TenantSwitchedMessage.cs
Normal file
9
SharepointToolbox/Core/Messages/TenantSwitchedMessage.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using CommunityToolkit.Mvvm.Messaging.Messages;
|
||||
using SharepointToolbox.Core.Models;
|
||||
|
||||
namespace SharepointToolbox.Core.Messages;
|
||||
|
||||
public sealed class TenantSwitchedMessage : ValueChangedMessage<TenantProfile>
|
||||
{
|
||||
public TenantSwitchedMessage(TenantProfile profile) : base(profile) { }
|
||||
}
|
||||
7
SharepointToolbox/Core/Models/OperationProgress.cs
Normal file
7
SharepointToolbox/Core/Models/OperationProgress.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace SharepointToolbox.Core.Models;
|
||||
|
||||
public record OperationProgress(int Current, int Total, string Message)
|
||||
{
|
||||
public static OperationProgress Indeterminate(string message) =>
|
||||
new(0, 0, message);
|
||||
}
|
||||
8
SharepointToolbox/Core/Models/TenantProfile.cs
Normal file
8
SharepointToolbox/Core/Models/TenantProfile.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace SharepointToolbox.Core.Models;
|
||||
|
||||
public class TenantProfile
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string TenantUrl { get; set; } = string.Empty;
|
||||
public string ClientId { get; set; } = string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user