-
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 #23 from modularity
Split and organize the extension classes into module project based
- Loading branch information
Showing
42 changed files
with
608 additions
and
582 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0-windows</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<UseWPF>true</UseWPF> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Prism.Core" Version="8.1.97" /> | ||
<PackageReference Include="Serilog" Version="3.1.1" /> | ||
</ItemGroup> | ||
</Project> |
7 changes: 1 addition & 6 deletions
7
Controls/Converter/VisibilityConverter.cs → ...nModule/Converters/VisibilityConverter.cs
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
4 changes: 1 addition & 3 deletions
4
Core/ConstantFilePaths.cs → ...on/CommonModule/Core/ConstantFilePaths.cs
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,6 +1,4 @@ | ||
using System; | ||
|
||
namespace VersionController.Core | ||
namespace CommonModule.Core | ||
{ | ||
public class ConstantFilePaths | ||
{ | ||
|
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace CommonModule.Core; | ||
|
||
public class LogSink : ILogEventSink | ||
{ | ||
private readonly IEventAggregator _eventAggregator; | ||
|
||
public LogSink(IEventAggregator eventAggregator) | ||
{ | ||
_eventAggregator = eventAggregator; | ||
} | ||
|
||
public void Emit(LogEvent logEvent) | ||
{ | ||
ArgumentNullException.ThrowIfNull(logEvent); | ||
|
||
StringWriter strWriter = new(); | ||
|
||
MessageTemplateTextFormatter textFormatter = new MessageTemplateTextFormatter("{Timestamp:yyyy/MM/dd HH:mm:ss} [{Level:u3}]: {Message}{Exception}"); | ||
textFormatter.Format(logEvent, strWriter); | ||
|
||
_eventAggregator.GetEvent<Events.LogEvent>().Publish(strWriter.ToString()); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace CommonModule.Events; | ||
|
||
public class LogEvent : PubSubEvent<string> | ||
{ | ||
} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace CommonModule.Events; | ||
|
||
public class LogEventArgs: EventArgs | ||
{ | ||
public required string LogMessage { get; set; } | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
global using System.IO; | ||
global using System.Globalization; | ||
global using System.Windows; | ||
global using System.Windows.Data; | ||
global using Serilog.Core; | ||
global using Serilog.Events; | ||
global using Serilog.Formatting.Display; | ||
global using Prism.Events; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0-windows</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<UseWPF>true</UseWPF> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Prism.Logging.Serilog" Version="7.2.0.1423" /> | ||
<PackageReference Include="Prism.Unity" Version="8.1.97" /> | ||
<PackageReference Include="Serilog" Version="3.1.1" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\Common\CommonModule\CommonModule.csproj" /> | ||
<ProjectReference Include="..\..\Resource\Resource.csproj" /> | ||
</ItemGroup> | ||
</Project> |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
global using Prism.Ioc; | ||
global using Prism.Modularity; | ||
global using Prism.Mvvm; | ||
global using Prism.Regions; | ||
global using Prism.Events; | ||
global using Serilog; | ||
global using MainModule.ViewModels; | ||
global using MainModule.Views; | ||
global using CommonModule.Events; |
11 changes: 1 addition & 10 deletions
11
Main/ViewModels/MainViewModel.cs → ...es/MainModule/ViewModels/MainViewModel.cs
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
4 changes: 2 additions & 2 deletions
4
Main/Views/MainView.xaml → Modules/MainModule/Views/MainView.xaml
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
7 changes: 3 additions & 4 deletions
7
Core/IDirectoryUtils.cs → ...les/PackageModule/Core/IDirectoryUtils.cs
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
5 changes: 1 addition & 4 deletions
5
PackageModule/Models/Package.cs → Modules/PackageModule/Models/Package.cs
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace PackageModule; | ||
|
||
public class PackageModule : IModule | ||
{ | ||
private readonly ILogger _logger; | ||
private readonly IRegionManager _regionManager; | ||
|
||
public PackageModule(ILogger logger, IRegionManager regionManager) | ||
{ | ||
_logger = logger; | ||
_regionManager = regionManager; | ||
} | ||
|
||
public void OnInitialized(IContainerProvider containerProvider) | ||
{ | ||
_regionManager.RegisterViewWithRegion("PackageContentRegion", typeof(PackageView)); | ||
_regionManager.RegisterViewWithRegion("DotNugetPackageContentRegion", typeof(DotNugetPackageListView)); | ||
_regionManager.RegisterViewWithRegion("PackageListContentRegion", typeof(PackageListView)); | ||
|
||
//TODO: Update this implementation if there is a better way for first navigation | ||
IRegion region = _regionManager.Regions["PackageContentRegion"]; | ||
region.RequestNavigate(nameof(PackageView)); | ||
} | ||
|
||
public void RegisterTypes(IContainerRegistry containerRegistry) | ||
{ | ||
containerRegistry.RegisterForNavigation<PackageView>(); | ||
containerRegistry.RegisterForNavigation<DotNugetPackageListView>(); | ||
containerRegistry.RegisterForNavigation<PackageListView>(); | ||
|
||
ViewModelLocationProvider.Register<PackageView, PackageViewModel>(); | ||
ViewModelLocationProvider.Register<DotNugetPackageListView, DotNugetPackageListViewModel>(); | ||
ViewModelLocationProvider.Register<PackageListView, PackageListViewModel>(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0-windows</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<UseWPF>true</UseWPF> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Prism.Logging.Serilog" Version="7.2.0.1423" /> | ||
<PackageReference Include="Prism.Unity" Version="8.1.97" /> | ||
<PackageReference Include="Serilog" Version="3.1.1" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\Common\CommonModule\CommonModule.csproj" /> | ||
<ProjectReference Include="..\..\Resource\Resource.csproj" /> | ||
</ItemGroup> | ||
</Project> |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
global using System.IO; | ||
global using System.Diagnostics; | ||
global using System.Text.RegularExpressions; | ||
global using System.Collections.ObjectModel; | ||
global using Serilog; | ||
global using Prism.Ioc; | ||
global using Prism.Modularity; | ||
global using Prism.Mvvm; | ||
global using Prism.Commands; | ||
global using Prism.Regions; | ||
global using CommonModule.Core; | ||
global using PackageModule.Core; | ||
global using PackageModule.Models; | ||
global using PackageModule.Views; | ||
global using PackageModule.ViewModels; |
Oops, something went wrong.