Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonami committed May 21, 2016
1 parent e3aa74f commit 803bc8d
Show file tree
Hide file tree
Showing 136 changed files with 16,539 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Minecraft Server Starter.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Minecraft Server Starter", "Minecraft Server Starter\Minecraft Server Starter.csproj", "{22E6F114-52F5-447E-82A3-D951E5E82E5F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{22E6F114-52F5-447E-82A3-D951E5E82E5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22E6F114-52F5-447E-82A3-D951E5E82E5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22E6F114-52F5-447E-82A3-D951E5E82E5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22E6F114-52F5-447E-82A3-D951E5E82E5F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions Minecraft Server Starter/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup>
</configuration>
13 changes: 13 additions & 0 deletions Minecraft Server Starter/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Application x:Class="Minecraft_Server_Starter.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Minecraft_Server_Starter" StartupUri="Windows/MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="res/Images.xaml" />
<ResourceDictionary Source="res/Strings.es-ES.xaml" />
<ResourceDictionary Source="res/Strings.xaml" />
<ResourceDictionary Source="res/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
94 changes: 94 additions & 0 deletions Minecraft Server Starter/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Made by Lonami Exo (C) LonamiWebs
// Creation date: february 2016
// Modifications:
// - No modifications made
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
using System.Windows;

namespace Minecraft_Server_Starter
{
public partial class App : Application
{
public App()
{
InitializeComponent();

SelectCulture(Thread.CurrentThread.CurrentUICulture.ToString());

Settings.Init("LonamiWebs\\Minecraft Server Starter", new Dictionary<string, dynamic>
{
{ "eulaAccepted", false },
{ "minRam", 512 },
{ "maxRam", 1024 },
{ "javaPath", Java.FindJavaPath() },
{ "priority", (int)ProcessPriorityClass.Normal },
{ "notificationEnabled", true },
{ "notificationLoc", (int)Toast.Location.TopLeft },
{ "mssFolder", Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"LonamiWebs\\Minecraft Server Starter")},
{ "ignoreCommandsBlock", true }
});
}

public static void SelectCulture(string culture)
{
// List all our resources
List<ResourceDictionary> dictionaryList = new List<ResourceDictionary>();
foreach (ResourceDictionary dictionary in Current.Resources.MergedDictionaries)
dictionaryList.Add(dictionary);

// We want our specific culture
string requestedCulture = string.Format("Strings.{0}.xaml", culture);
ResourceDictionary resourceDictionary = dictionaryList.FirstOrDefault(d => d.Source.OriginalString == requestedCulture);
if (resourceDictionary == null)
{
requestedCulture = "Strings.xaml";
resourceDictionary = dictionaryList.FirstOrDefault(d => d.Source.OriginalString == requestedCulture);
}

// If we have the requested resource, remove it from the list and place at the end.\
// Then this language will be our string table to use.
if (resourceDictionary != null)
{
Application.Current.Resources.MergedDictionaries.Remove(resourceDictionary);
Application.Current.Resources.MergedDictionaries.Add(resourceDictionary);
}
// Inform the threads of the new culture
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
}
}
}



























Loading

0 comments on commit 803bc8d

Please sign in to comment.