diff --git a/ConfigManager/ConfigManager.sln b/ConfigManager/ConfigManager.sln new file mode 100644 index 0000000..12112b3 --- /dev/null +++ b/ConfigManager/ConfigManager.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2018 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConfigManager", "ConfigManager\ConfigManager.csproj", "{0CAA02A3-CEE3-4A21-AE35-BC8A4177DAE2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0CAA02A3-CEE3-4A21-AE35-BC8A4177DAE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0CAA02A3-CEE3-4A21-AE35-BC8A4177DAE2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0CAA02A3-CEE3-4A21-AE35-BC8A4177DAE2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CAA02A3-CEE3-4A21-AE35-BC8A4177DAE2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {046FAB0A-0119-4B6A-9905-924FD5975AB8} + EndGlobalSection +EndGlobal diff --git a/ConfigManager/ConfigManager/App.config b/ConfigManager/ConfigManager/App.config new file mode 100644 index 0000000..4bfa005 --- /dev/null +++ b/ConfigManager/ConfigManager/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/ConfigManager/ConfigManager/App.xaml b/ConfigManager/ConfigManager/App.xaml new file mode 100644 index 0000000..391e27c --- /dev/null +++ b/ConfigManager/ConfigManager/App.xaml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + diff --git a/ConfigManager/ConfigManager/App.xaml.cs b/ConfigManager/ConfigManager/App.xaml.cs new file mode 100644 index 0000000..8a935c1 --- /dev/null +++ b/ConfigManager/ConfigManager/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace ConfigManager +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/ConfigManager/ConfigManager/ConfigManager.csproj b/ConfigManager/ConfigManager/ConfigManager.csproj new file mode 100644 index 0000000..7ba0634 --- /dev/null +++ b/ConfigManager/ConfigManager/ConfigManager.csproj @@ -0,0 +1,134 @@ + + + + + Debug + AnyCPU + {0CAA02A3-CEE3-4A21-AE35-BC8A4177DAE2} + WinExe + ConfigManager + ConfigManager + v4.8 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Gameloop.Vdf.0.5.0\lib\net45\Gameloop.Vdf.dll + + + + + + + + + + + + 4.0 + + + + + + ..\packages\WPFTextBoxAutoComplete.1.0.5\lib\net40\WPFTextBoxAutoComplete.dll + + + + + MSBuild:Compile + Designer + + + SaveDialogWindow.xaml + + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + ctrlConfig.xaml + + + MainWindow.xaml + Code + + + Designer + MSBuild:Compile + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ConfigManager/ConfigManager/Images/MenuButton.png b/ConfigManager/ConfigManager/Images/MenuButton.png new file mode 100644 index 0000000..4af84d2 Binary files /dev/null and b/ConfigManager/ConfigManager/Images/MenuButton.png differ diff --git a/ConfigManager/ConfigManager/Images/Save_16x.png b/ConfigManager/ConfigManager/Images/Save_16x.png new file mode 100644 index 0000000..b2769de Binary files /dev/null and b/ConfigManager/ConfigManager/Images/Save_16x.png differ diff --git a/ConfigManager/ConfigManager/Images/Star.png b/ConfigManager/ConfigManager/Images/Star.png new file mode 100644 index 0000000..dd7bc5a Binary files /dev/null and b/ConfigManager/ConfigManager/Images/Star.png differ diff --git a/ConfigManager/ConfigManager/Images/StarEmpty.png b/ConfigManager/ConfigManager/Images/StarEmpty.png new file mode 100644 index 0000000..3f2f551 Binary files /dev/null and b/ConfigManager/ConfigManager/Images/StarEmpty.png differ diff --git a/ConfigManager/ConfigManager/Images/Trashbin.png b/ConfigManager/ConfigManager/Images/Trashbin.png new file mode 100644 index 0000000..661a919 Binary files /dev/null and b/ConfigManager/ConfigManager/Images/Trashbin.png differ diff --git a/ConfigManager/ConfigManager/MainWindow.xaml b/ConfigManager/ConfigManager/MainWindow.xaml new file mode 100644 index 0000000..4bb2775 --- /dev/null +++ b/ConfigManager/ConfigManager/MainWindow.xaml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ConfigManager/ConfigManager/ctrlConfig.xaml.cs b/ConfigManager/ConfigManager/ctrlConfig.xaml.cs new file mode 100644 index 0000000..48f8c62 --- /dev/null +++ b/ConfigManager/ConfigManager/ctrlConfig.xaml.cs @@ -0,0 +1,119 @@ +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.Navigation; +using System.Windows.Shapes; +using System.IO; + +namespace ConfigManager +{ + /// + /// Interaction logic for ctrlConfig.xaml + /// + public partial class ctrlConfig : UserControl + { + public ctrlConfig() + { + InitializeComponent(); + } + public delegate void EditConfig(object sender, string sPath); + public event EditConfig OnEditConfig; + public delegate void DeleteConfig(object sender, string sPath); + public event DeleteConfig OnDeleteConfig; + public delegate void ToggleFavouriteConfig(object sender, bool bFavourite); + public event ToggleFavouriteConfig OnToggleFavouriteConfig; + private string sPath; + + public string Path + { + get + { + return sPath; + } + set + { + sPath = value; + } + } + public bool IsFavourite + { + get { return (bool)GetValue(IsFavouriteProperty); } + set { SetValue(IsFavouriteProperty, value); } + } + + // Using a DependencyProperty as the backing store for IsFavourite. This enables animation, styling, binding, etc... + public static readonly DependencyProperty IsFavouriteProperty = + DependencyProperty.Register("IsFavourite", typeof(bool), typeof(ctrlConfig), new PropertyMetadata(false)); + + + + private void btnEditConfig_Click(object sender, RoutedEventArgs e) + { + if (OnEditConfig != null) + { + OnEditConfig(this, this.Path); + } + } + + private void rectMouseOver_MouseEnter(object sender, MouseEventArgs e) + { + (sender as Rectangle).Opacity = 1; + } + + private void rectMouseOver_MouseLeave(object sender, MouseEventArgs e) + { + (sender as Rectangle).Fill = new SolidColorBrush(Color.FromArgb(77, 195, 195, 195)); + (sender as Rectangle).Opacity = 0; + } + + private void rectMouseOver_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + (sender as Rectangle).Fill = new SolidColorBrush(Color.FromArgb(77, 30, 30, 30)); + } + + private void rectMouseOver_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) + { + (sender as Rectangle).Fill = new SolidColorBrush(Color.FromArgb(77, 195, 195, 195)); + switch((sender as Rectangle).Name) + { + case "rectTrashbinMouseOver": + if (OnDeleteConfig != null) + { + OnDeleteConfig(this, this.Path); + } + break; + case "rectFavouritesMouseOver": + this.IsFavourite = !this.IsFavourite; + if (OnToggleFavouriteConfig != null) + { + OnToggleFavouriteConfig(this, this.IsFavourite); + } + break; + default: + MessageBox.Show("The clicked Button is not configured in the Switch statement", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + break; + } + } + + private void rectMouseOver_Loaded(object sender, RoutedEventArgs e) + { + //Set ToolTip to "Delete "ConfigName"" + (sender as Rectangle).ToolTip = $"Delete \"{(Application.Current.MainWindow as MainWindow).getConfigNameFromPath(Path)}\""; + } + + private void rectFavouritesMouseOver_Loaded(object sender, RoutedEventArgs e) + { + //Set ToolTip + (sender as Rectangle).ToolTip = $"Add/Remove \"{(Application.Current.MainWindow as MainWindow).getConfigNameFromPath(Path)}\" from your favourites"; + } + } +} diff --git a/ConfigManager/ConfigManager/packages.config b/ConfigManager/ConfigManager/packages.config new file mode 100644 index 0000000..f4f1c9e --- /dev/null +++ b/ConfigManager/ConfigManager/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file