Clean up code

Brian [2016-08-23 14:01:58]
Clean up code
Filename
PokemonGo.RocketBot.Logic/Common/Translations.cs
PokemonGo.RocketBot.Logic/Settings.cs
PokemonGo.RocketBot.Logic/Tasks/LevelUpSpecificPokemonTask.cs
PokemonGo.RocketBot.Logic/Tasks/RecycleSpecificItemTask.cs
PokemonGo.RocketBot.Logic/Tasks/RenameSpecificPokemonTask.cs
PokemonGo.RocketBot.Logic/Tasks/UseIncenseTask.cs
PokemonGo.RocketBot.Logic/Tasks/UseLuckyEggTask.cs
PokemonGo.RocketBot.Window/Forms/MainForm.cs
PokemonGo.RocketBot.Window/Forms/SettingForm.cs
PokemonGo.RocketBot.Window/Helpers/ResourceHelper.cs
PokemonGo.RocketBot.Window/Models/LoggingStrings.cs
diff --git a/PokemonGo.RocketBot.Logic/Common/Translations.cs b/PokemonGo.RocketBot.Logic/Common/Translations.cs
index 2db460f..6aab17d 100644
--- a/PokemonGo.RocketBot.Logic/Common/Translations.cs
+++ b/PokemonGo.RocketBot.Logic/Common/Translations.cs
@@ -206,8 +206,7 @@ namespace PokemonGo.RocketBot.Logic.Common
             ItemTypeNameHandling = TypeNameHandling.Arrays,
             ItemConverterType = typeof(KeyValuePairConverter),
             ObjectCreationHandling = ObjectCreationHandling.Replace,
-            DefaultValueHandling = DefaultValueHandling.Populate)]
-        private readonly
+            DefaultValueHandling = DefaultValueHandling.Populate)] private readonly
             List<KeyValuePair<PokemonMove, string>> _pokemonMovesetTranslationStrings =
                 new List<KeyValuePair<PokemonMove, string>>
                 {
@@ -397,8 +396,7 @@ namespace PokemonGo.RocketBot.Logic.Common
             ItemTypeNameHandling = TypeNameHandling.Arrays,
             ItemConverterType = typeof(KeyValuePairConverter),
             ObjectCreationHandling = ObjectCreationHandling.Replace,
-            DefaultValueHandling = DefaultValueHandling.Populate)]
-        private readonly
+            DefaultValueHandling = DefaultValueHandling.Populate)] private readonly
             List<KeyValuePair<PokemonId, string>> _pokemonTranslationStrings = new List<KeyValuePair<PokemonId, string>>
             {
                 new KeyValuePair<PokemonId, string>((PokemonId) 001, "Bulbasaur"),
@@ -890,7 +888,7 @@ namespace PokemonGo.RocketBot.Logic.Common
                 var input = File.ReadAllText(fullPath);

                 var jsonSettings = new JsonSerializerSettings();
-                jsonSettings.Converters.Add(new StringEnumConverter { CamelCaseText = true });
+                jsonSettings.Converters.Add(new StringEnumConverter {CamelCaseText = true});
                 jsonSettings.ObjectCreationHandling = ObjectCreationHandling.Replace;
                 jsonSettings.DefaultValueHandling = DefaultValueHandling.Populate;

@@ -941,7 +939,7 @@ namespace PokemonGo.RocketBot.Logic.Common
         public void Save(string fullPath)
         {
             var output = JsonConvert.SerializeObject(this, Formatting.Indented,
-                new StringEnumConverter { CamelCaseText = true });
+                new StringEnumConverter {CamelCaseText = true});

             var folder = Path.GetDirectoryName(fullPath);
             if (folder != null && !Directory.Exists(folder))
diff --git a/PokemonGo.RocketBot.Logic/Settings.cs b/PokemonGo.RocketBot.Logic/Settings.cs
index 392bbd6..cd553d9 100644
--- a/PokemonGo.RocketBot.Logic/Settings.cs
+++ b/PokemonGo.RocketBot.Logic/Settings.cs
@@ -125,7 +125,7 @@ namespace PokemonGo.RocketBot.Logic
                 }
                 if (string.IsNullOrEmpty(DeviceId) || DeviceId == "8525f5d8201f78b5")
                     DeviceId = RandomString(16, "0123456789abcdef");
-                        // changed to random hex as full alphabet letters could have been flagged
+                // changed to random hex as full alphabet letters could have been flagged

                 // Jurann: Note that some device IDs I saw when adding devices had smaller numbers, only 12 or 14 chars instead of 16 - probably not important but noted here anyway

