Clean up code & structure

Brian [2016-08-14 16:25:18]
Clean up code & structure
Filename
PokemonGo.RocketBot.Window/ConsoleLogger.cs
PokemonGo.RocketBot.Window/ItemBox.cs
PokemonGo.RocketBot.Window/ItemBox.designer.cs
PokemonGo.RocketBot.Window/ItemBox.resx
PokemonGo.RocketBot.Window/ItemForm.cs
PokemonGo.RocketBot.Window/ItemForm.designer.cs
PokemonGo.RocketBot.Window/MainForm.cs
PokemonGo.RocketBot.Window/MainForm.designer.cs
PokemonGo.RocketBot.Window/MainForm.resx
PokemonGo.RocketBot.Window/NicknamePokemonForm.cs
PokemonGo.RocketBot.Window/NicknamePokemonForm.designer.cs
PokemonGo.RocketBot.Window/NicknamePokemonForm.resx
PokemonGo.RocketBot.Window/SettingsForm.cs
PokemonGo.RocketBot.Window/SettingsForm.Designer.cs
PokemonGo.RocketBot.Window/SettingsForm.resx
PokemonGo.RocketBot.Window/DeviceHelper.cs
PokemonGo.RocketBot.Window/PokemomObject.cs
PokemonGo.RocketBot.Window/PokemonGo.RocketBot.Window.csproj
PokemonGo.RocketBot.Window/Program.cs
PokemonGo.RocketBot.Window/SimpleSession.cs
diff --git a/PokemonGo.RocketBot.Window/ConsoleLogger.cs b/PokemonGo.RocketBot.Window/ConsoleLogger.cs
index c746524..bbc62e3 100644
--- a/PokemonGo.RocketBot.Window/ConsoleLogger.cs
+++ b/PokemonGo.RocketBot.Window/ConsoleLogger.cs
@@ -4,6 +4,7 @@ using System;
 using System.Drawing;
 using PokemonGo.RocketBot.Logic.Logging;
 using PokemonGo.RocketBot.Logic.State;
+using PokemonGo.RocketBot.Window.Forms;
 using PokemonGo.RocketBot.Window.Models;

 #endregion
diff --git a/PokemonGo.RocketBot.Window/ItemBox.cs b/PokemonGo.RocketBot.Window/Forms/ItemBox.cs
similarity index 98%
rename from PokemonGo.RocketBot.Window/ItemBox.cs
rename to PokemonGo.RocketBot.Window/Forms/ItemBox.cs
index 43f1d20..0a97a05 100644
--- a/PokemonGo.RocketBot.Window/ItemBox.cs
+++ b/PokemonGo.RocketBot.Window/Forms/ItemBox.cs
@@ -3,7 +3,7 @@ using System.Drawing;
 using System.Windows.Forms;
 using POGOProtos.Inventory.Item;

