-
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
15 changed files
with
676 additions
and
393 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 |
---|---|---|
|
@@ -6,5 +6,6 @@ public enum WindowFittingStandard | |
{ | ||
LeftTop, | ||
RightTop, | ||
Unset | ||
} | ||
} |
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 @@ | ||
using System; | ||
|
||
namespace UmaMadoManager.Core.Services | ||
{ | ||
public interface IApplicationService | ||
{ | ||
void Shutdown(); | ||
} | ||
} |
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 @@ | ||
<Application x:Class="UmaMadoManager.Windows.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:UmaMadoManager.Windows" | ||
ShutdownMode="OnExplicitShutdown"> | ||
<Application.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="Views/UmaMadoManagerUI.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Application.Resources> | ||
</Application> |
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,57 @@ | ||
using System; | ||
using System.Drawing; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Windows; | ||
using Hardcodet.Wpf.TaskbarNotification; | ||
using UmaMadoManager.Windows.Services; | ||
|
||
namespace UmaMadoManager.Windows | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
private TaskbarIcon notifyIcon; | ||
private Core.ViewModels.AxisStandardViewModel viewModel; | ||
|
||
protected override void OnStartup(StartupEventArgs e) | ||
{ | ||
base.OnStartup(e); | ||
|
||
var nativeWindowManager = new NativeWindowManager(); | ||
var screenManager = new ScreenManager(); | ||
var audioManager = new AudioManager(); | ||
var versionRepository = new VersionRepository(); | ||
var settingService = new SettingService(); | ||
var debugService = new DebugService(); | ||
var applicationService = new ApplicationService(); | ||
settingService.Init(); | ||
|
||
var isDebugMode = System.Environment.GetCommandLineArgs().Count(v => v == "--debug") == 1; | ||
if (isDebugMode) { | ||
debugService.AllocConsole(); | ||
} | ||
|
||
viewModel = new Core.ViewModels.AxisStandardViewModel( | ||
nativeWindowManager, | ||
screenManager, | ||
audioManager, | ||
versionRepository, | ||
settingService, | ||
applicationService); | ||
|
||
notifyIcon = (TaskbarIcon) FindResource("NotifyIcon"); | ||
var icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream("UmaMadoManager.Windows.Resources.TrayIcon.ico")); | ||
notifyIcon.Icon = icon; | ||
notifyIcon.DataContext = viewModel; | ||
} | ||
|
||
protected override void OnExit(ExitEventArgs e) | ||
{ | ||
notifyIcon.Dispose(); | ||
base.OnExit(e); | ||
} | ||
} | ||
} |
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,10 @@ | ||
using System.Windows; | ||
|
||
[assembly:ThemeInfo( | ||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located | ||
//(used if a resource is not found in the page, | ||
// or application resource dictionaries) | ||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located | ||
//(used if a resource is not found in the page, | ||
// app, or any theme specific resource dictionaries) | ||
)] |
23 changes: 23 additions & 0 deletions
23
UmaMadoManager.Windows/Converters/AxisStandardEnumConverter.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,23 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
using UmaMadoManager.Core.Models; | ||
|
||
namespace UmaMadoManager.Windows.Converters | ||
{ | ||
class AxisStandardEnumBoolConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
var targetEnum = (AxisStandard)parameter; | ||
var passedEnum = (AxisStandard)value; | ||
|
||
return targetEnum == passedEnum; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return parameter; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
UmaMadoManager.Windows/Converters/MuteConditionEnumConveter.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,23 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
using UmaMadoManager.Core.Models; | ||
|
||
namespace UmaMadoManager.Windows.Converters | ||
{ | ||
class MuteConditionEnumConveter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
var targetEnum = (MuteCondition)parameter; | ||
var passedEnum = (MuteCondition)value; | ||
|
||
return targetEnum == passedEnum; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return parameter; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
UmaMadoManager.Windows/Converters/WindowFittingStandardEnumConverter.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,23 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
using UmaMadoManager.Core.Models; | ||
|
||
namespace UmaMadoManager.Windows.Converters | ||
{ | ||
class WindowFittingStandardEnumConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
var targetEnum = (WindowFittingStandard)parameter; | ||
var passedEnum = (WindowFittingStandard)value; | ||
|
||
return targetEnum == passedEnum; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return parameter; | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Windows; | ||
using UmaMadoManager.Core.Services; | ||
|
||
namespace UmaMadoManager.Windows.Services | ||
{ | ||
public class ApplicationService : IApplicationService | ||
{ | ||
public void Shutdown() | ||
{ | ||
Application.Current.Shutdown(); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.