Skip to content

Commit

Permalink
No more json shenneniygans means a smaller file <3
Browse files Browse the repository at this point in the history
  • Loading branch information
miltoncandelero committed Oct 5, 2018
1 parent bccfbf6 commit 7dbf191
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 183 deletions.
7 changes: 1 addition & 6 deletions Boop/Boop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.1.%2a</ApplicationVersion>
<ApplicationVersion>2.0.0.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
Expand Down Expand Up @@ -60,10 +60,6 @@
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
Expand Down Expand Up @@ -129,7 +125,6 @@
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.manifest" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
180 changes: 69 additions & 111 deletions Boop/InfoBox.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 1 addition & 62 deletions Boop/InfoBox.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Newtonsoft.Json.Linq;
using System;
using System;
using System.Drawing;
using System.IO;
using System.Net;
Expand All @@ -21,66 +20,6 @@ private void InfoBox_Load(object sender, EventArgs e)
{
this.Text = "Boop " + Utils.GetCurrentVersion();
label1.Text = Utils.GetCurrentVersion();
new Task(LoadContributors).Start();
}

private void LoadContributors()
{
try
{
HttpWebRequest HttpRequestObj = (HttpWebRequest)HttpWebRequest.Create(@"https://api.github.com/repos/miltoncandelero/Boop/contributors");
HttpRequestObj.Credentials = CredentialCache.DefaultCredentials;
HttpRequestObj.ContentType = "application/json";
HttpRequestObj.Method = "GET";
HttpRequestObj.Accept = "application/json";
HttpRequestObj.UserAgent = "Boop"; // NEEDS SOMETHING WRITTEN!
HttpWebResponse response = (HttpWebResponse)HttpRequestObj.GetResponse();
string content = new StreamReader(response.GetResponseStream()).ReadToEnd();


JArray a = JArray.Parse(content);


this.Invoke((MethodInvoker)delegate
{
lvContributors.Items.Clear();
foreach (JObject o in a.Children<JObject>())
{
lvContributors.Items.Add((string)o["login"]);
}
});

}
catch (Exception)
{
this.Invoke((MethodInvoker)delegate
{
//shrink all
this.Height = 174;
});
}

}

private void lvContributors_ColumnWidthChanging(object sender, ColumnWidthChangingEventArgs e)
{
//Keep the width not changed.
e.NewWidth = ((ListView)sender).Columns[e.ColumnIndex].Width;
//Cancel the event.
e.Cancel = true;
}

private void lvContributors_SelectedIndexChanged(object sender, EventArgs e)
{
//Pls no touching the snek list.
lvContributors.SelectedIndices.Clear();
}

private void lvContributors_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
e.Graphics.FillRectangle(Brushes.Red, e.Bounds);
e.DrawText();
}

}
}
Binary file modified Boop/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown.
4 changes: 0 additions & 4 deletions Boop/packages.config

This file was deleted.

0 comments on commit 7dbf191

Please sign in to comment.