Skip to content

Commit

Permalink
- Renames in RMVC framework and Sample Projects updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
seanstardev committed Jan 17, 2025
1 parent b9b6c7f commit d6d0504
Show file tree
Hide file tree
Showing 36 changed files with 78 additions and 65 deletions.
1 change: 0 additions & 1 deletion RMVC/RCommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ internal RCommandBase() {
}
abstract internal void ExecuteCommandInternal(RCommand command);

protected IRAppShell? AppShell => RFacade.AppShell;
protected void ExecuteCommand(RCommand command) {
ExecuteCommandInternal(command);
}
Expand Down
9 changes: 5 additions & 4 deletions RMVC/RFacade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
using System.Threading;
using System.Threading.Tasks;

namespace RMVC {
namespace RMVC
{

public abstract class RFacade {

Expand All @@ -21,7 +22,7 @@ public abstract class RFacade {

private static RFacade? promoterFacade = null;
private static Type? promoterType = null;
internal static IRAppShell? AppShell { get; private set; } = null;
internal protected static IRAppShell? AppShell { get; private set; } = null;

private readonly ConcurrentDictionary<Task, CancellationTokenSource> activeTasks =
new ConcurrentDictionary<Task, CancellationTokenSource>();
Expand Down Expand Up @@ -94,7 +95,7 @@ public static void Create(Type facadeConcreteType, IRAppShell? appShell = null)
}
}

public static void RegisterView(IRContract view) {
public static void RegisterActor(IRContract view) {

RMediator? foundMediator = null;

Expand Down Expand Up @@ -125,7 +126,7 @@ public static void RegisterView(IRContract view) {

Log("Registered mediator + view: " + foundMediator.GetType().Name + " | " + view.GetType().Name);
}
public static void UnregisterView(IRContract view) {
public static void UnregisterActor(IRContract view) {

RMediator? foundMediator = null;

Expand Down
11 changes: 11 additions & 0 deletions RMVCApp.Sample.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RMVCApp.Sample.WPF", "Sampl
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RMVC", "RMVC\RMVC.csproj", "{951C78EC-A7A1-401B-811C-82120FDE4A9F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Sample\RMVCApp.Sample.Unity\Assembly-CSharp.csproj", "{3D1BCED0-D2AE-537D-1168-6F61D6E46C01}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RMVCApp.Sample.Unity", "RMVCApp.Sample.Unity", "{AC72811B-D645-4EF6-BD22-F9666B247332}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -53,10 +57,17 @@ Global
{951C78EC-A7A1-401B-811C-82120FDE4A9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{951C78EC-A7A1-401B-811C-82120FDE4A9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{951C78EC-A7A1-401B-811C-82120FDE4A9F}.Release|Any CPU.Build.0 = Release|Any CPU
{3D1BCED0-D2AE-537D-1168-6F61D6E46C01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3D1BCED0-D2AE-537D-1168-6F61D6E46C01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D1BCED0-D2AE-537D-1168-6F61D6E46C01}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3D1BCED0-D2AE-537D-1168-6F61D6E46C01}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{3D1BCED0-D2AE-537D-1168-6F61D6E46C01} = {AC72811B-D645-4EF6-BD22-F9666B247332}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9563A4A8-FE4E-4D35-B777-8B605A23B254}
EndGlobalSection
Expand Down
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Avalonia/ViewModels/CounterViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ private void IncrementCount() {

protected internal override void OnViewDisposed() {

RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);

}

protected internal override void OnViewInitialized() {
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}
}
}
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Avalonia/ViewModels/HomeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ public void SetView() {

}
protected internal override void OnViewDisposed() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}

protected internal override void OnViewInitialized() {
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}
[RelayCommand]
public void NavigateToRmvcTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public void ShowView(Enums.ViewEnum viewEnum) {


protected internal override void OnViewDisposed() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}

protected internal override void OnViewInitialized() {

RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ private void UpdateHasProgressItems() {
}

protected internal override void OnViewDisposed() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}

protected internal override void OnViewInitialized() {
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}
}
}
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Avalonia/ViewModels/WeatherViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public void SetView(WeatherForecastDTO[]? forecasts) {
}

protected internal override void OnViewDisposed() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}

protected internal override void OnViewInitialized() {
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}
}
}
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Blazor/Pages/Counter.razor
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
private int currentCount = 0;

protected override void OnInitialized() {
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}
public void Dispose() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}

public void SetCounter(int val) {
Expand Down
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Blazor/Pages/Home.razor
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@
public event Action? RunRmvcProgressTestEvt;

protected override void OnInitialized() {
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}
public void Dispose() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}

public void SetView() {
Expand Down
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Blazor/Pages/Weather.razor
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ else {
private WeatherForecastDTO[]? forecasts;

protected override async Task OnInitializedAsync() {
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
await Task.Delay(500);
}
public void Dispose() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}

public void SetView(WeatherForecastDTO[]? forecasts) {
Expand Down
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Blazor/Shared/Progress.razor
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@
}

protected override void OnInitialized() {
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}

public void Dispose() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}