diff --git a/PokemonGo.RocketBot.Logic/Tasks/LevelUpSpecificPokemonTask.cs b/PokemonGo.RocketBot.Logic/Tasks/LevelUpSpecificPokemonTask.cs
index 6442e8f..f895871 100644
--- a/PokemonGo.RocketBot.Logic/Tasks/LevelUpSpecificPokemonTask.cs
+++ b/PokemonGo.RocketBot.Logic/Tasks/LevelUpSpecificPokemonTask.cs
@@ -1,12 +1,8 @@
-using POGOProtos.Networking.Responses;
+using System.Threading.Tasks;
 using PokemonGo.RocketBot.Logic.Logging;
 using PokemonGo.RocketBot.Logic.State;
 using PokemonGo.RocketBot.Logic.Utils;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using POGOProtos.Networking.Responses;

 namespace PokemonGo.RocketBot.Logic.Tasks
 {
@@ -30,4 +26,4 @@ namespace PokemonGo.RocketBot.Logic.Tasks
             DelayingUtils.Delay(session.LogicSettings.DelayBetweenPlayerActions, 0);
         }
     }
-}
+}
\ No newline at end of file
diff --git a/PokemonGo.RocketBot.Logic/Tasks/RecycleSpecificItemTask.cs b/PokemonGo.RocketBot.Logic/Tasks/RecycleSpecificItemTask.cs
index 3b6d753..d81a36f 100644
--- a/PokemonGo.RocketBot.Logic/Tasks/RecycleSpecificItemTask.cs
+++ b/PokemonGo.RocketBot.Logic/Tasks/RecycleSpecificItemTask.cs
@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Threading.Tasks;
 using PokemonGo.RocketBot.Logic.Logging;
 using PokemonGo.RocketBot.Logic.State;
 using POGOProtos.Inventory.Item;
@@ -29,4 +25,4 @@ namespace PokemonGo.RocketBot.Logic.Tasks
             }
         }
     }
-}
+}
\ No newline at end of file
diff --git a/PokemonGo.RocketBot.Logic/Tasks/RenameSpecificPokemonTask.cs b/PokemonGo.RocketBot.Logic/Tasks/RenameSpecificPokemonTask.cs
index 27ea0a0..2dfa195 100644
--- a/PokemonGo.RocketBot.Logic/Tasks/RenameSpecificPokemonTask.cs
+++ b/PokemonGo.RocketBot.Logic/Tasks/RenameSpecificPokemonTask.cs
@@ -1,15 +1,9 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Threading.Tasks;
+using PokemonGo.RocketBot.Logic.Logging;
 using PokemonGo.RocketBot.Logic.State;
-using PokemonGo.RocketBot.Logic.Event;
-using PokemonGo.RocketBot.Logic.Common;
+using PokemonGo.RocketBot.Logic.Utils;
 using POGOProtos.Data;
 using POGOProtos.Networking.Responses;
-using PokemonGo.RocketBot.Logic.Logging;
-using PokemonGo.RocketBot.Logic.Utils;

 namespace PokemonGo.RocketBot.Logic.Tasks
 {
@@ -32,4 +26,4 @@ namespace PokemonGo.RocketBot.Logic.Tasks
             //});
         }
     }
-}
+}
\ No newline at end of file
diff --git a/PokemonGo.RocketBot.Logic/Tasks/UseIncenseTask.cs b/PokemonGo.RocketBot.Logic/Tasks/UseIncenseTask.cs
index d38c9da..6f46467 100644
--- a/PokemonGo.RocketBot.Logic/Tasks/UseIncenseTask.cs
+++ b/PokemonGo.RocketBot.Logic/Tasks/UseIncenseTask.cs
@@ -1,12 +1,9 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using System.Threading.Tasks;
-using PokemonGo.RocketBot.Logic.State;
-using POGOProtos.Networking.Responses;
 using PokemonGo.RocketBot.Logic.Logging;
+using PokemonGo.RocketBot.Logic.State;
 using POGOProtos.Inventory.Item;
+using POGOProtos.Networking.Responses;

 namespace PokemonGo.RocketBot.Logic.Tasks
 {
@@ -36,4 +33,4 @@ namespace PokemonGo.RocketBot.Logic.Tasks
             }
         }
     }
