Example #1
1
 public static void ShowSteamProfile(SteamBot.Bot bot, ulong steamId)
 {
     var form = new MetroForm();
     form.Text = "Steam Community";
     form.Width = 800;
     form.Height = 600;
     form.Style = Friends.GlobalStyleManager.Style;
     form.Theme = Friends.GlobalStyleManager.Theme;
     form.Icon = MistClient.Properties.Resources.Icon;
     form.ShadowType = MetroFormShadowType.DropShadow;
     var webControl = new Awesomium.Windows.Forms.WebControl();
     webControl.Dock = System.Windows.Forms.DockStyle.Fill;
     string cookies = string.Format("steamLogin={0}; sessionid={1}", bot.token, bot.sessionId);
     webControl.WebSession = Awesomium.Core.WebCore.CreateWebSession(new Awesomium.Core.WebPreferences());
     webControl.WebSession.SetCookie(new Uri("http://steamcommunity.com"), cookies, true, true);
     webControl.Source = new Uri((string.Format("http://steamcommunity.com/profiles/{0}/", steamId)));
     webControl.DocumentReady += webControl_DocumentReady;
     webControl.TitleChanged += (s, e) => webControl_TitleChanged(s, e, form);
     form.Controls.Add(webControl);
     form.Show();
 }
Example #2
0
 private void tradeOffersToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var tradeOffersForm = new MetroForm();
     tradeOffersForm.Icon = MistClient.Properties.Resources.Icon;
     tradeOffersForm.Width = 1012;
     tradeOffersForm.Height = 500;
     tradeOffersForm.Text = "Trade Offers";
     tradeOffersForm.Style = this.Style;
     tradeOffersForm.Theme = this.Theme;
     tradeOffersForm.ShadowType = MetroFormShadowType.DropShadow;
     var tradeOffersWeb = new Awesomium.Windows.Forms.WebControl();
     tradeOffersWeb.Dock = DockStyle.Fill;
     string cookies = string.Format("steamLogin={0}; sessionid={1}", bot.token, bot.sessionId);
     tradeOffersWeb.WebSession = WebCore.CreateWebSession(new WebPreferences());
     tradeOffersWeb.WebSession.SetCookie("http://steamcommunity.com".ToUri(), cookies, true, true);
     tradeOffersWeb.Source = ("http://steamcommunity.com/profiles/" + bot.SteamUser.SteamID.ConvertToUInt64() + "/tradeoffers/").ToUri();
     tradeOffersWeb.DocumentReady += tradeOffersWeb_DocumentReady;
     tradeOffersForm.Controls.Add(tradeOffersWeb);
     tradeOffersForm.Show();
     tradeOffersForm.Focus();
 }
Example #3
0
 private void sendTradeOfferToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var sid = new SteamID(contextMenuSteamId);
     var url = "http://steamcommunity.com/tradeoffer/new/?partner=" + sid.AccountID;
     var tradeOffersForm = new MetroForm();
     tradeOffersForm.Icon = MistClient.Properties.Resources.Icon;
     tradeOffersForm.Width = 720;
     tradeOffersForm.Height = 730;
     tradeOffersForm.Text = "Trade Offer with " + bot.SteamFriends.GetFriendPersonaName(sid);
     tradeOffersForm.Style = this.Style;
     tradeOffersForm.Theme = this.Theme;
     tradeOffersForm.ShadowType = MetroFormShadowType.DropShadow;
     var tradeOffersWeb = new Awesomium.Windows.Forms.WebControl();
     tradeOffersWeb.Dock = DockStyle.Fill;
     string cookies = string.Format("steamLogin={0}; sessionid={1}", bot.token, bot.sessionId);
     tradeOffersWeb.WebSession = WebCore.CreateWebSession(new WebPreferences());
     tradeOffersWeb.WebSession.SetCookie("http://steamcommunity.com".ToUri(), cookies, true, true);
     tradeOffersWeb.Source = url.ToUri();
     tradeOffersWeb.DocumentReady += tradeOffersWeb_DocumentReady;
     tradeOffersForm.Controls.Add(tradeOffersWeb);
     tradeOffersForm.Show();
     tradeOffersForm.Focus();
 }
Example #4
0
 private void steamCommunityMarketToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var form = new MetroForm();
     form.Text = "Steam Community Market";
     form.Width = 1025;
     form.Height = 600;
     form.Style = Friends.GlobalStyleManager.Style;
     form.Theme = Friends.GlobalStyleManager.Theme;
     form.Icon = MistClient.Properties.Resources.Icon;
     form.ShadowType = MetroFormShadowType.DropShadow;
     var webControl = new Awesomium.Windows.Forms.WebControl();
     form.Controls.Add(webControl);
     webControl.Dock = System.Windows.Forms.DockStyle.Fill;
     string cookies = string.Format("steamLogin={0}; sessionid={1}", bot.token, bot.sessionId);
     webControl.WebSession = Awesomium.Core.WebCore.CreateWebSession(new Awesomium.Core.WebPreferences());
     webControl.WebSession.SetCookie(new Uri("http://steamcommunity.com"), cookies, true, true);
     webControl.Source = new Uri("http://steamcommunity.com/market");
     webControl.DocumentReady += steamCommunityMarket_DocumentReady;
     webControl.TitleChanged += (s, ev) => webControl_TitleChanged(s, ev, form);
     form.Show();
 }