Clean up code

Brian [2016-08-11 04:50:19]
Clean up code
Filename
PokemonGo/RocketAPI/Window/Extensions.cs
PokemonGo/RocketAPI/Window/ItemBox.cs
PokemonGo/RocketAPI/Window/LocationManager.cs
PokemonGo/RocketAPI/Window/PokemonObject.cs
PokemonGo/RocketAPI/Window/SettingsForm.cs
diff --git a/PokemonGo/RocketAPI/Window/Extensions.cs b/PokemonGo/RocketAPI/Window/Extensions.cs
index 29ea9ff..64a6a1b 100644
--- a/PokemonGo/RocketAPI/Window/Extensions.cs
+++ b/PokemonGo/RocketAPI/Window/Extensions.cs
@@ -1,9 +1,4 @@
 using POGOProtos.Data;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;

 namespace PokemonGo.RocketAPI.Window
 {
@@ -11,7 +6,7 @@ namespace PokemonGo.RocketAPI.Window
     {
         public static float GetIV(this PokemonData poke)
         {
-            return (poke.IndividualAttack + poke.IndividualDefense + poke.IndividualStamina) / 45.0f;
+            return (poke.IndividualAttack + poke.IndividualDefense + poke.IndividualStamina)/45.0f;
         }
     }
-}
+}
\ No newline at end of file
diff --git a/PokemonGo/RocketAPI/Window/ItemBox.cs b/PokemonGo/RocketAPI/Window/ItemBox.cs
index ae60b2e..636b909 100644
--- a/PokemonGo/RocketAPI/Window/ItemBox.cs
+++ b/PokemonGo/RocketAPI/Window/ItemBox.cs
@@ -3,63 +3,76 @@ using System.Drawing;
 using System.Windows.Forms;
 using POGOProtos.Inventory.Item;

-namespace PokemonGo.RocketAPI.Window {
-    public partial class ItemBox : UserControl {
-        public ItemData item_ { get; }
-
-        public event EventHandler ItemClick;
-
-        public ItemBox(ItemData item) {
+namespace PokemonGo.RocketAPI.Window
+{
+    public partial class ItemBox : UserControl
+    {
+        public ItemBox(ItemData item)
+        {
             InitializeComponent();

             item_ = item;

-            pb.Image = (Image)Properties.Resources.ResourceManager.GetObject(item.ItemId.ToString());
+            pb.Image = (Image) Properties.Resources.ResourceManager.GetObject(item.ItemId.ToString());
             lbl.Text = item.Count.ToString();

-            foreach (Control control in this.Controls) {
+            foreach (Control control in Controls)
+            {
                 control.MouseEnter += childMouseEnter;
                 control.MouseLeave += childMouseLeave;
                 control.MouseClick += childMouseClick;
             }

-            if (item_.ItemId == ItemId.ItemIncubatorBasic || item_.ItemId == ItemId.ItemIncubatorBasicUnlimited) {
-                this.Enabled = false;
+            if (item_.ItemId == ItemId.ItemIncubatorBasic || item_.ItemId == ItemId.ItemIncubatorBasicUnlimited)
+            {
+                Enabled = false;
             }
         }

-        private void childMouseClick(object sender, MouseEventArgs e) {
+        public ItemData item_ { get; }
+
+        public event EventHandler ItemClick;
+
+        private void childMouseClick(object sender, MouseEventArgs e)
+        {
             OnItemClick(item_, EventArgs.Empty);
         }

-        protected override void OnMouseClick(MouseEventArgs e) {
+        protected override void OnMouseClick(MouseEventArgs e)
+        {
             base.OnMouseClick(e);
             OnItemClick(item_, EventArgs.Empty);
         }

-        private void childMouseLeave(object sender, EventArgs e) {
+        private void childMouseLeave(object sender, EventArgs e)
+        {
             OnMouseLeave(e);
         }

-        private void childMouseEnter(object sender, EventArgs e) {
+        private void childMouseEnter(object sender, EventArgs e)
+        {
             OnMouseEnter(e);
         }

-        protected override void OnMouseLeave(EventArgs e) {
+        protected override void OnMouseLeave(EventArgs e)
+        {
             base.OnMouseLeave(e);
-            this.BackColor = Color.Transparent;
+            BackColor = Color.Transparent;
         }

-        protected override void OnMouseEnter(EventArgs e) {
+        protected override void OnMouseEnter(EventArgs e)
+        {
             base.OnMouseEnter(e);
-            this.BackColor = Color.LightGreen;
+            BackColor = Color.LightGreen;
         }

-        protected virtual void OnItemClick(ItemData item, EventArgs e) {
-            EventHandler handler = ItemClick;
-            if (handler != null) {
+        protected virtual void OnItemClick(ItemData item, EventArgs e)
+        {
+            var handler = ItemClick;
+            if (handler != null)
+            {
                 handler(item, e);
             }
         }
     }
-}
+}
\ No newline at end of file
diff --git a/PokemonGo/RocketAPI/Window/LocationManager.cs b/PokemonGo/RocketAPI/Window/LocationManager.cs
index 20ce047..95388eb 100644
--- a/PokemonGo/RocketAPI/Window/LocationManager.cs
+++ b/PokemonGo/RocketAPI/Window/LocationManager.cs
@@ -11,7 +11,7 @@ namespace PokemonGo.RocketAPI.Window

         public LocationManager(Client client, double speed)
         {
-            this._client = client;
+            _client = client;
             _metersPerMillisecond = speed/3600;
         }

diff --git a/PokemonGo/RocketAPI/Window/PokemonObject.cs b/PokemonGo/RocketAPI/Window/PokemonObject.cs
index c913f95..98b7f09 100644
--- a/PokemonGo/RocketAPI/Window/PokemonObject.cs
+++ b/PokemonGo/RocketAPI/Window/PokemonObject.cs
@@ -1,7 +1,7 @@
-using POGOProtos.Data;
+using System.Collections.Generic;
+using POGOProtos.Data;
 using POGOProtos.Enums;
 using POGOProtos.Networking.Responses;
-using System.Collections.Generic;

 namespace PokemonGo.RocketAPI.Window
 {
@@ -49,10 +49,11 @@ namespace PokemonGo.RocketAPI.Window

         public float GetIV
         {
-            get { return (IndividualAttack + IndividualDefense + IndividualStamina) / 45f; }
+            get { return (IndividualAttack + IndividualDefense + IndividualStamina)/45f; }
         }

-        public string Nickname {
+        public string Nickname
+        {
             get { return PokemonData.Nickname; }
         }

diff --git a/PokemonGo/RocketAPI/Window/SettingsForm.cs b/PokemonGo/RocketAPI/Window/SettingsForm.cs
index 85e8b14..ca64d18 100644
--- a/PokemonGo/RocketAPI/Window/SettingsForm.cs
+++ b/PokemonGo/RocketAPI/Window/SettingsForm.cs
@@ -264,7 +264,5 @@ namespace PokemonGo.RocketAPI.Window
                 AdressBox.ForeColor = SystemColors.WindowText;
             }
         }
-
-
     }
 }
\ No newline at end of file
You may download the files in Public Git.