-}
+}
\ No newline at end of file
diff --git a/PokemonGo.RocketBot.Logic/Tasks/UseLuckyEggTask.cs b/PokemonGo.RocketBot.Logic/Tasks/UseLuckyEggTask.cs
index bd579df..257182c 100644
--- a/PokemonGo.RocketBot.Logic/Tasks/UseLuckyEggTask.cs
+++ b/PokemonGo.RocketBot.Logic/Tasks/UseLuckyEggTask.cs
@@ -1,11 +1,8 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using System.Threading.Tasks;
+using PokemonGo.RocketBot.Logic.Logging;
 using PokemonGo.RocketBot.Logic.State;
 using POGOProtos.Networking.Responses;
-using PokemonGo.RocketBot.Logic.Logging;

 namespace PokemonGo.RocketBot.Logic.Tasks
 {
@@ -38,4 +35,4 @@ namespace PokemonGo.RocketBot.Logic.Tasks
             }
         }
     }
-}
+}
\ No newline at end of file
diff --git a/PokemonGo.RocketBot.Window/Forms/MainForm.cs b/PokemonGo.RocketBot.Window/Forms/MainForm.cs
index 3f4df25..9af0793 100644
--- a/PokemonGo.RocketBot.Window/Forms/MainForm.cs
+++ b/PokemonGo.RocketBot.Window/Forms/MainForm.cs
@@ -36,7 +36,6 @@ using POGOProtos.Inventory;
 using POGOProtos.Inventory.Item;
 using POGOProtos.Map.Fort;
 using POGOProtos.Map.Pokemon;
-using POGOProtos.Networking.Responses;
 using Segment;
 using Segment.Model;
 using Logger = PokemonGo.RocketBot.Logic.Logging.Logger;
@@ -210,31 +209,31 @@ namespace PokemonGo.RocketBot.Window.Forms
             Logger.SetLoggerContext(_session);

             _session.Navigation.UpdatePositionEvent +=
-                (lat, lng) => _session.EventDispatcher.Send(new UpdatePositionEvent { Latitude = lat, Longitude = lng });
+                (lat, lng) => _session.EventDispatcher.Send(new UpdatePositionEvent {Latitude = lat, Longitude = lng});
             _session.Navigation.UpdatePositionEvent += Navigation_UpdatePositionEvent;

             RouteOptimizeUtil.RouteOptimizeEvent +=
                 optimizedroute =>
-                    _session.EventDispatcher.Send(new OptimizeRouteEvent { OptimizedRoute = optimizedroute });
+                    _session.EventDispatcher.Send(new OptimizeRouteEvent {OptimizedRoute = optimizedroute});
             RouteOptimizeUtil.RouteOptimizeEvent += InitializePokestopsAndRoute;

             Navigation.GetHumanizeRouteEvent +=
                 (route, destination) =>
-                    _session.EventDispatcher.Send(new GetHumanizeRouteEvent { Route = route, Destination = destination });
+                    _session.EventDispatcher.Send(new GetHumanizeRouteEvent {Route = route, Destination = destination});
             Navigation.GetHumanizeRouteEvent += UpdateMap;

             FarmPokestopsTask.LootPokestopEvent +=
-                pokestop => _session.EventDispatcher.Send(new LootPokestopEvent { Pokestop = pokestop });
+                pokestop => _session.EventDispatcher.Send(new LootPokestopEvent {Pokestop = pokestop});
             FarmPokestopsTask.LootPokestopEvent += UpdateMap;

             CatchNearbyPokemonsTask.PokemonEncounterEvent +=
                 mappokemons =>
-                    _session.EventDispatcher.Send(new PokemonsEncounterEvent { EncounterPokemons = mappokemons });
+                    _session.EventDispatcher.Send(new PokemonsEncounterEvent {EncounterPokemons = mappokemons});
             CatchNearbyPokemonsTask.PokemonEncounterEvent += UpdateMap;

             CatchIncensePokemonsTask.PokemonEncounterEvent +=
                 mappokemons =>
-                    _session.EventDispatcher.Send(new PokemonsEncounterEvent { EncounterPokemons = mappokemons });
+                    _session.EventDispatcher.Send(new PokemonsEncounterEvent {EncounterPokemons = mappokemons});
             CatchIncensePokemonsTask.PokemonEncounterEvent += UpdateMap;
         }