-namespace PokemonGo.RocketBot.Window
+namespace PokemonGo.RocketBot.Window.Forms
 {
     public partial class ItemBox : UserControl
     {
diff --git a/PokemonGo.RocketBot.Window/ItemBox.designer.cs b/PokemonGo.RocketBot.Window/Forms/ItemBox.designer.cs
similarity index 99%
rename from PokemonGo.RocketBot.Window/ItemBox.designer.cs
rename to PokemonGo.RocketBot.Window/Forms/ItemBox.designer.cs
index 3c347f6..ffe318f 100644
--- a/PokemonGo.RocketBot.Window/ItemBox.designer.cs
+++ b/PokemonGo.RocketBot.Window/Forms/ItemBox.designer.cs
@@ -1,4 +1,4 @@
-namespace PokemonGo.RocketBot.Window {
+namespace PokemonGo.RocketBot.Window.Forms {
     partial class ItemBox {
         /// <summary>
         /// Required designer variable.
diff --git a/PokemonGo.RocketBot.Window/ItemBox.resx b/PokemonGo.RocketBot.Window/Forms/ItemBox.resx
similarity index 100%
rename from PokemonGo.RocketBot.Window/ItemBox.resx
rename to PokemonGo.RocketBot.Window/Forms/ItemBox.resx
diff --git a/PokemonGo.RocketBot.Window/ItemForm.cs b/PokemonGo.RocketBot.Window/Forms/ItemForm.cs
similarity index 93%
rename from PokemonGo.RocketBot.Window/ItemForm.cs
rename to PokemonGo.RocketBot.Window/Forms/ItemForm.cs
index 2ddf383..c4aa1d0 100644
--- a/PokemonGo.RocketBot.Window/ItemForm.cs
+++ b/PokemonGo.RocketBot.Window/Forms/ItemForm.cs
@@ -2,7 +2,7 @@
 using System.Windows.Forms;
 using POGOProtos.Inventory.Item;

-namespace PokemonGo.RocketBot.Window
+namespace PokemonGo.RocketBot.Window.Forms
 {
     public partial class ItemForm : Form
     {
diff --git a/PokemonGo.RocketBot.Window/ItemForm.designer.cs b/PokemonGo.RocketBot.Window/Forms/ItemForm.designer.cs
similarity index 99%
rename from PokemonGo.RocketBot.Window/ItemForm.designer.cs
rename to PokemonGo.RocketBot.Window/Forms/ItemForm.designer.cs
index 56fa08e..62045b4 100644
--- a/PokemonGo.RocketBot.Window/ItemForm.designer.cs
+++ b/PokemonGo.RocketBot.Window/Forms/ItemForm.designer.cs
@@ -1,4 +1,4 @@
-namespace PokemonGo.RocketBot.Window {
+namespace PokemonGo.RocketBot.Window.Forms {
     partial class ItemForm {
         /// <summary>
         /// Required designer variable.
diff --git a/PokemonGo.RocketBot.Window/MainForm.cs b/PokemonGo.RocketBot.Window/Forms/MainForm.cs
similarity index 99%
rename from PokemonGo.RocketBot.Window/MainForm.cs
rename to PokemonGo.RocketBot.Window/Forms/MainForm.cs
index a460ca9..f5b7bc5 100644
--- a/PokemonGo.RocketBot.Window/MainForm.cs
+++ b/PokemonGo.RocketBot.Window/Forms/MainForm.cs
@@ -6,6 +6,7 @@ using System.Globalization;
 using System.IO;
 using System.Linq;
 using System.Net;
+using System.Reflection;
 using System.Text;
 using System.Text.RegularExpressions;
 using System.Threading;
@@ -28,9 +29,8 @@ using POGOProtos.Data;
 using POGOProtos.Inventory;
 using POGOProtos.Inventory.Item;
 using POGOProtos.Networking.Responses;
-using static System.Reflection.Assembly;

-namespace PokemonGo.RocketBot.Window
+namespace PokemonGo.RocketBot.Window.Forms
 {
     public partial class MainForm : Form
     {
@@ -136,7 +136,7 @@ namespace PokemonGo.RocketBot.Window
             _machine = new StateMachine();
             var stats = new Statistics();

-            var strVersion = GetExecutingAssembly().GetName().Version.ToString(3);
+            var strVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(3);

             stats.DirtyEvent +=
                 () =>
@@ -222,7 +222,7 @@ namespace PokemonGo.RocketBot.Window
                             match.Groups[3],
                             match.Groups[4]));
                 // makes sense to display your version and say what the current one is on github
-                Logger.Write("Your version is " + GetExecutingAssembly().GetName().Version);
+                Logger.Write("Your version is " + Assembly.GetExecutingAssembly().GetName().Version);
                 Logger.Write("Github version is " + gitVersion);
                 Logger.Write("You can find it at www.GitHub.com/TheUnnameOrganization/RocketBot/releases");
             }
diff --git a/PokemonGo.RocketBot.Window/MainForm.designer.cs b/PokemonGo.RocketBot.Window/Forms/MainForm.designer.cs
similarity index 97%
rename from PokemonGo.RocketBot.Window/MainForm.designer.cs
rename to PokemonGo.RocketBot.Window/Forms/MainForm.designer.cs
index 9e4aaf8..04713e2 100644
--- a/PokemonGo.RocketBot.Window/MainForm.designer.cs
+++ b/PokemonGo.RocketBot.Window/Forms/MainForm.designer.cs
@@ -1,4 +1,4 @@
-namespace PokemonGo.RocketBot.Window
+namespace PokemonGo.RocketBot.Window.Forms
 {
     partial class MainForm
     {
@@ -36,7 +36,6 @@
             this.menuStrip1 = new System.Windows.Forms.MenuStrip();
             this.startStopBotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.todoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.forceUnbanToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.showAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.showAllToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
             this.gMapControl1 = new GMap.NET.WindowsForms.GMapControl();
@@ -114,8 +113,7 @@
             this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
             this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.startStopBotToolStripMenuItem,
-            this.todoToolStripMenuItem,
-            this.forceUnbanToolStripMenuItem});
+            this.todoToolStripMenuItem});
             this.menuStrip1.Location = new System.Drawing.Point(0, 0);
             this.menuStrip1.Name = "menuStrip1";
             this.menuStrip1.Size = new System.Drawing.Size(1254, 25);
@@ -136,12 +134,6 @@
             this.todoToolStripMenuItem.Text = "Settings";
             this.todoToolStripMenuItem.Click += new System.EventHandler(this.todoToolStripMenuItem_Click);
             //
-            // forceUnbanToolStripMenuItem
-            //
-            this.forceUnbanToolStripMenuItem.Name = "forceUnbanToolStripMenuItem";
-            this.forceUnbanToolStripMenuItem.Size = new System.Drawing.Size(94, 21);
-            this.forceUnbanToolStripMenuItem.Text = "Force Unban";
-            //
             // showAllToolStripMenuItem
             //
             this.showAllToolStripMenuItem.Name = "showAllToolStripMenuItem";
@@ -474,7 +466,6 @@
         private System.Windows.Forms.ToolStripMenuItem startStopBotToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem showAllToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem showAllToolStripMenuItem1;
-        private System.Windows.Forms.ToolStripMenuItem forceUnbanToolStripMenuItem;
         private GMap.NET.WindowsForms.GMapControl gMapControl1;
         private BrightIdeasSoftware.ObjectListView olvPokemonList;
         private BrightIdeasSoftware.OLVColumn pkmnName;
diff --git a/PokemonGo.RocketBot.Window/MainForm.resx b/PokemonGo.RocketBot.Window/Forms/MainForm.resx
similarity index 100%
rename from PokemonGo.RocketBot.Window/MainForm.resx
rename to PokemonGo.RocketBot.Window/Forms/MainForm.resx
diff --git a/PokemonGo.RocketBot.Window/NicknamePokemonForm.cs b/PokemonGo.RocketBot.Window/Forms/NicknamePokemonForm.cs
similarity index 96%
rename from PokemonGo.RocketBot.Window/NicknamePokemonForm.cs
rename to PokemonGo.RocketBot.Window/Forms/NicknamePokemonForm.cs
index 5657812..35f6cfc 100644
--- a/PokemonGo.RocketBot.Window/NicknamePokemonForm.cs
+++ b/PokemonGo.RocketBot.Window/Forms/NicknamePokemonForm.cs
@@ -1,7 +1,7 @@
 using System;
 using System.Windows.Forms;

-namespace PokemonGo.RocketBot.Window
+namespace PokemonGo.RocketBot.Window.Forms
 {
     public partial class NicknamePokemonForm : Form
     {
diff --git a/PokemonGo.RocketBot.Window/NicknamePokemonForm.designer.cs b/PokemonGo.RocketBot.Window/Forms/NicknamePokemonForm.designer.cs
similarity index 99%
rename from PokemonGo.RocketBot.Window/NicknamePokemonForm.designer.cs
rename to PokemonGo.RocketBot.Window/Forms/NicknamePokemonForm.designer.cs
index c416dca..256b1a2 100644
--- a/PokemonGo.RocketBot.Window/NicknamePokemonForm.designer.cs
+++ b/PokemonGo.RocketBot.Window/Forms/NicknamePokemonForm.designer.cs
@@ -1,4 +1,4 @@
-namespace PokemonGo.RocketBot.Window {
+namespace PokemonGo.RocketBot.Window.Forms {
     partial class NicknamePokemonForm {
         /// <summary>
         /// Required designer variable.
diff --git a/PokemonGo.RocketBot.Window/NicknamePokemonForm.resx b/PokemonGo.RocketBot.Window/Forms/NicknamePokemonForm.resx
similarity index 100%
rename from PokemonGo.RocketBot.Window/NicknamePokemonForm.resx
rename to PokemonGo.RocketBot.Window/Forms/NicknamePokemonForm.resx
diff --git a/PokemonGo.RocketBot.Window/SettingsForm.cs b/PokemonGo.RocketBot.Window/Forms/SettingsForm.cs
similarity index 99%
rename from PokemonGo.RocketBot.Window/SettingsForm.cs
rename to PokemonGo.RocketBot.Window/Forms/SettingsForm.cs
index b1ae4f1..f79d1b5 100644
--- a/PokemonGo.RocketBot.Window/SettingsForm.cs
+++ b/PokemonGo.RocketBot.Window/Forms/SettingsForm.cs
@@ -1,17 +1,16 @@
 using System;
 using System.Collections.Generic;
-using System.Configuration;
 using System.Drawing;
-using System.Globalization;
 using System.Linq;
 using System.Windows.Forms;
 using GMap.NET;
 using GMap.NET.MapProviders;
 using PokemonGo.RocketBot.Logic;
+using PokemonGo.RocketBot.Window.Helpers;
 using POGOProtos.Enums;
 using POGOProtos.Inventory.Item;

-namespace PokemonGo.RocketBot.Window
+namespace PokemonGo.RocketBot.Window.Forms
 {
     internal partial class SettingsForm : Form
     {
diff --git a/PokemonGo.RocketBot.Window/SettingsForm.Designer.cs b/PokemonGo.RocketBot.Window/Forms/SettingsForm.designer.cs
similarity index 99%
rename from PokemonGo.RocketBot.Window/SettingsForm.Designer.cs
rename to PokemonGo.RocketBot.Window/Forms/SettingsForm.designer.cs
index 6830dbe..fe9e44d 100644
--- a/PokemonGo.RocketBot.Window/SettingsForm.Designer.cs
+++ b/PokemonGo.RocketBot.Window/Forms/SettingsForm.designer.cs
@@ -1,4 +1,4 @@
-namespace PokemonGo.RocketBot.Window
+namespace PokemonGo.RocketBot.Window.Forms
 {
     partial class SettingsForm
     {
diff --git a/PokemonGo.RocketBot.Window/SettingsForm.resx b/PokemonGo.RocketBot.Window/Forms/SettingsForm.resx
similarity index 100%
rename from PokemonGo.RocketBot.Window/SettingsForm.resx
rename to PokemonGo.RocketBot.Window/Forms/SettingsForm.resx
diff --git a/PokemonGo.RocketBot.Window/DeviceHelper.cs b/PokemonGo.RocketBot.Window/Helpers/DeviceHelper.cs
similarity index 98%
rename from PokemonGo.RocketBot.Window/DeviceHelper.cs
rename to PokemonGo.RocketBot.Window/Helpers/DeviceHelper.cs
index 5441e72..dc21afd 100644
--- a/PokemonGo.RocketBot.Window/DeviceHelper.cs
+++ b/PokemonGo.RocketBot.Window/Helpers/DeviceHelper.cs
@@ -4,7 +4,7 @@ using System.IO;
 using System.Linq;
 using System.Security.Cryptography;

-namespace PokemonGo.RocketBot.Window
+namespace PokemonGo.RocketBot.Window.Helpers
 {
     public class DeviceHelper
     {
diff --git a/PokemonGo.RocketBot.Window/PokemomObject.cs b/PokemonGo.RocketBot.Window/PokemomObject.cs
index a5e4c2f..132d8f6 100644
--- a/PokemonGo.RocketBot.Window/PokemomObject.cs
+++ b/PokemonGo.RocketBot.Window/PokemomObject.cs
@@ -9,8 +9,8 @@ namespace PokemonGo.RocketBot.Window
 {
     public class PokemonObject
     {
-        private static bool initialized;
-        public static Dictionary<PokemonId, int> candyToEvolveDict = new Dictionary<PokemonId, int>();
+        private static bool _initialized;
+        public static Dictionary<PokemonId, int> CandyToEvolveDict = new Dictionary<PokemonId, int>();

         public PokemonObject(PokemonData pokemonData)
         {
@@ -70,9 +70,9 @@ namespace PokemonGo.RocketBot.Window
         {
             get
             {
-                if (candyToEvolveDict.ContainsKey(PokemonData.PokemonId))
+                if (CandyToEvolveDict.ContainsKey(PokemonData.PokemonId))
                 {
-                    return candyToEvolveDict[PokemonData.PokemonId];
+                    return CandyToEvolveDict[PokemonData.PokemonId];
                 }
                 return 0;
             }
@@ -97,7 +97,7 @@ namespace PokemonGo.RocketBot.Window

         public static void Initilize(DownloadItemTemplatesResponse itemtemplates)
         {
-            if (!initialized)
+            if (!_initialized)
             {
                 foreach (var t in itemtemplates.ItemTemplates)
                 {
@@ -105,11 +105,11 @@ namespace PokemonGo.RocketBot.Window
                     {
                         if (t.PokemonSettings != null)
                         {
-                            candyToEvolveDict.Add(t.PokemonSettings.PokemonId, t.PokemonSettings.CandyToEvolve);
+                            CandyToEvolveDict.Add(t.PokemonSettings.PokemonId, t.PokemonSettings.CandyToEvolve);
                         }
                     }
                 }
-                initialized = true;
+                _initialized = true;
             }
         }
     }
diff --git a/PokemonGo.RocketBot.Window/PokemonGo.RocketBot.Window.csproj b/PokemonGo.RocketBot.Window/PokemonGo.RocketBot.Window.csproj
index 61b4512..64dbaaa 100644
--- a/PokemonGo.RocketBot.Window/PokemonGo.RocketBot.Window.csproj
+++ b/PokemonGo.RocketBot.Window/PokemonGo.RocketBot.Window.csproj
@@ -130,30 +130,30 @@
   <ItemGroup>
     <Compile Include="ConsoleEventListener.cs" />
     <Compile Include="ConsoleLogger.cs" />
-    <Compile Include="DeviceHelper.cs" />
-    <Compile Include="ItemBox.cs">
+    <Compile Include="Helpers\DeviceHelper.cs" />
+    <Compile Include="Forms\ItemBox.cs">
       <SubType>UserControl</SubType>
     </Compile>
-    <Compile Include="ItemBox.designer.cs">
+    <Compile Include="Forms\ItemBox.designer.cs">
       <DependentUpon>ItemBox.cs</DependentUpon>
     </Compile>
-    <Compile Include="ItemForm.cs">
+    <Compile Include="Forms\ItemForm.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="ItemForm.designer.cs">
+    <Compile Include="Forms\ItemForm.designer.cs">
       <DependentUpon>ItemForm.cs</DependentUpon>
     </Compile>
-    <Compile Include="MainForm.cs">
+    <Compile Include="Forms\MainForm.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="MainForm.designer.cs">
+    <Compile Include="Forms\MainForm.designer.cs">
       <DependentUpon>MainForm.cs</DependentUpon>
     </Compile>
     <Compile Include="Models\LoggingStrings.cs" />
-    <Compile Include="NicknamePokemonForm.cs">
+    <Compile Include="Forms\NicknamePokemonForm.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="NicknamePokemonForm.designer.cs">
+    <Compile Include="Forms\NicknamePokemonForm.designer.cs">
       <DependentUpon>NicknamePokemonForm.cs</DependentUpon>
     </Compile>
     <Compile Include="Plugin\INecroPlugin.cs" />
@@ -166,13 +166,12 @@
       <DependentUpon>Resources.resx</DependentUpon>
     </Compile>
     <Compile Include="Resources\ProgressBar.cs" />
-    <Compile Include="SettingsForm.cs">
+    <Compile Include="Forms\SettingsForm.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="SettingsForm.designer.cs">
+    <Compile Include="Forms\SettingsForm.designer.cs">
       <DependentUpon>SettingsForm.cs</DependentUpon>
     </Compile>
-    <Compile Include="SimpleSession.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="WebSocketHandler\GetCommands\Events\WebResponce.cs" />
@@ -480,20 +479,20 @@
     <Content Include="Resources\Icon.ico" />
   </ItemGroup>
   <ItemGroup>
-    <EmbeddedResource Include="ItemBox.resx">
+    <EmbeddedResource Include="Forms\ItemBox.resx">
       <DependentUpon>ItemBox.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="MainForm.resx">
+    <EmbeddedResource Include="Forms\MainForm.resx">
       <DependentUpon>MainForm.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="NicknamePokemonForm.resx">
+    <EmbeddedResource Include="Forms\NicknamePokemonForm.resx">
       <DependentUpon>NicknamePokemonForm.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
-    <EmbeddedResource Include="SettingsForm.resx">
+    <EmbeddedResource Include="Forms\SettingsForm.resx">
       <DependentUpon>SettingsForm.cs</DependentUpon>
     </EmbeddedResource>
   </ItemGroup>
diff --git a/PokemonGo.RocketBot.Window/Program.cs b/PokemonGo.RocketBot.Window/Program.cs
index 3262316..3334776 100644
--- a/PokemonGo.RocketBot.Window/Program.cs
+++ b/PokemonGo.RocketBot.Window/Program.cs
@@ -2,6 +2,7 @@

 using System;
 using System.Windows.Forms;
+using PokemonGo.RocketBot.Window.Forms;

 #endregion

diff --git a/PokemonGo.RocketBot.Window/SimpleSession.cs b/PokemonGo.RocketBot.Window/SimpleSession.cs
deleted file mode 100644
index 5f28270..0000000
--- a/PokemonGo.RocketBot.Window/SimpleSession.cs
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
You may download the files in Public Git.