-
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.
- Loading branch information
Showing
79 changed files
with
7,355 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Road Map | ||
|
||
## 1.0.0 | ||
|
||
### 기능 | ||
- [ ] Dashboard host 및 widget host 구현 및 버그 수정, 테스트 | ||
- [ ] Localization 서비스 구현 | ||
- [ ] 테마 서비스 구현 | ||
- [ ] Nuget 패키지에서 위젯을 읽고 로드하는 서비스 구현 | ||
- [ ] DLL 로드 | ||
- [ ] 개인적인 사용이 아닌 배포 용으로 사용할 때 필요한 작업들을 정리 | ||
- [ ] 시크릿 서비스를 이용한 어플리케이션 설정 암호화 | ||
- [ ] 문서에 빌드 방법 및 배포 방법을 정리 | ||
|
||
### 위젯 | ||
- [ ] Python 위젯 | ||
- [ ] C# 위젯 | ||
- [ ] Windows 위젯 | ||
- [ ] WebView 위젯 | ||
- [ ] vscode 위젯 | ||
|
||
|
||
### CI/CI | ||
- [ ] Create CI/CD workflows for WPF Applications built on .NET 8.x | ||
- [ ] Code Quality | ||
|
||
### 배포/웹사이트 | ||
- [ ] Create a website for the project | ||
- [ ] Create a GitHub Pages site for the project | ||
- [ ] Create a NuGet package for the project | ||
- [ ] Create a Community Standup for the project | ||
|
||
## 2.0.0 | ||
|
||
### 기능 | ||
- [ ] Navigation 서비스 구현 | ||
|
||
### 위젯 | ||
- [ ] PLC 위젯 | ||
|
||
### CI/CI | ||
- [ ] | ||
|
||
### 배포/웹사이트 | ||
- [ ] | ||
|
||
|
||
## 3.0.0 |
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,14 +1,135 @@ | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.IO.Packaging; | ||
using System.Windows; | ||
|
||
namespace Corathing.Organizer | ||
using Corathing.Contracts.Services; | ||
using Corathing.Dashboards.Services; | ||
using Corathing.Organizer.Services; | ||
using Corathing.Organizer.Utils; | ||
|
||
using MahApps.Metro.Controls; | ||
|
||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
using Wpf.Ui.Appearance; | ||
|
||
using Application = System.Windows.Application; | ||
using MessageBox = System.Windows.MessageBox; | ||
|
||
namespace Corathing.Organizer; | ||
|
||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
|
||
/// <summary> | ||
/// Gets the current <see cref="App"/> instance of the application | ||
/// </summary> | ||
public new static App Current => (App)Application.Current; | ||
|
||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// Gets the <see cref="IServiceProvider"/> instance of the application | ||
/// </summary> | ||
public partial class App : Application | ||
public IServiceProvider? Services { get; private set; } | ||
|
||
protected override void OnStartup(StartupEventArgs e) | ||
{ | ||
base.OnStartup(e); | ||
|
||
Application.Current.DispatcherUnhandledException += (sender, args) => | ||
{ | ||
MessageBox.Show(args.Exception.Message, "Unhandled exception occured"); | ||
//Logger.LogError(args.Exception, "Unhandled exception occured"); | ||
}; | ||
|
||
// 같은 이름의 다른 프로세스가 실행중인지 확인하고, 실행중이면 종료 | ||
if (CheckIfProcessExists()) | ||
{ | ||
MessageBox.Show( | ||
"Another instance of the application is already running.", | ||
"Error", | ||
MessageBoxButton.OK, | ||
MessageBoxImage.Error); | ||
|
||
Shutdown(); | ||
} | ||
|
||
// Set the theme | ||
var theme = System.Configuration.ConfigurationManager.AppSettings["Theme"]; | ||
//ThemeHelper.Register("Light", @"pack://application:,,,/DDT.Core.WidgetSystems;component/Themes/Light.xaml"); | ||
//ThemeHelper.Register("Dark", @"pack://application:,,,/DDT.Core.WidgetSystems;component/Themes/Dark.xaml"); | ||
//ThemeHelper.ChangeTheme(Resources, "Dark"); | ||
ApplicationThemeManager.Apply(ApplicationTheme.Dark); | ||
|
||
Services = ConfigureServices(e.Args); | ||
|
||
// Create a new MainWindow and set its DataContext to a new MainWindowViewModel which binds the view to the viewmodel | ||
new MainWindow().Show(); | ||
} | ||
|
||
private static IConfigurationRoot BuildConfiguration(string[] args) | ||
{ | ||
// Create and build a configuration builder | ||
var builder = new ConfigurationBuilder() | ||
.SetBasePath(Directory.GetCurrentDirectory()) | ||
//.AddAppSettingsJsonFileByEnvironmentVariables() | ||
//.AddEnvironmentVariables() | ||
//.AddEntityConfiguration() | ||
.AddCommandLine(args); | ||
|
||
return builder.Build(); | ||
} | ||
|
||
private static IServiceProvider ConfigureServices(string[] args) | ||
{ | ||
var serviceCollection = new ServiceCollection(); | ||
|
||
// Build the configuration | ||
var configuration = BuildConfiguration(args); | ||
serviceCollection.AddSingleton<IConfiguration>(configuration); | ||
|
||
// Register services | ||
serviceCollection.AddSingleton<IApplicationService, ApplicationService>(); | ||
//serviceCollection.AddSingleton<ISecretService, ModelVersionSecretService>(); | ||
serviceCollection.AddSingleton<IAuthService, AuthService>(); | ||
//serviceCollection.AddSingleton<IAppStateService, WidgetService>(); | ||
serviceCollection.AddSingleton<IPackageService, PackageService>(); | ||
//serviceCollection.AddSingleton<IWidgetSystemService, WidgetSystemService>(); | ||
|
||
// Register viewmodels | ||
|
||
|
||
//Logger.Configure(configuration); | ||
//serviceCollection.AddSingleton<SettingsController>(); | ||
//Localizer.Configure(configuration); | ||
|
||
return serviceCollection.BuildServiceProvider(); | ||
} | ||
|
||
/// <summary> | ||
/// Checks if there is already an instance of Openhardwaremonitor running and brings up its window | ||
/// in case its minimized or as icon in taskbar | ||
/// </summary> | ||
private static bool CheckIfProcessExists() | ||
{ | ||
bool processExists = false; | ||
Process thisInstance = Process.GetCurrentProcess(); | ||
if (Process.GetProcessesByName(thisInstance.ProcessName).Length > 1) | ||
{ | ||
processExists = true; | ||
using (var clientPipe = InterprocessCommunicationFactory.GetClientPipe()) | ||
{ | ||
clientPipe.Connect(); | ||
clientPipe.Write(new byte[] { (byte)SecondInstanceService.SecondInstanceRequest.MaximizeWindow }, 0, 1); | ||
} | ||
} | ||
|
||
return processExists; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/Apps/Corathing.Organizer/Behaviors/DateTimeNowBehavior.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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
// From: https://github.com/MahApps/MahApps.Metro/blob/develop/src/MahApps.Metro.Samples/MahApps.Metro.Demo/Behaviors/DateTimeNowBehavior.cs | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Windows.Threading; | ||
using MahApps.Metro.Controls; | ||
|
||
using Microsoft.Xaml.Behaviors; | ||
|
||
namespace Corathing.Organizer.Behaviors; | ||
|
||
public class DateTimeNowBehavior : Behavior<DateTimePicker> | ||
Check failure on line 15 in src/Apps/Corathing.Organizer/Behaviors/DateTimeNowBehavior.cs GitHub Actions / build (x64)
|
||
{ | ||
private DispatcherTimer? _dispatcherTimer; | ||
|
||
protected override void OnAttached() | ||
{ | ||
base.OnAttached(); | ||
this._dispatcherTimer = new DispatcherTimer(TimeSpan.FromSeconds(1), | ||
DispatcherPriority.DataBind, | ||
(sender, args) => this.AssociatedObject.SelectedDateTime = DateTime.Now, | ||
Dispatcher.CurrentDispatcher); | ||
} | ||
|
||
protected override void OnDetaching() | ||
{ | ||
base.OnDetaching(); | ||
this._dispatcherTimer?.Stop(); | ||
} | ||
} |
Oops, something went wrong.