@@ -263,8 +262,8 @@ namespace PokemonGo.RocketBot.Window.Forms
                 _playerLocations.Clear();
                 var routePoint =
                     (from pokeStop in pokeStops
-                     where pokeStop != null
-                     select new PointLatLng(pokeStop.Latitude, pokeStop.Longitude)).ToList();
+                        where pokeStop != null
+                        select new PointLatLng(pokeStop.Latitude, pokeStop.Longitude)).ToList();

                 _routePoints = routePoint;
                 togglePrecalRoute.Enabled = true;
@@ -285,109 +284,6 @@ namespace PokemonGo.RocketBot.Window.Forms
             }, null);
         }

-        #region UPDATEMAP
-        private void UpdateMap()
-        {
-            SynchronizationContext.Post(o =>
-            {
-                var route = new GMapRoute(_playerLocations, "step")
-                {
-                    Stroke = new Pen(Color.FromArgb(175, 175, 175), 2) { DashStyle = DashStyle.Dot }
-                };
-                _playerOverlay.Routes.Clear();
-                _playerOverlay.Routes.Add(route);
-            }, null);
-        }
-
-        private void UpdateMap(List<GeoCoordinate> route, GeoCoordinate destination)
-        {
-            var routePointLatLngs = new List<PointLatLng>();
-            foreach (var item in route)
-            {
-                routePointLatLngs.Add(new PointLatLng(item.Latitude, item.Longitude));
-            }
-            var routes = new GMapRoute(routePointLatLngs, routePointLatLngs.ToString())
-            {
-                Stroke = new Pen(Color.FromArgb(128, 0, 179, 253), 4) { DashStyle = DashStyle.Dash }
-            };
-            _playerRouteOverlay.Routes.Add(routes);
-            /* Logger.Write("new call");
-             List<PointLatLng> routePointLatLngs = new List<PointLatLng>();
-             Logger.Write("new route size: " +route.Count);
-             PointLatLng destinationPointLatLng = new PointLatLng(destination.Latitude, destination.Longitude);
-             foreach (var item in route)
-             {
-                 routePointLatLngs.Add(new PointLatLng(item.Latitude, item.Longitude));
-             }
-
-             List<PointLatLng> routePointsDistinct = new List<PointLatLng>(_routePoints.Distinct());
-
-             int listPosition;
-             for (listPosition = 0; listPosition < routePointsDistinct.Count; listPosition++)
-             {
-                 Logger.Write("listPosition: " + listPosition);
-                 var item = routePointsDistinct[listPosition];
-                 if (item == destinationPointLatLng)
-                     break;
-             }
-
-             if (listPosition == 0)
-                 return;
-
-             //routePointsDistinct.Remove(destinationPointLatLng);
-             routePointsDistinct.InsertRange(listPosition, routePointLatLngs);
-             //routePointsDistinct.Remove(routePointsDistinct[listPosition - 1]);
-
-
-             _pokestopsOverlay.Routes.Clear();
-             var routes = new GMapRoute(routePointsDistinct, "Walking Path")
-             {
-                 Stroke = new Pen(Color.FromArgb(128, 0, 179, 253), 4)
-             };
-             _pokestopsOverlay.Routes.Add(routes);*/
-        }
-
-        private void UpdateMap(FortData pokestop)
-        {
-            SynchronizationContext.Post(o =>
-            {
-                var pokeStopLoc = new PointLatLng(pokestop.Latitude, pokestop.Longitude);
-
-                lock (_pokestopsOverlay.Markers)
-                {
-                    for (var i = 0; i < _pokestopsOverlay.Markers.Count; i++)
-                    {
-                        var marker = _pokestopsOverlay.Markers[i];
-                        if (marker.Position == pokeStopLoc)
-                            _pokestopsOverlay.Markers.Remove(marker);
-                    }
-                }
-
-                GMapMarker pokestopMarker = new GMapMarkerPokestops(pokeStopLoc,
-                    ResourceHelper.GetImage("Pokestop_looted"));
-                //pokestopMarker.ToolTipMode = MarkerTooltipMode.OnMouseOver;
-                //pokestopMarker.ToolTip = new GMapBaloonToolTip(pokestopMarker);
-                _pokestopsOverlay.Markers.Add(pokestopMarker);
-            }, null);
-        }
-
-        private void UpdateMap(List<MapPokemon> encounterPokemons)
-        {
-            SynchronizationContext.Post(o =>
-            {
-                _pokemonsOverlay.Markers.Clear();
-
-                foreach (var pokemon in encounterPokemons)
-                {
-                    var pkmImage = ResourceHelper.GetImage("Pokemon_" + pokemon.PokemonId.GetHashCode(), 50, 50);
-                    var pointLatLng = new PointLatLng(pokemon.Latitude, pokemon.Longitude);
-                    GMapMarker pkmMarker = new GMapMarkerTrainer(pointLatLng, pkmImage);
-                    _pokemonsOverlay.Markers.Add(pkmMarker);
-                }
-            }, null);
-        }
-        #endregion
-
         private void Navigation_UpdatePositionEvent(double lat, double lng)
         {
             var latlng = new PointLatLng(lat, lng);
@@ -505,6 +401,111 @@ namespace PokemonGo.RocketBot.Window.Forms
             }
         }