private void OnAbort() {
Expand Down
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Core/Command/ShowRmvcMessageCmd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public ShowRmvcMessageCmd(string message) {
protected override bool EnableAutoUpdate => false;

protected override async Task RunAsync() {
if (base.AppShell != null) {
bool result = await base.AppShell.ShowMessageBox("Attention", message, false);
if (RMVCAppFacade.Instance?.App != null) {
bool result = await RMVCAppFacade.Instance.App.ShowMessageBox("Attention", message, false);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Sample/RMVCApp.Sample.Core/RMVCAppFacade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ namespace RMVCApp.Sample.Core {
public class RMVCAppFacade : RFacade {
internal static RMVCAppFacade? Instance => RFacade.FacadeInstance<RMVCAppFacade>();

internal IRAppShell? App => AppShell;

// Models
internal CounterModel? CounterModel => base.Model<CounterModel>();
internal WeatherModel? WeatherModel => base.Model<WeatherModel>();
Expand Down
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Forms/CounterView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public partial class CounterView : UserControl, ICounterView {

public CounterView() {
InitializeComponent();
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}


Expand All @@ -21,7 +21,7 @@ public void SetCounter(int count) {
currentCountLabel.Text = count.ToString();
}
protected void HandleDisposing() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}
private void testButton_Click(object sender, EventArgs e) {
int count = int.Parse(currentCountLabel.Text);
Expand Down
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Forms/HomeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace RMVCApp.Forms {
public partial class HomeView : UserControl, IHomeView {
public HomeView() {
InitializeComponent();
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}
public event Action<string>? ShowRmvcMessageEvt;
public event Action? RunRmvcProgressTestEvt;
Expand All @@ -14,7 +14,7 @@ public void SetView() {

}
protected void HandleDisposing() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}
private void testButton_Click(object sender, EventArgs e) {
ShowRmvcMessageEvt?.Invoke("Hello from RMVC.");
Expand Down
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Forms/MainView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public partial class MainView : UserControl, IMainView {
public MainForm? mainFormParent;
public MainView() {
InitializeComponent();
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}

public void ShowView(Enums.ViewEnum viewEnum) {
Expand Down Expand Up @@ -35,7 +35,7 @@ public void ShowView(Enums.ViewEnum viewEnum) {
}
}
protected void HandleDisposing() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}
}
}
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Forms/NavigationView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ namespace RMVCApp.Forms {
public partial class NavigationView : UserControl, INavigationView {
public NavigationView() {
InitializeComponent();
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}

public event Action? ShowHomeViewEvt;
public event Action? ShowCounterViewEvt;
public event Action? ShowWeatherViewEvt;
protected void HandleDisposing() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}
private void weatherLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
ShowWeatherViewEvt?.Invoke();
Expand Down
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Forms/ProgressView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace RMVCApp.Forms {
public partial class ProgressView : UserControl, IProgressView {
public ProgressView() {
InitializeComponent();
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}

public event Action? AbortProgressEvt;
Expand Down Expand Up @@ -45,7 +45,7 @@ private void AdjustProgressUIControls(int requiredCount) {
}

protected void HandleDisposing() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}

private void abortBtn_Click(object sender, EventArgs e) {
Expand Down
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Forms/WeatherView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace RMVCApp.Forms {
public partial class WeatherView : UserControl, IWeatherView {
public WeatherView() {
InitializeComponent();
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}


Expand All @@ -23,7 +23,7 @@ public void SetView(WeatherForecastDTO[]? forecasts) {
}

protected void HandleDisposing() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}
}
}
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Maui/Components/Pages/Counter.razor
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
private int currentCount = 0;

protected override void OnInitialized() {
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}

public void Dispose() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}

public void SetCounter(int val) {
Expand Down
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Maui/Components/Pages/Home.razor
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
public event Action? RunRmvcProgressTestEvt;

protected override void OnInitialized() {
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}

public void Dispose() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}

public void SetView() {
Expand Down
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Maui/Components/Pages/Weather.razor
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ else {

protected override async Task OnInitializedAsync() {
await Task.Delay(500);
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}

public void Dispose() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}

public void SetView(WeatherForecastDTO[]? forecasts) {
Expand Down
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Maui/Components/Shared/Progress.razor
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
}

protected override void OnInitialized() {
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}

public void Dispose() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}

private void OnAbort() {
Expand Down
4 changes: 2 additions & 2 deletions Sample/RMVCApp.Sample.Unity/Assets/CounterPanelScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public void OnIncrementCounter() {
SetCounterEvt?.Invoke(count);
}
void Start() {
RMVCAppFacade.RegisterView(this);
RMVCAppFacade.RegisterActor(this);
}
private void OnDestroy() {
RMVCAppFacade.UnregisterView(this);
RMVCAppFacade.UnregisterActor(this);
}

}
Loading

0 comments on commit d6d0504

Please sign in to comment.