public void Init()
 {
     try
     {
         GigSpace.SetSTAT("Liste d'amis...");
         itemPanel1.Items.Clear();
         foreach (string friend in GigSpace.Client.MyAccount.Friends)
         {
             if (friend.Length > 3)
             {
                 ButtonItem item = new ButtonItem();
                 item.Image       = GIG_CLIENT.Properties.Resources.my_friends;
                 item.Text        = friend;
                 item.Name        = friend;
                 item.ButtonStyle = eButtonStyle.ImageAndText;
                 item.Click      += new EventHandler(item_Click);
                 itemPanel1.Items.Add(item);
             }
         }
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
        private void item1_Click(object sender, EventArgs e)
        {
            try
            {
                ButtonItem btn = (ButtonItem)sender;
                if (GigSpace.Client.Username != btn.Name && btn.Name.Length > 3)
                {
                    if (GigSpace.Client.AddUser(btn.Name))
                    {
                        ButtonItem item = new ButtonItem();
                        item.Image       = GIG_CLIENT.Properties.Resources.my_friends;
                        item.Text        = btn.Name;
                        item.Name        = btn.Name;
                        item.ButtonStyle = eButtonStyle.ImageAndText;
                        item.Click      += new EventHandler(item_Click);
                        itemPanel1.Items.Add(item);
                        GigSpace.Client.MyAccount.Friends.Add(btn.Name);
                        ToastNotification.ToastMargin = new DevComponents.DotNetBar.Padding(20); // Increase margin for the toast
                        // Show toast 1 second after the form is shown
                        BarUtilities.InvokeDelayed(new MethodInvoker(delegate
                        {
                            ToastNotification.Show(this, btn.Name + " a étè ajoutè a votre liste d'amis avec succès.", null, 3000, eToastGlowColor.Orange, eToastPosition.BottomCenter);
                        }), 1000);

                        GigSpace.MainForm.Refresh();
                    }
                }
            }
            catch (Exception ex)
            {
                GigSpace.LogError(ex);
            }
        }
        private void buttonX1_Click(object sender, EventArgs e)
        {
            try
            {
                if (textBoxX1.Text.Length > 0)
                {
                    GigSpace.SetSTAT("Recherche des utilisateurs (" + textBoxX1.Text + ")...");
                    Dictionary <string, string> u = GigSpace.Client.FindUser(textBoxX1.Text);
                    itemPanel2.Items.Clear();
                    GigSpace.SetSTAT(u.Count.ToString() + " utilisateur(s) trouvé(s)");
                    foreach (KeyValuePair <string, string> user in u)
                    {
                        ButtonItem item = new ButtonItem();
                        item.Image       = GIG_CLIENT.Properties.Resources.user;
                        item.Text        = user.Key + "   Nom : " + user.Value;
                        item.Name        = user.Key;
                        item.ButtonStyle = eButtonStyle.ImageAndText;
                        item.Click      += new EventHandler(item1_Click);
                        itemPanel2.Items.Add(item);
                    }

                    this.Refresh();
                }
            }
            catch (Exception ex)
            {
                GigSpace.LogError(ex);
            }
        }
 private void unpaidTile_Click(object sender, EventArgs e)
 {
     try
     {
         CGIGPfrm frm = new CGIGPfrm();
         if (GigSpace.Client.MyAccount.GIGP > 3)
         {
             frm.integerInput1.MaxValue = GigSpace.Client.MyAccount.GIGP - 1;
             frm.ShowDialog();
             if (frm.Done && frm.textBoxX2.Text.Length > 0)
             {
                 GigSpace.SetSTAT("Convertion des points...");
                 if (GigSpace.Client.ConvertGIGP(frm.integerInput1.Value, frm.textBoxX2.Text))
                 {
                     GigSpace.Client.MyAccount = GigSpace.Client.GetUserInfo(GigSpace.Client.MyAccount.Username);
                     LoadCtrl();
                     MessageBoxEx.Show("Points transfèrè au jeu avec succès", "GIGP", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
                 else
                 {
                     MessageBoxEx.Show("Transfert échouè", "GIGP", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             }
         }
         else
         {
             MessageBoxEx.Show("Solde insuffisant", "GIGP", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         GigSpace.SetSTAT("Terminé");
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #5
0
 internal static void SetSTAT(string stat)
 {
     try
     {
         MainForm.UpdateLabel(MainForm.slb, stat);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #6
0
 private void buttonX2_Click(object sender, EventArgs e)
 {
     try
     {
         Init();
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #7
0
 private void metroShell1_SettingsButtonClick(object sender, EventArgs e)
 {
     try
     {
         ShowPanel(GigSpace.HomeControl);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
 private void helpTile_Click(object sender, EventArgs e)
 {
     try
     {
         Process.Start(GigSpace.ShopLink + "buy/buy_gigp.php");
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #9
0
 public static void ShowUserInfo(GigUser u)
 {
     try
     {
         ProfileControl.SetProfileInfo(u);
         MainForm.ShowModalPanel(ProfileControl);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #10
0
 private void salesTile_Click(object sender, EventArgs e)
 {
     try
     {
         GigSpace.GIGPControl.LoadCtrl();
         GigSpace.MainForm.ShowPanel(GigSpace.GIGPControl);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #11
0
 private void ytdTile_Click(object sender, EventArgs e)
 {
     try
     {
         GigSpace.CommandControl.Init();
         GigSpace.MainForm.ShowPanel(GigSpace.CommandControl);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #12
0
 void GigSpace_MessageArrived(int val)
 {
     try
     {
         UpdateTile(GigSpace.HomeControl.helpTile, val);
         notifyIcon1.ShowBalloonTip(2000, "Messages", "vous avez reçu des messages", ToolTipIcon.Info);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #13
0
 private void Form1_Load(object sender, EventArgs e)
 {
     try
     {
         integerInput1.Value = SettingsManager.GetInt("DELAY");
         checkBoxX2.Checked  = SettingsManager.GetBool("CONNECT");
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #14
0
 private void metroShell1_HelpButtonClick(object sender, EventArgs e)
 {
     try
     {
         Form1 frm = new Form1();
         frm.ShowDialog();
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #15
0
 private void showtrans_Click(object sender, EventArgs e)
 {
     try
     {
         GigSpace.TransactionControl.Init();
         ShowPanel(GigSpace.TransactionControl);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #16
0
 void GigSpace_NotificationArrived(int val)
 {
     try
     {
         UpdateTile(GigSpace.HomeControl.devCoTile, val);
         notifyIcon1.ShowBalloonTip(2000, "Notifications", "vous avez reçu des notifications", ToolTipIcon.Info);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #17
0
        public void Init()
        {
            try{
                itemPanel1.Items.Clear();
                itemPanel2.Items.Clear();
                itemPanel3.Items.Clear();
                itemPanel4.Items.Clear();
                foreach (GIGNewsEntry news in GigSpace.Client.GetNews())
                {
                    LabelItem it = new LabelItem();
                    it.Name = news.Name;
                    it.Text = news.Name + "  :  " + news.Content;
                    itemPanel3.Items.Add(it);
                }
                GigSpace.SetSTAT("Recherche des informations...");
                CommunityInfo ci = GigSpace.Client.GetCommunityInfo();
                GigSpace.SetSTAT("Informations trouvé...");
                GigSpace.Connected = ci.NumberPlayers;


                GigSpace.SetCON(ci.NumberPlayers);
                foreach (GigServer sv in ci.Servers)
                {
                    LabelItem it = new LabelItem();
                    it.Name = sv.Name;
                    it.Text = sv.Name + "  :   (" + sv.EP.ToString() + ")";
                    itemPanel4.Items.Add(it);
                }
                int i = 0;
                foreach (string s in ci.TopTenPlayers)
                {
                    i++;
                    LabelItem it = new LabelItem();
                    it.Name = s;
                    it.Text = i.ToString() + ". " + s;
                    itemPanel1.Items.Add(it);
                }
                i = 0;
                foreach (string s in ci.TopTenRich)
                {
                    i++;
                    LabelItem it = new LabelItem();
                    it.Name = s;
                    it.Text = i.ToString() + ". " + s;
                    itemPanel2.Items.Add(it);
                }
            }
            catch (Exception ex)
            {
                GigSpace.LogError(ex);
            }
        }
 private void item_Click(object sender, EventArgs e)
 {
     try
     {
         ButtonItem btn = (ButtonItem)sender;
         GigUser    g   = GigSpace.Client.GetUserInfo(btn.Text);
         GigSpace.ShowUserInfo(g);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #19
0
 private void reportTile_Click(object sender, EventArgs e)
 {
     try
     {
         GigSpace.ProfileControl.SelectTAB("");
         GigSpace.ProfileControl.SetProfileInfo(GigSpace.Client.MyAccount);
         GigSpace.MainForm.ShowPanel(GigSpace.ProfileControl);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #20
0
 public void SetLanguage(string lang)
 {
     try
     {
         Thread.CurrentThread.CurrentCulture = new CultureInfo(lang);
         // Sets the UI culture to French (France)
         Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #21
0
 private void buttonX1_Click(object sender, EventArgs e)
 {
     try
     {
         SettingsManager.SetString("DELAY", integerInput1.Value.ToString());
         SettingsManager.SetBool("CONNECT", checkBoxX2.Checked);
         SettingsManager.Save();
         this.Close();
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #22
0
 private void disconbtn_Click(object sender, EventArgs e)
 {
     try
     {
         if (File.Exists(Application.StartupPath + @"\Data\AT.dat"))
         {
             File.Delete(Application.StartupPath + @"\Data\AT.dat");
         }
         close = true;
         GigSpace.Client.Logout();
         Application.Exit();
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #23
0
 internal static void SetCON(int con)
 {
     try
     {
         if (con < 2)
         {
             MainForm.UpdateLabel(MainForm.conlb, con.ToString() + " connecté");
         }
         else
         {
             MainForm.UpdateLabel(MainForm.conlb, con.ToString() + " connecté(s)");
         }
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
 public static void Init()
 {
     try
     {
         Regex s = new Regex("=", RegexOptions.IgnoreCase | RegexOptions.Compiled);
         Prefs = new Dictionary <string, string>();
         string[] l = File.ReadAllLines(Application.StartupPath + @"\config.cnf");
         foreach (string ln in l)
         {
             string[] vals = s.Split(ln, 2);
             Prefs.Add(vals[0], vals[1]);
         }
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Beispiel #25
0
 public void AddCMD(GigCommand cmd)
 {
     try
     {
         if (messagesListView.InvokeRequired)
         {
             addMessageDelegate d = new addMessageDelegate(addMessageToList);
             messagesListView.Invoke(d, cmd);
         }
         else
         {
             addMessageToList(cmd);
         }
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
 public static long GetLong(string op)
 {
     try
     {
         if (Prefs.ContainsKey(op))
         {
             return(Int64.Parse(Prefs[op]));
         }
         else
         {
             return(0);
         }
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
     return(0);
 }
 public static int GetInt(string op)
 {
     try
     {
         if (Prefs.ContainsKey(op))
         {
             return(Int32.Parse(Prefs[op]));
         }
         else
         {
             return(1);
         }
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
     return(1);
 }
 public static bool GetBool(string op)
 {
     try
     {
         if (Prefs.ContainsKey(op))
         {
             return(Boolean.Parse(Prefs[op]));
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
     return(false);
 }
 public static string GetString(string op)
 {
     try
     {
         if (Prefs.ContainsKey(op))
         {
             return(Prefs[op]);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
     return(null);
 }
Beispiel #30
0
        private void addMessageToList(GigCommand cmd)
        {
            try
            {
                ListViewItem item = messagesListView.Items.Add(new ListViewItem(cmd.SID));
                item.Tag = cmd;
                item.SubItems.Add(cmd.Username);
                item.SubItems.Add(cmd.GTAUsername);
                item.SubItems.Add(cmd.Name);
                item.SubItems.Add(cmd.Email);
                item.SubItems.Add(cmd.Pack);
                item.SubItems.Add(cmd.TimeStamp.ToString());

                item.SubItems.Add(cmd.Price.ToString());
            }
            catch (Exception ex)
            {
                GigSpace.LogError(ex);
            }
        }