+        #region UPDATEMAP
+
+        private void UpdateMap()
+        {
+            SynchronizationContext.Post(o =>
+            {
+                var route = new GMapRoute(_playerLocations, "step")
+                {
+                    Stroke = new Pen(Color.FromArgb(175, 175, 175), 2) {DashStyle = DashStyle.Dot}
+                };
+                _playerOverlay.Routes.Clear();
+                _playerOverlay.Routes.Add(route);
+            }, null);
+        }
+
+        private void UpdateMap(List<GeoCoordinate> route, GeoCoordinate destination)
+        {
+            var routePointLatLngs = new List<PointLatLng>();
+            foreach (var item in route)
+            {
+                routePointLatLngs.Add(new PointLatLng(item.Latitude, item.Longitude));
+            }
+            var routes = new GMapRoute(routePointLatLngs, routePointLatLngs.ToString())
+            {
+                Stroke = new Pen(Color.FromArgb(128, 0, 179, 253), 4) {DashStyle = DashStyle.Dash}
+            };
+            _playerRouteOverlay.Routes.Add(routes);
+            /* Logger.Write("new call");
+             List<PointLatLng> routePointLatLngs = new List<PointLatLng>();
+             Logger.Write("new route size: " +route.Count);
+             PointLatLng destinationPointLatLng = new PointLatLng(destination.Latitude, destination.Longitude);
+             foreach (var item in route)
+             {
+                 routePointLatLngs.Add(new PointLatLng(item.Latitude, item.Longitude));
+             }
+
+             List<PointLatLng> routePointsDistinct = new List<PointLatLng>(_routePoints.Distinct());
+
+             int listPosition;
+             for (listPosition = 0; listPosition < routePointsDistinct.Count; listPosition++)
+             {
+                 Logger.Write("listPosition: " + listPosition);
+                 var item = routePointsDistinct[listPosition];
+                 if (item == destinationPointLatLng)
+                     break;
+             }
+
+             if (listPosition == 0)
+                 return;
+
+             //routePointsDistinct.Remove(destinationPointLatLng);
+             routePointsDistinct.InsertRange(listPosition, routePointLatLngs);
+             //routePointsDistinct.Remove(routePointsDistinct[listPosition - 1]);
+
+
+             _pokestopsOverlay.Routes.Clear();
+             var routes = new GMapRoute(routePointsDistinct, "Walking Path")
+             {
+                 Stroke = new Pen(Color.FromArgb(128, 0, 179, 253), 4)
+             };
+             _pokestopsOverlay.Routes.Add(routes);*/
+        }
+
+        private void UpdateMap(FortData pokestop)
+        {
+            SynchronizationContext.Post(o =>
+            {
+                var pokeStopLoc = new PointLatLng(pokestop.Latitude, pokestop.Longitude);
+
+                lock (_pokestopsOverlay.Markers)
+                {
+                    for (var i = 0; i < _pokestopsOverlay.Markers.Count; i++)
+                    {
+                        var marker = _pokestopsOverlay.Markers[i];
+                        if (marker.Position == pokeStopLoc)
+                            _pokestopsOverlay.Markers.Remove(marker);
+                    }
+                }
+
+                GMapMarker pokestopMarker = new GMapMarkerPokestops(pokeStopLoc,
+                    ResourceHelper.GetImage("Pokestop_looted"));
+                //pokestopMarker.ToolTipMode = MarkerTooltipMode.OnMouseOver;
+                //pokestopMarker.ToolTip = new GMapBaloonToolTip(pokestopMarker);
+                _pokestopsOverlay.Markers.Add(pokestopMarker);
+            }, null);
+        }
+
+        private void UpdateMap(List<MapPokemon> encounterPokemons)
+        {
+            SynchronizationContext.Post(o =>
+            {
+                _pokemonsOverlay.Markers.Clear();
+
+                foreach (var pokemon in encounterPokemons)
+                {
+                    var pkmImage = ResourceHelper.GetImage("Pokemon_" + pokemon.PokemonId.GetHashCode(), 50, 50);
+                    var pointLatLng = new PointLatLng(pokemon.Latitude, pokemon.Longitude);
+                    GMapMarker pkmMarker = new GMapMarkerTrainer(pointLatLng, pkmImage);
+                    _pokemonsOverlay.Markers.Add(pkmMarker);
+                }
+            }, null);
+        }
+
+        #endregion
+
         #region INTERFACE

         public static void ColoredConsoleWrite(Color color, string text)
