diff --git a/src/WPFEduSolution/WPFBeginner/App.xaml.cs b/src/WPFEduSolution/WPFBeginner/App.xaml.cs index 49d7ffc..3394a1d 100644 --- a/src/WPFEduSolution/WPFBeginner/App.xaml.cs +++ b/src/WPFEduSolution/WPFBeginner/App.xaml.cs @@ -1,10 +1,8 @@ -using System; -using System.Globalization; +using CommunityToolkit.Mvvm.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using System.IO; using System.Text.Json; using System.Windows; -using CommunityToolkit.Mvvm.DependencyInjection; -using Microsoft.Extensions.DependencyInjection; using WPFBeginner.Configurations; using WPFBeginner.Exceptions; using WPFBeginner.Services; @@ -38,7 +36,7 @@ namespace WPFBeginner Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose; App.Current.MainWindow.Show(); } - catch(Exception ex) + catch (Exception ex) { App.Current.MainWindow.Close(); Environment.Exit(0); @@ -47,7 +45,7 @@ namespace WPFBeginner private void UnhandledExceptionHandle(object e) { - if(e is UnhandledExceptionEventArgs uee && uee.ExceptionObject is LoginFailedException) + if (e is UnhandledExceptionEventArgs uee && uee.ExceptionObject is LoginFailedException) { } @@ -86,7 +84,7 @@ namespace WPFBeginner private static void SetLanguage(string code) { if (_currentLanguage != null) - App.Current.Resources.MergedDictionaries.Remove( _currentLanguage ); + App.Current.Resources.MergedDictionaries.Remove(_currentLanguage); _currentLanguage = ResourceExplorer.GetLanguageResourceDic(code); App.Current.Resources.MergedDictionaries.Add(_currentLanguage); diff --git a/src/WPFEduSolution/WPFBeginner/Behaviors/WindowBehavior.cs b/src/WPFEduSolution/WPFBeginner/Behaviors/WindowBehavior.cs index 366ab09..a892e0d 100644 --- a/src/WPFEduSolution/WPFBeginner/Behaviors/WindowBehavior.cs +++ b/src/WPFEduSolution/WPFBeginner/Behaviors/WindowBehavior.cs @@ -1,6 +1,6 @@ using System.Runtime.InteropServices; -using System.Windows.Interop; using System.Windows; +using System.Windows.Interop; namespace WPFBeginner.Behaviors { @@ -24,7 +24,8 @@ namespace WPFBeginner.Behaviors #region HideCloseButton (attached property) - private static readonly RoutedEventHandler HideCloseButtonWhenLoadedDelegate = (sender, args) => { + private static readonly RoutedEventHandler HideCloseButtonWhenLoadedDelegate = (sender, args) => + { if (sender is Window == false) return; @@ -33,7 +34,8 @@ namespace WPFBeginner.Behaviors w.Loaded -= HideCloseButtonWhenLoadedDelegate; }; - private static readonly RoutedEventHandler ShowCloseButtonWhenLoadedDelegate = (sender, args) => { + private static readonly RoutedEventHandler ShowCloseButtonWhenLoadedDelegate = (sender, args) => + { if (sender is Window == false) return; @@ -43,7 +45,7 @@ namespace WPFBeginner.Behaviors }; public static readonly DependencyProperty HideCloseButtonProperty = - DependencyProperty.RegisterAttached("HideCloseButton", typeof(bool), OwnerType, + DependencyProperty.RegisterAttached("HideCloseButton", typeof(bool), OwnerType, new FrameworkPropertyMetadata(false, new PropertyChangedCallback(HideCloseButtonChangedCallback))); [AttachedPropertyBrowsableForType(typeof(Window))] @@ -97,7 +99,7 @@ namespace WPFBeginner.Behaviors #region IsHiddenCloseButton (readonly attached property) private static readonly DependencyPropertyKey IsHiddenCloseButtonKey = - DependencyProperty.RegisterAttachedReadOnly( "IsHiddenCloseButton", typeof(bool), OwnerType, new FrameworkPropertyMetadata(false)); + DependencyProperty.RegisterAttachedReadOnly("IsHiddenCloseButton", typeof(bool), OwnerType, new FrameworkPropertyMetadata(false)); public static readonly DependencyProperty IsHiddenCloseButtonProperty = IsHiddenCloseButtonKey.DependencyProperty; diff --git a/src/WPFEduSolution/WPFBeginner/Configurations/AppSettings.cs b/src/WPFEduSolution/WPFBeginner/Configurations/AppSettings.cs index d58bf69..0c0cec4 100644 --- a/src/WPFEduSolution/WPFBeginner/Configurations/AppSettings.cs +++ b/src/WPFEduSolution/WPFBeginner/Configurations/AppSettings.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json.Serialization; -using System.Threading.Tasks; -using System.Windows; +using System.Text.Json.Serialization; using WPFBeginner.Models; namespace WPFBeginner.Configurations @@ -15,7 +9,7 @@ namespace WPFBeginner.Configurations public EventHandler ThemeChanged; [JsonPropertyName("Login")] - public LoginInfo Login { get; set;} + public LoginInfo Login { get; set; } private string language; [JsonPropertyName("Language")] @@ -62,7 +56,7 @@ namespace WPFBeginner.Configurations } [JsonPropertyName("DefaultMembers")] - public List Members { get; set;} + public List Members { get; set; } } public class StringChangedEventArg : EventArgs diff --git a/src/WPFEduSolution/WPFBeginner/Controls/MemberInputPanel.xaml b/src/WPFEduSolution/WPFBeginner/Controls/MemberInputPanel.xaml index b6f1aca..1d94db5 100644 --- a/src/WPFEduSolution/WPFBeginner/Controls/MemberInputPanel.xaml +++ b/src/WPFEduSolution/WPFBeginner/Controls/MemberInputPanel.xaml @@ -3,7 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:local="clr-namespace:WPFBeginner.Controls" mc:Ignorable="d" Name="root" d:DesignHeight="450" d:DesignWidth="800"> diff --git a/src/WPFEduSolution/WPFBeginner/Controls/MemberInputPanel.xaml.cs b/src/WPFEduSolution/WPFBeginner/Controls/MemberInputPanel.xaml.cs index de0aebd..977a145 100644 --- a/src/WPFEduSolution/WPFBeginner/Controls/MemberInputPanel.xaml.cs +++ b/src/WPFEduSolution/WPFBeginner/Controls/MemberInputPanel.xaml.cs @@ -1,18 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; +using System.Windows; using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; namespace WPFBeginner.Controls { @@ -22,7 +9,7 @@ namespace WPFBeginner.Controls public partial class MemberInputPanel : UserControl { public static readonly DependencyProperty MemberNameProperty = - DependencyProperty.Register(nameof(MemberName), typeof(string), typeof(MemberInputPanel), new FrameworkPropertyMetadata(){BindsTwoWayByDefault = true}); + DependencyProperty.Register(nameof(MemberName), typeof(string), typeof(MemberInputPanel), new FrameworkPropertyMetadata() { BindsTwoWayByDefault = true }); public string MemberName { diff --git a/src/WPFEduSolution/WPFBeginner/Converters/BaseConverter.cs b/src/WPFEduSolution/WPFBeginner/Converters/BaseConverter.cs index 69cca88..a9e53b6 100644 --- a/src/WPFEduSolution/WPFBeginner/Converters/BaseConverter.cs +++ b/src/WPFEduSolution/WPFBeginner/Converters/BaseConverter.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Markup; +using System.Windows.Markup; namespace WPFBeginner.Converters { diff --git a/src/WPFEduSolution/WPFBeginner/Exceptions/LoginFailedException.cs b/src/WPFEduSolution/WPFBeginner/Exceptions/LoginFailedException.cs index b98f160..aa759a7 100644 --- a/src/WPFEduSolution/WPFBeginner/Exceptions/LoginFailedException.cs +++ b/src/WPFEduSolution/WPFBeginner/Exceptions/LoginFailedException.cs @@ -1,16 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WPFBeginner.Exceptions +namespace WPFBeginner.Exceptions { internal class LoginFailedException : Exception { - public LoginFailedException() : base() + public LoginFailedException() : base() { - + } } } diff --git a/src/WPFEduSolution/WPFBeginner/Models/Member.cs b/src/WPFEduSolution/WPFBeginner/Models/Member.cs index 4813ed0..7bc0631 100644 --- a/src/WPFEduSolution/WPFBeginner/Models/Member.cs +++ b/src/WPFEduSolution/WPFBeginner/Models/Member.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Text.Json.Serialization; -using System.Threading.Tasks; +using System.Text.Json.Serialization; namespace WPFBeginner.Models { @@ -26,7 +20,8 @@ namespace WPFBeginner.Models Name = name, Call = call, EMail = email, - EmployeeNo = employeeNo }; + EmployeeNo = employeeNo + }; } } } diff --git a/src/WPFEduSolution/WPFBeginner/Resources/SharedResourceDictionary.cs b/src/WPFEduSolution/WPFBeginner/Resources/SharedResourceDictionary.cs index 078f976..ed2dfa1 100644 --- a/src/WPFEduSolution/WPFBeginner/Resources/SharedResourceDictionary.cs +++ b/src/WPFEduSolution/WPFBeginner/Resources/SharedResourceDictionary.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; +using System.Windows; namespace WPFBeginner.Resources { diff --git a/src/WPFEduSolution/WPFBeginner/Services/EnterFocusAssistanct.cs b/src/WPFEduSolution/WPFBeginner/Services/EnterFocusAssistanct.cs index b6758b2..7a0f291 100644 --- a/src/WPFEduSolution/WPFBeginner/Services/EnterFocusAssistanct.cs +++ b/src/WPFEduSolution/WPFBeginner/Services/EnterFocusAssistanct.cs @@ -1,5 +1,5 @@ -using System.Windows.Input; -using System.Windows; +using System.Windows; +using System.Windows.Input; namespace WPFBeginner.Services { @@ -26,7 +26,7 @@ namespace WPFBeginner.Services private static void Unloaded(object sender, RoutedEventArgs e) { var uiElement = sender as FrameworkElement; - if (uiElement == null) + if (uiElement == null) return; uiElement.Unloaded -= Unloaded; diff --git a/src/WPFEduSolution/WPFBeginner/Services/PasswordBoxAssistant.cs b/src/WPFEduSolution/WPFBeginner/Services/PasswordBoxAssistant.cs index 8e07227..7c814d7 100644 --- a/src/WPFEduSolution/WPFBeginner/Services/PasswordBoxAssistant.cs +++ b/src/WPFEduSolution/WPFBeginner/Services/PasswordBoxAssistant.cs @@ -1,5 +1,5 @@ -using System.Windows.Controls; -using System.Windows; +using System.Windows; +using System.Windows.Controls; namespace WPFBeginner.Services { @@ -90,6 +90,6 @@ namespace WPFBeginner.Services - + } } diff --git a/src/WPFEduSolution/WPFBeginner/Services/ResourceExplorer.cs b/src/WPFEduSolution/WPFBeginner/Services/ResourceExplorer.cs index b16b68f..432aba1 100644 --- a/src/WPFEduSolution/WPFBeginner/Services/ResourceExplorer.cs +++ b/src/WPFEduSolution/WPFBeginner/Services/ResourceExplorer.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Media; +using System.Windows; namespace WPFBeginner.Services { @@ -24,7 +16,7 @@ namespace WPFBeginner.Services public static void ChangeXamlResource(string oldRes, string newRes) { - var found = App.Current.Resources.MergedDictionaries.Select((item, i) => new { Item = item, Index = i}).FirstOrDefault(i => i.Item.Source.AbsoluteUri.Equals($"{oldRes}", StringComparison.OrdinalIgnoreCase)); + var found = App.Current.Resources.MergedDictionaries.Select((item, i) => new { Item = item, Index = i }).FirstOrDefault(i => i.Item.Source.AbsoluteUri.Equals($"{oldRes}", StringComparison.OrdinalIgnoreCase)); if (found == null) return; @@ -53,7 +45,7 @@ namespace WPFBeginner.Services //var foundName = $"/WPFBeginner;component/Themes/Colors/{name}.xaml"; var found = App.Current.Resources.MergedDictionaries.Select((item, i) => new { Item = item, Index = i }).FirstOrDefault(i => i.Item.Source.AbsoluteUri.Equals(foundName, StringComparison.OrdinalIgnoreCase)); if (found == null) - return new ResourceDictionary(){ Source = new Uri(foundName, UriKind.RelativeOrAbsolute) }; + return new ResourceDictionary() { Source = new Uri(foundName, UriKind.RelativeOrAbsolute) }; return found.Item; } diff --git a/src/WPFEduSolution/WPFBeginner/Services/ViewModelLocator.cs b/src/WPFEduSolution/WPFBeginner/Services/ViewModelLocator.cs index f28ad5d..b05dd1c 100644 --- a/src/WPFEduSolution/WPFBeginner/Services/ViewModelLocator.cs +++ b/src/WPFEduSolution/WPFBeginner/Services/ViewModelLocator.cs @@ -1,9 +1,4 @@ using CommunityToolkit.Mvvm.DependencyInjection; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using WPFBeginner.ViewModels; namespace WPFBeginner.Services diff --git a/src/WPFEduSolution/WPFBeginner/Spec.txt b/src/WPFEduSolution/WPFBeginner/Spec.txt deleted file mode 100644 index 9d3e2be..0000000 --- a/src/WPFEduSolution/WPFBeginner/Spec.txt +++ /dev/null @@ -1,8 +0,0 @@ - - -## 요구사항 - -1. 프로그램 중복실행 방지 -2. 로그인 화면 - - 파일로부터 데이터 읽어와 비교 -3. diff --git a/src/WPFEduSolution/WPFBeginner/ViewModels/MainWindowViewModel.cs b/src/WPFEduSolution/WPFBeginner/ViewModels/MainWindowViewModel.cs index f05f002..b03f63d 100644 --- a/src/WPFEduSolution/WPFBeginner/ViewModels/MainWindowViewModel.cs +++ b/src/WPFEduSolution/WPFBeginner/ViewModels/MainWindowViewModel.cs @@ -16,7 +16,7 @@ namespace WPFBeginner.ViewModels { get { - if(filterMemebers != null) + if (filterMemebers != null) return filterMemebers; return members; @@ -92,7 +92,7 @@ namespace WPFBeginner.ViewModels return; } - IEnumerable result = Members; + IEnumerable result = Members; if (!string.IsNullOrWhiteSpace(MemberName)) result = result.Where(i => i.Name?.Contains(MemberName) ?? false); diff --git a/src/WPFEduSolution/WPFBeginner/ViewModels/RegistMemberWindowViewModel.cs b/src/WPFEduSolution/WPFBeginner/ViewModels/RegistMemberWindowViewModel.cs index 8b31d2d..e247631 100644 --- a/src/WPFEduSolution/WPFBeginner/ViewModels/RegistMemberWindowViewModel.cs +++ b/src/WPFEduSolution/WPFBeginner/ViewModels/RegistMemberWindowViewModel.cs @@ -1,11 +1,8 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; -using System.ComponentModel; -using System.Diagnostics; using System.Windows; using System.Windows.Input; using WPFBeginner.Services; -using WPFBeginner.Views; namespace WPFBeginner.ViewModels { diff --git a/src/WPFEduSolution/WPFBeginner/Views/MainWindow.xaml.cs b/src/WPFEduSolution/WPFBeginner/Views/MainWindow.xaml.cs index b959e59..d1e900e 100644 --- a/src/WPFEduSolution/WPFBeginner/Views/MainWindow.xaml.cs +++ b/src/WPFEduSolution/WPFBeginner/Views/MainWindow.xaml.cs @@ -1,13 +1,4 @@ -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; +using System.Windows; namespace WPFBeginner { diff --git a/src/WPFEduSolution/WPFBeginner/Views/RegistMemberWindow.xaml.cs b/src/WPFEduSolution/WPFBeginner/Views/RegistMemberWindow.xaml.cs index 58cb01b..bb0c8c3 100644 --- a/src/WPFEduSolution/WPFBeginner/Views/RegistMemberWindow.xaml.cs +++ b/src/WPFEduSolution/WPFBeginner/Views/RegistMemberWindow.xaml.cs @@ -1,16 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; +using System.Windows; namespace WPFBeginner.Views {