Skip to content

Commit

Permalink
v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhoseindavat committed Jul 16, 2023
1 parent 7a080f0 commit 77f0105
Show file tree
Hide file tree
Showing 301 changed files with 9,534 additions and 794 deletions.
Binary file modified .vs/SteamPulse/v17/.suo
Binary file not shown.
33 changes: 17 additions & 16 deletions SteamPulse/About.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ namespace SteamPulse
{
public partial class About : Form
{
string URL;
private string URL;
private readonly string AppHash = Hasher("SteamPulse");
public static Boolean DarkMode;
public static bool DarkMode;

public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;
Expand All @@ -52,7 +52,7 @@ protected override CreateParams CreateParams
}
private void About_Load(object sender, EventArgs e)
{
LabelVersion.Text = String.Format("Current Version : {0}", Application.ProductVersion);
LabelVersion.Text = string.Format("Current Version : {0}", Application.ProductVersion);
LabelUpdateStatus.Text = "Connecting To Server...";

DarkMode = Convert.ToBoolean(Properties.Settings.Default["DarkMode"]);
Expand All @@ -69,7 +69,7 @@ public void UpdateChecker()
{
try
{
var AppVersion = new Version(Application.ProductVersion);
Version AppVersion = new Version(Application.ProductVersion);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
XmlDocument Data = new XmlDocument();
Data.Load("https://api.codemage.ir/Projects/SteamPulse/Data.xml");
Expand All @@ -78,22 +78,22 @@ public void UpdateChecker()
foreach (XmlNode Node in Nodes)
{
string AppID_XML = Node["AppID"].InnerText;
var ServerVersion = new Version(Node["CurrentVersion"].InnerText);
Version ServerVersion = new Version(Node["CurrentVersion"].InnerText);
string UpdateDate_XML = Node["UpdateDate"].InnerText;
string UpdateURL_XML = Node["UpdateURL"].InnerText;
string UpdateType = Node["UpdateType"].InnerText;
var result = AppVersion.CompareTo(ServerVersion);
int result = AppVersion.CompareTo(ServerVersion);
if (AppHash == AppID_XML)
{
if (Convert.ToBoolean(Properties.Settings.Default["CheckUpdate"]) == true)
{
if (Convert.ToBoolean(Properties.Settings.Default["InstallBeta"]) == true)
{
var BetaVersion = new Version(Node["BetaVersion"].InnerText);
var Betaresult = AppVersion.CompareTo(BetaVersion);
Version BetaVersion = new Version(Node["BetaVersion"].InnerText);
int Betaresult = AppVersion.CompareTo(BetaVersion);
string BetaDate_XML = Node["BetaDate"].InnerText;
string BetaURL_XML = Node["BetaURL"].InnerText;
Boolean Beta = Convert.ToBoolean(Node["Beta"].InnerText);
bool Beta = Convert.ToBoolean(Node["Beta"].InnerText);
if (Beta == true)
{
if (Betaresult < 0)
Expand Down Expand Up @@ -193,12 +193,13 @@ private void About_MouseDown(object sender, MouseEventArgs e)
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
}
static string Hasher(string input)

private static string Hasher(string input)
{
using (SHA1Managed sha1 = new SHA1Managed())
{
var hash = sha1.ComputeHash(Encoding.UTF8.GetBytes(input));
var sb = new StringBuilder(hash.Length * 2);
byte[] hash = sha1.ComputeHash(Encoding.UTF8.GetBytes(input));
StringBuilder sb = new StringBuilder(hash.Length * 2);

foreach (byte b in hash)
{
Expand All @@ -209,7 +210,7 @@ static string Hasher(string input)
}
private void Button_Exit_Click(object sender, EventArgs e)
{
this.Close();
Close();
}
private void Label_Download_Click(object sender, EventArgs e)
{
Expand All @@ -226,22 +227,22 @@ private void Label_copyright_Click(object sender, EventArgs e)
{
Process.Start("https://codemage.ir");
}
private void ChangeTheme(Boolean Darkmode)
private void ChangeTheme(bool Darkmode)
{
Color BackGround;
Color ForeGround;
if (Darkmode == true)
{
BackGround = GlobalVariables.Colors.Dark.NileBlue;
ForeGround = GlobalVariables.Colors.Dark.White;
this.BackColor = GlobalVariables.Colors.Dark.Cello;
BackColor = GlobalVariables.Colors.Dark.Cello;

}
else
{
BackGround = GlobalVariables.Colors.Light.White;
ForeGround = GlobalVariables.Colors.Light.NileBlue;
this.BackColor = GlobalVariables.Colors.Light.AthenGray;
BackColor = GlobalVariables.Colors.Light.AthenGray;
}
PanelHeader.BackgroundColor = BackGround;
LabelAppName.BackColor = BackGround;
Expand Down
16 changes: 8 additions & 8 deletions SteamPulse/AppidSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ namespace SteamPulse
{
public partial class AppidSearch : Form
{
string SearchText;
JToken RawData;
private string SearchText;
private JToken RawData;
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;

Expand All @@ -42,7 +42,7 @@ private void ButtonLoad_Click(object sender, EventArgs e)
{
string[] tokens = ComboBoxResult.Text.Split(new[] { " - " }, StringSplitOptions.None);
Main.SearchID = tokens[0];
this.Close();
Close();
}
}
private void BackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
Expand Down Expand Up @@ -75,7 +75,7 @@ private void BackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
}
else
{
this.AcceptButton = ButtonLoad;
AcceptButton = ButtonLoad;
ComboBoxResult.Invoke((MethodInvoker)(() => ComboBoxResult.SelectedIndex = 0));
}

Expand All @@ -88,7 +88,7 @@ private void BackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
}
private void Label_Exit_Click(object sender, EventArgs e)
{
this.Close();
Close();
}
private void PanelHeader_MouseDown(object sender, MouseEventArgs e)
{
Expand Down Expand Up @@ -127,15 +127,15 @@ private void ChangeTheme(bool Darkmode)
BackGround = GlobalVariables.Colors.Dark.NileBlue;
ForeGround = GlobalVariables.Colors.Dark.White;

this.BackColor = GlobalVariables.Colors.Dark.Cello;
BackColor = GlobalVariables.Colors.Dark.Cello;
ButtonLoad.Image = Properties.Resources.BTNLoadLight;
ButtonSearch.Image = Properties.Resources.SearchWhite;
}
else
{
BackGround = GlobalVariables.Colors.Light.White;
ForeGround = GlobalVariables.Colors.Light.NileBlue;
this.BackColor = GlobalVariables.Colors.Light.AthenGray;
BackColor = GlobalVariables.Colors.Light.AthenGray;
ButtonLoad.Image = Properties.Resources.BTNLoadDark;
ButtonSearch.Image = Properties.Resources.SearchBlack;
}
Expand All @@ -149,7 +149,7 @@ private void ChangeTheme(bool Darkmode)

private void TextBoxSearch_TextChanged(object sender, EventArgs e)
{
this.AcceptButton = ButtonSearch;
AcceptButton = ButtonSearch;
}
}
}
23 changes: 15 additions & 8 deletions SteamPulse/BugReports.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

#endregion

using SteamPulse.UserSettings;
using SteamPulse.Logger;
using SteamPulse.UserSettings;
using System;
using System.Collections.Specialized;
using System.Drawing;
Expand All @@ -32,7 +32,7 @@ public partial class BugReports : Form
[DllImportAttribute("user32.dll")]
public static extern bool ReleaseCapture();

string ExceptionError;
private string ExceptionError;
public BugReports()
{
InitializeComponent();
Expand Down Expand Up @@ -63,13 +63,14 @@ private void TextBoxBugDesc_TextChanged(object sender, EventArgs e)
DescriptionCouunter.ForeColor = Color.Red;
}
}
bool IsValidEmail(string eMail)

private bool IsValidEmail(string eMail)
{
bool Result;

try
{
var eMailValidator = new System.Net.Mail.MailAddress(eMail);
System.Net.Mail.MailAddress eMailValidator = new System.Net.Mail.MailAddress(eMail);

Result = (eMail.LastIndexOf(".") > eMail.LastIndexOf("@"));
}
Expand All @@ -89,15 +90,19 @@ private void LabelSend_Click(object sender, EventArgs e)
if (DropDownSocialType.Text != "Email")
{
if (LabelSend.Text != "Sended Successfuly")
{
BackgroundWorker.RunWorkerAsync();
}
else { }
}
else
{
if (IsValidEmail(TextBoxSocial.Text) == true)
{
if (LabelSend.Text != "Sended Successfuly")
{
BackgroundWorker.RunWorkerAsync();
}
else { }
}
else
Expand Down Expand Up @@ -152,7 +157,7 @@ private void LabelSend_MouseEnter(object sender, EventArgs e)
}
private void Label_Exit_Click(object sender, EventArgs e)
{
this.Close();
Close();
}
private void PanelHeader_MouseDown(object sender, MouseEventArgs e)
{
Expand All @@ -173,7 +178,7 @@ private void BugReports_Load(object sender, EventArgs e)
ChangeTheme(default);
}
}
private void ChangeTheme(Boolean Darkmode)
private void ChangeTheme(bool Darkmode)
{
Color BackGround;
Color ForeGround;
Expand All @@ -182,7 +187,7 @@ private void ChangeTheme(Boolean Darkmode)
DescriptionCouunter.BackColor = Color.White;
BackGround = GlobalVariables.Colors.Dark.NileBlue;
ForeGround = GlobalVariables.Colors.Dark.White;
this.BackColor = GlobalVariables.Colors.Dark.Cello;
BackColor = GlobalVariables.Colors.Dark.Cello;
GroupBoxBug.BackColor = BackGround;
GroupBoxBug.ForeColor = ForeGround;
TextBoxBugDesc.ForeColor = BackGround;
Expand All @@ -197,7 +202,7 @@ private void ChangeTheme(Boolean Darkmode)
{
BackGround = GlobalVariables.Colors.Light.White;
ForeGround = GlobalVariables.Colors.Light.NileBlue;
this.BackColor = GlobalVariables.Colors.Light.AthenGray;
BackColor = GlobalVariables.Colors.Light.AthenGray;
}
PanelHeader.BackgroundColor = BackGround;
Label_AppName.BackColor = BackGround;
Expand All @@ -210,7 +215,9 @@ private void ChangeTheme(Boolean Darkmode)
private void DropDownSocialType_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownSocialType.Text == "Email")
{
TextBoxSocial.PlaceholderText = "Enter Email";
}
}
}
}
32 changes: 16 additions & 16 deletions SteamPulse/Calculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ namespace SteamPulse
{
public partial class Calculator : Form
{
string CalculationMode = "";
int Number = 0;
public static Boolean DarkMode;
private string CalculationMode = "";
private int Number = 0;
public static bool DarkMode;
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;
[DllImportAttribute("user32.dll")]
Expand All @@ -49,7 +49,7 @@ private void Textbox_TextChanged(object sender, EventArgs e)
}
private void ButtonExit_Click(object sender, EventArgs e)
{
this.Close();
Close();
}
private void ButtonLoad_Click(object sender, EventArgs e)
{
Expand All @@ -65,7 +65,7 @@ private void ButtonLoad_Click(object sender, EventArgs e)
GetData.IRT.Ticket();
if (LoadData.IRT.Ticket.Price != 0)
{
LabelResult.Text = String.Format("Result: {0} Ticket - {1} IRT", Ticket_count_rounded.ToString(), String.Format("{0:n0} ", Ticket_count_rounded * LoadData.IRT.Ticket.Price));
LabelResult.Text = string.Format("Result: {0} Ticket - {1} IRT", Ticket_count_rounded.ToString(), string.Format("{0:n0} ", Ticket_count_rounded * LoadData.IRT.Ticket.Price));
}
else
{
Expand Down Expand Up @@ -94,39 +94,39 @@ private void ButtonLoad_Click(object sender, EventArgs e)
{
if (DownRemaining < LoadData.Market.Ticket.LowestSellOrderNoFee && LoadData.IRT.Ticket.Stock != 0)
{
LabelResult.Text = String.Format("Result: {0} Key + 1 Ticket - {1} IRT", KeyRoundedDown.ToString(), String.Format("{0:n0} ", (KeyRoundedDown * LoadData.IRT.Key.Price) + LoadData.IRT.Ticket.Price));
LabelResult.Text = string.Format("Result: {0} Key + 1 Ticket - {1} IRT", KeyRoundedDown.ToString(), string.Format("{0:n0} ", (KeyRoundedDown * LoadData.IRT.Key.Price) + LoadData.IRT.Ticket.Price));
}
else
{
LabelResult.Text = String.Format("Result: {0} Key - {1} IRT", count_roundedd.ToString(), String.Format("{0:n0} ", count_roundedd * LoadData.IRT.Key.Price));
LabelResult.Text = string.Format("Result: {0} Key - {1} IRT", count_roundedd.ToString(), string.Format("{0:n0} ", count_roundedd * LoadData.IRT.Key.Price));
}
}
else
{
LabelResult.Text = String.Format("Result: {0} Key - {1} IRT", count_roundedd.ToString(), String.Format("{0:n0} ", count_roundedd * LoadData.IRT.Key.Price));
LabelResult.Text = string.Format("Result: {0} Key - {1} IRT", count_roundedd.ToString(), string.Format("{0:n0} ", count_roundedd * LoadData.IRT.Key.Price));
}
}
else
{
if (DownRemaining < LoadData.Market.Ticket.LowestSellOrderNoFee && Settings.ItemCalculationMode == "Smart" && LoadData.IRT.Ticket.Stock != 0)
{
LabelResult.Text = String.Format("Result: {0} Key + 1 Ticket ", KeyRoundedDown.ToString());
LabelResult.Text = string.Format("Result: {0} Key + 1 Ticket ", KeyRoundedDown.ToString());
}
else
{
LabelResult.Text = String.Format("Result: {0} Key", count_roundedd.ToString());
LabelResult.Text = string.Format("Result: {0} Key", count_roundedd.ToString());
}
}
}
else
{
if (DownRemaining < LoadData.Market.Ticket.LowestSellOrderNoFee && Settings.ItemCalculationMode == "Smart" && LoadData.IRT.Ticket.Stock != 0)
{
LabelResult.Text = String.Format("Result: {0} Key + 1 Ticket ", KeyRoundedDown.ToString());
LabelResult.Text = string.Format("Result: {0} Key + 1 Ticket ", KeyRoundedDown.ToString());
}
else
{
LabelResult.Text = String.Format("Result: {0} Key", count_roundedd.ToString());
LabelResult.Text = string.Format("Result: {0} Key", count_roundedd.ToString());
}
}
}
Expand Down Expand Up @@ -212,7 +212,7 @@ private void SettingsToolStripMenuItem_Click(object sender, EventArgs e)
}
private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
Close();
}
private void BunifuDropdown1_SelectedIndexChanged(object sender, EventArgs e)
{
Expand All @@ -236,22 +236,22 @@ private void BunifuDropdown1_SelectedIndexChanged(object sender, EventArgs e)
}

}
private void ChangeTheme(Boolean Darkmode)
private void ChangeTheme(bool Darkmode)
{
Color BackGround;
Color ForeGround;
if (Darkmode == true)
{
BackGround = GlobalVariables.Colors.Dark.NileBlue;
ForeGround = GlobalVariables.Colors.Dark.White;
this.BackColor = GlobalVariables.Colors.Dark.Cello;
BackColor = GlobalVariables.Colors.Dark.Cello;
ButtonLoad.Image = Properties.Resources.BTNLoadLight;
}
else
{
BackGround = GlobalVariables.Colors.Light.White;
ForeGround = GlobalVariables.Colors.Light.NileBlue;
this.BackColor = GlobalVariables.Colors.Light.AthenGray;
BackColor = GlobalVariables.Colors.Light.AthenGray;
ButtonLoad.Image = Properties.Resources.BTNLoadDark;
}
ButtonLoad.BackColor = BackGround;
Expand Down
Loading

0 comments on commit 77f0105

Please sign in to comment.