Skip to content

Commit

Permalink
Add new icon
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Aug 26, 2022
1 parent 0a2382d commit 246ae94
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 12 deletions.
1 change: 1 addition & 0 deletions Bloxstrap/Dialogs/Preferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public partial class Preferences : Form
{ "Late 2015", BootstrapperIcon.IconLate2015 },
{ "2017", BootstrapperIcon.Icon2017 },
{ "2019", BootstrapperIcon.Icon2019 },
{ "2022", BootstrapperIcon.Icon2022 }
};

private string ChannelInfo
Expand Down
3 changes: 2 additions & 1 deletion Bloxstrap/Enums/BootstrapperIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public enum BootstrapperIcon
IconEarly2015,
IconLate2015,
Icon2017,
Icon2019
Icon2019,
Icon2022
}
}
26 changes: 15 additions & 11 deletions Bloxstrap/Helpers/DeployManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,21 @@ private static string BuildBaseUrl(string channel)
public static async Task<VersionDeploy> GetLastDeploy(string channel)
{
string baseUrl = BuildBaseUrl(channel);
string deployHistory = "";
string lastDeploy = "";

using (HttpClient client = new())
{
deployHistory = await client.GetStringAsync($"{baseUrl}/DeployHistory.txt");
}

using (StringReader reader = new(deployHistory))
{
string? line;
string deployHistory = await client.GetStringAsync($"{baseUrl}/DeployHistory.txt");

while ((line = await reader.ReadLineAsync()) is not null)
using (StringReader reader = new(deployHistory))
{
if (line.Contains("WindowsPlayer"))
lastDeploy = line;
string? line;

while ((line = await reader.ReadLineAsync()) is not null)
{
if (line.Contains("WindowsPlayer"))
lastDeploy = line;
}
}
}

Expand Down Expand Up @@ -148,7 +147,12 @@ public static async Task<VersionDeploy> GetLastDeploy(string channel)
// convert to traditional version format
fileVersion = fileVersion.Replace(" ", "").Replace(',', '.');

return new VersionDeploy { VersionGuid = versionGuid, Date = date, FileVersion = fileVersion };
return new VersionDeploy
{
VersionGuid = versionGuid,
Date = date,
FileVersion = fileVersion
};
}
}
}
2 changes: 2 additions & 0 deletions Bloxstrap/Helpers/IconManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public static Icon GetIconResource(BootstrapperIcon icon)
case BootstrapperIcon.IconLate2015: return Properties.Resources.IconLate2015_ico;
case BootstrapperIcon.Icon2017: return Properties.Resources.Icon2017_ico;
case BootstrapperIcon.Icon2019: return Properties.Resources.Icon2019_ico;
case BootstrapperIcon.Icon2022: return Properties.Resources.Icon2022_ico;
case BootstrapperIcon.IconBloxstrap: default: return Properties.Resources.IconBloxstrap_ico;
}
}
Expand All @@ -38,6 +39,7 @@ public static Bitmap GetBitmapResource(BootstrapperIcon icon)
case BootstrapperIcon.IconLate2015: return Properties.Resources.IconLate2015_png;
case BootstrapperIcon.Icon2017: return Properties.Resources.Icon2017_png;
case BootstrapperIcon.Icon2019: return Properties.Resources.Icon2019_png;
case BootstrapperIcon.Icon2022: return Properties.Resources.Icon2022_png;
case BootstrapperIcon.IconBloxstrap: default: return Properties.Resources.IconBloxstrap_png;
}
}
Expand Down
20 changes: 20 additions & 0 deletions Bloxstrap/Properties/Resources.Designer.cs

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

6 changes: 6 additions & 0 deletions Bloxstrap/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@
<data name="Icon2019_png" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Icon2019-png.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Icon2022_ico" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Icon2022-ico.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Icon2022_png" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Icon2022-png.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="IconBloxstrap_ico" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\IconBloxstrap-ico.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand Down
Binary file added Bloxstrap/Resources/Icon2022-ico.ico
Binary file not shown.
Binary file added Bloxstrap/Resources/Icon2022-png.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 246ae94

Please sign in to comment.