@@ -588,7 +589,7 @@ namespace PokemonGo.RocketBot.Window.Forms
         {
             //olvPokemonList.ButtonClick += PokemonListButton_Click;

-            pkmnName.ImageGetter = delegate (object rowObject)
+            pkmnName.ImageGetter = delegate(object rowObject)
             {
                 var pokemon = rowObject as PokemonObject;

@@ -596,13 +597,13 @@ namespace PokemonGo.RocketBot.Window.Forms
                 var key = pokemon.PokemonId.ToString();
                 if (!olvPokemonList.SmallImageList.Images.ContainsKey(key))
                 {
-                    var img = ResourceHelper.GetPokemonImage((int)pokemon.PokemonId);
+                    var img = ResourceHelper.GetPokemonImage((int) pokemon.PokemonId);
                     olvPokemonList.SmallImageList.Images.Add(key, img);
                 }
                 return key;
             };

-            olvPokemonList.FormatRow += delegate (object sender, FormatRowEventArgs e)
+            olvPokemonList.FormatRow += delegate(object sender, FormatRowEventArgs e)
             {
                 var pok = e.Model as PokemonObject;
                 if (olvPokemonList.Objects
@@ -622,7 +623,7 @@ namespace PokemonGo.RocketBot.Window.Forms
                 }
             };

-            cmsPokemonList.Opening += delegate (object sender, CancelEventArgs e)
+            cmsPokemonList.Opening += delegate(object sender, CancelEventArgs e)
             {
                 e.Cancel = false;
                 cmsPokemonList.Items.Clear();
@@ -645,7 +646,7 @@ namespace PokemonGo.RocketBot.Window.Forms
                 item.Click += delegate { TransferPokemon(pokemons); };
                 cmsPokemonList.Items.Add(item);

-                item = new ToolStripMenuItem { Text = @"Rename" };
+                item = new ToolStripMenuItem {Text = @"Rename"};
                 item.Click += delegate
                 {
                     using (var form = count == 1 ? new NicknamePokemonForm(pokemonObject) : new NicknamePokemonForm())
@@ -660,30 +661,30 @@ namespace PokemonGo.RocketBot.Window.Forms

                 if (canAllEvolve)
                 {
-                    item = new ToolStripMenuItem { Text = $"Evolve {count} pokemon" };
+                    item = new ToolStripMenuItem {Text = $"Evolve {count} pokemon"};
                     item.Click += delegate { EvolvePokemon(pokemons); };
                     cmsPokemonList.Items.Add(item);
                 }

                 if (count != 1) return;
-                item = new ToolStripMenuItem { Text = @"PowerUp" };
+                item = new ToolStripMenuItem {Text = @"PowerUp"};
                 item.Click += delegate { PowerUpPokemon(pokemons); };
                 cmsPokemonList.Items.Add(item);
                 cmsPokemonList.Items.Add(separator);

-                item = new ToolStripMenuItem { Text = @"Transfer Clean Up (Keep highest IV)" };
+                item = new ToolStripMenuItem {Text = @"Transfer Clean Up (Keep highest IV)"};
                 item.Click += delegate { CleanUpTransferPokemon(pokemonObject, "IV"); };
                 cmsPokemonList.Items.Add(item);

-                item = new ToolStripMenuItem { Text = @"Transfer Clean Up (Keep highest CP)" };
+                item = new ToolStripMenuItem {Text = @"Transfer Clean Up (Keep highest CP)"};
                 item.Click += delegate { CleanUpTransferPokemon(pokemonObject, "CP"); };
                 cmsPokemonList.Items.Add(item);

-                item = new ToolStripMenuItem { Text = @"Evolve Clean Up (Highest IV)" };
+                item = new ToolStripMenuItem {Text = @"Evolve Clean Up (Highest IV)"};
                 item.Click += delegate { CleanUpEvolvePokemon(pokemonObject, "IV"); };
                 cmsPokemonList.Items.Add(item);

-                item = new ToolStripMenuItem { Text = @"Evolve Clean Up (Highest CP)" };
+                item = new ToolStripMenuItem {Text = @"Evolve Clean Up (Highest CP)"};
                 item.Click += delegate { CleanUpEvolvePokemon(pokemonObject, "CP"); };
                 cmsPokemonList.Items.Add(item);

@@ -700,17 +701,17 @@ namespace PokemonGo.RocketBot.Window.Forms
                 if (cName.Equals("Transfer"))
                 {
                     // ReSharper disable once PossibleNullReferenceException
-                    TransferPokemon(new List<PokemonData> { pokemon.PokemonData });
+                    TransferPokemon(new List<PokemonData> {pokemon.PokemonData});
                 }
                 else if (cName.Equals("Power Up"))
                 {
                     // ReSharper disable once PossibleNullReferenceException
-                    PowerUpPokemon(new List<PokemonData> { pokemon.PokemonData });
+                    PowerUpPokemon(new List<PokemonData> {pokemon.PokemonData});
                 }
                 else if (cName.Equals("Evolve"))
                 {
                     // ReSharper disable once PossibleNullReferenceException
-                    EvolvePokemon(new List<PokemonData> { pokemon.PokemonData });
+                    EvolvePokemon(new List<PokemonData> {pokemon.PokemonData});
                 }
             }
             catch (Exception ex)
@@ -892,7 +893,7 @@ namespace PokemonGo.RocketBot.Window.Forms
                 foreach (var pokemon in pokemons)
                 {
                     var pokemonObject = new PokemonObject(pokemon);
-                    var family = _families.First(i => (int)i.FamilyId <= (int)pokemon.PokemonId);
+                    var family = _families.First(i => (int) i.FamilyId <= (int) pokemon.PokemonId);
                     pokemonObject.Candy = family.Candy_;
                     pokemonObjects.Add(pokemonObject);
                 }
@@ -952,7 +953,7 @@ namespace PokemonGo.RocketBot.Window.Forms

         private async void ItemBox_ItemClick(object sender, EventArgs e)
         {
-            var item = (ItemData)sender;
+            var item = (ItemData) sender;

             using (var form = new ItemForm(item))
             {
@@ -962,31 +963,32 @@ namespace PokemonGo.RocketBot.Window.Forms
                 switch (item.ItemId)
                 {
                     case ItemId.ItemLuckyEgg:
+                    {
+                        if (_session.Client == null)
                         {
-                            if (_session.Client == null)
-                            {
-                                Logger.Write($"Bot must be running first!", LogLevel.Warning);
-                                SetState(true);
-                                return;
-                            }
-                            await UseLuckyEggTask.Execute(_session);
+                            Logger.Write($"Bot must be running first!", LogLevel.Warning);
+                            SetState(true);
+                            return;
                         }
+                        await UseLuckyEggTask.Execute(_session);
+                    }
                         break;
                     case ItemId.ItemIncenseOrdinary:
+                    {
+                        if (_session.Client == null)
                         {
-                            if (_session.Client == null)
-                            {
-                                Logger.Write($"Bot must be running first!", LogLevel.Error);
-                                SetState(true);
-                                return;
-                            }
-                            await UseIncenseTask.Execute(_session);
+                            Logger.Write($"Bot must be running first!", LogLevel.Error);
+                            SetState(true);
+                            return;
                         }
+                        await UseIncenseTask.Execute(_session);
+                    }
                         break;
                     default:
-                        {
-                            await RecycleSpecificItemTask.Execute(_session, item.ItemId, decimal.ToInt32(form.numCount.Value));
-                        }
+                    {
+                        await
+                            RecycleSpecificItemTask.Execute(_session, item.ItemId, decimal.ToInt32(form.numCount.Value));
+                    }
                         break;
                 }
                 await ReloadPokemonList();
diff --git a/PokemonGo.RocketBot.Window/Forms/SettingForm.cs b/PokemonGo.RocketBot.Window/Forms/SettingForm.cs
index d8843b0..67ebc3a 100644
--- a/PokemonGo.RocketBot.Window/Forms/SettingForm.cs
+++ b/PokemonGo.RocketBot.Window/Forms/SettingForm.cs
@@ -11,7 +11,6 @@ using PokemonGo.RocketAPI.Enums;
 using PokemonGo.RocketBot.Logic;
 using PokemonGo.RocketBot.Window.Helpers;
 using POGOProtos.Enums;
-using System.Reflection;

 namespace PokemonGo.RocketBot.Window.Forms
 {
@@ -286,6 +285,14 @@ namespace PokemonGo.RocketBot.Window.Forms
             #endregion
         }

+        private void latLabel_Click(object sender, EventArgs e)
+        {
+        }
+
+        private void tbLatitude_TextChanged(object sender, EventArgs e)
+        {
+        }
+
         #region private methods

         private static int ConvertStringToInt(string input)
@@ -319,7 +326,7 @@ namespace PokemonGo.RocketBot.Window.Forms
         /// </summary>
         private void GetLanguageList()
         {
-            var languages = new List<string> { "en" };
+            var languages = new List<string> {"en"};
             var langFiles = Directory.GetFiles(LanguagePath, "*.json", SearchOption.TopDirectoryOnly);
             languages.AddRange(langFiles.Select(
                 langFileName => Path.GetFileNameWithoutExtension(langFileName)?.Replace("translation.", ""))
@@ -336,7 +343,7 @@ namespace PokemonGo.RocketBot.Window.Forms
             tbLatitude.Text = gMapCtrl.Position.Lat.ToString(CultureInfo.InvariantCulture);
             tbLongitude.Text = gMapCtrl.Position.Lng.ToString(CultureInfo.InvariantCulture);
             //update trackbar
-            trackBar.Value = (int)Math.Round(gMapCtrl.Zoom);
+            trackBar.Value = (int) Math.Round(gMapCtrl.Zoom);
         }

         /// <summary>
@@ -668,7 +675,7 @@ namespace PokemonGo.RocketBot.Window.Forms

         private void AdressBox_KeyPress(object sender, KeyPressEventArgs e)
         {
-            if (e.KeyChar != (char)Keys.Enter)
+            if (e.KeyChar != (char) Keys.Enter)
             {
                 return;
             }
@@ -763,15 +770,5 @@ namespace PokemonGo.RocketBot.Window.Forms
         }

         #endregion
-
-        private void latLabel_Click(object sender, EventArgs e)
-        {
-
-        }
-
-        private void tbLatitude_TextChanged(object sender, EventArgs e)
-        {
-
-        }
     }
 }
\ No newline at end of file
diff --git a/PokemonGo.RocketBot.Window/Helpers/ResourceHelper.cs b/PokemonGo.RocketBot.Window/Helpers/ResourceHelper.cs
index 6d7cc4b..4bcc81c 100644
--- a/PokemonGo.RocketBot.Window/Helpers/ResourceHelper.cs
+++ b/PokemonGo.RocketBot.Window/Helpers/ResourceHelper.cs
@@ -7,18 +7,18 @@ namespace PokemonGo.RocketBot.Window.Helpers
     {
         public static Image GetImage(string name)
         {
-            return (Image)Properties.Resources.ResourceManager.GetObject(name);
+            return (Image) Properties.Resources.ResourceManager.GetObject(name);
         }

         public static Image GetImage(string name, int maxHeight, int maxWidth)
         {
             var image = GetImage(name);
-            var ratioX = (double)maxWidth / image.Width;
-            var ratioY = (double)maxHeight / image.Height;
+            var ratioX = (double) maxWidth/image.Width;
+            var ratioY = (double) maxHeight/image.Height;
             var ratio = Math.Min(ratioX, ratioY);

-            var newWidth = (int)(image.Width * ratio);
-            var newHeight = (int)(image.Height * ratio);
+            var newWidth = (int) (image.Width*ratio);
+            var newHeight = (int) (image.Height*ratio);

             var newImage = new Bitmap(newWidth, newHeight);

diff --git a/PokemonGo.RocketBot.Window/Models/LoggingStrings.cs b/PokemonGo.RocketBot.Window/Models/LoggingStrings.cs
index 8388572..f6b9744 100644
--- a/PokemonGo.RocketBot.Window/Models/LoggingStrings.cs
+++ b/PokemonGo.RocketBot.Window/Models/LoggingStrings.cs
@@ -66,7 +66,7 @@ namespace PokemonGo.RocketBot.Window.Models
                     TranslationString.LogEntryEvolved) ?? "EVOLVED";

             LevelUp =
-                 session?.Translation.GetTranslation(
+                session?.Translation.GetTranslation(
                     TranslationString.LogEntryLevelUp) ?? "LEVELUP";

             Farming =
You may download the files in Public Git.