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 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);
     }
 }
 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);
     }
 }
 public void Init()
 {
     try
     {
         itemPanel1.Items.Clear();
         int i = 0;
         GigSpace.SetSTAT("Recherche des messages...");
         foreach (GigMessage msg in GigSpace.Client.GetMessages())
         {
             i++;
             ButtonItem btn = new ButtonItem();
             btn.Image       = GIG_CLIENT.Properties.Resources.e_mail;
             btn.Text        = msg.Sender + " : " + msg.Message;
             btn.ButtonStyle = eButtonStyle.ImageAndText;
             btn.Name        = msg.Sender + i.ToString();
             btn.Tag         = msg;
             btn.Click      += new EventHandler(btn_Click);
             itemPanel1.Items.Add(btn);
         }
         GigSpace.SetSTAT("Terminé");
     }
     catch
     {
     }
 }
        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 buttonX1_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(textBoxX1.Text) || string.IsNullOrEmpty(textBoxX2.Text) || (textBoxX1.Text + textBoxX2.Text).Contains("&") || (textBoxX1.Text + textBoxX2.Text).Contains("=") || (textBoxX1.Text + textBoxX2.Text).Contains(".") || (textBoxX1.Text + textBoxX2.Text).Contains("?") && GigSpace.Client.MyAccount.Friends.Contains(textBoxX1.Text))
                {
                    MessageBoxEx.Show("Enterer un message et un nom d'utilisateur valides", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    GigSpace.SetSTAT("Envoi en cours...");
                    if (GigSpace.Client.SendMessage(GigSpace.Client.MyAccount.Username, textBoxX1.Text, textBoxX2.Text))
                    {
                        MessageBoxEx.Show("Envoyé!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBoxEx.Show("échoué : " + GigSpace.Client.ErrorMSG, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }

                    GigSpace.SetSTAT("Terminé");
                }
            }
            catch
            {
            }
            finally
            {
                this.Close();
            }
        }
Exemple #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);
     }
 }
Exemple #9
0
 internal static void SetSTAT(string stat)
 {
     try
     {
         MainForm.UpdateLabel(MainForm.slb, stat);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Exemple #10
0
 private void buttonX2_Click(object sender, EventArgs e)
 {
     try
     {
         Init();
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Exemple #11
0
 public static void ShowUserInfo(GigUser u)
 {
     try
     {
         ProfileControl.SetProfileInfo(u);
         MainForm.ShowModalPanel(ProfileControl);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Exemple #12
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);
     }
 }
Exemple #13
0
 private void ytdTile_Click(object sender, EventArgs e)
 {
     try
     {
         GigSpace.CommandControl.Init();
         GigSpace.MainForm.ShowPanel(GigSpace.CommandControl);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Exemple #14
0
 private void metroShell1_HelpButtonClick(object sender, EventArgs e)
 {
     try
     {
         Form1 frm = new Form1();
         frm.ShowDialog();
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Exemple #15
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);
     }
 }
 private void item_Click(object sender, EventArgs e)
 {
     try
     {
         ButtonItem btn = (ButtonItem)sender;
         GigUser    g   = GigSpace.Client.GetUserInfo(btn.Text);
         GigSpace.ShowUserInfo(g);
     }
     catch
     {
     }
 }
Exemple #17
0
 private void salesTile_Click(object sender, EventArgs e)
 {
     try
     {
         GigSpace.GIGPControl.LoadCtrl();
         GigSpace.MainForm.ShowPanel(GigSpace.GIGPControl);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Exemple #18
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);
     }
 }
Exemple #19
0
 private void showtrans_Click(object sender, EventArgs e)
 {
     try
     {
         GigSpace.TransactionControl.Init();
         ShowPanel(GigSpace.TransactionControl);
     }
     catch (Exception ex)
     {
         GigSpace.LogError(ex);
     }
 }
Exemple #20
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);
     }
 }
        static void Main()
        {
            try
            {
                frm = new SplashScreen();

                GigSpace.Initialize();
                Application.Run(new Home());
            }
            catch
            {
            }
        }
Exemple #23
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);
     }
 }
Exemple #24
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);
     }
 }
Exemple #25
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);
     }
 }
Exemple #26
0
        private void Home_Shown(object sender, EventArgs e)
        {
            try
            {
                GigSpace.CommunityControl.Init();
                GigSpace.SetSTAT("Prêt");
                ShowPanel(GigSpace.HomeControl);

                GPlayer.Welcome();
            }
            catch
            {
            }
        }
Exemple #27
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);
     }
 }
        public void Init()
        {
            try
            {
                messagesListView.Items.Clear();

                GigSpace.SetSTAT("Recherche des transactions...");
                foreach (GigTransaction t in GigSpace.Client.GetTransactions())
                {
                    AddTRANS(t);
                }
                GigSpace.SetSTAT("Terminé");
            }
            catch
            {
            }
        }
 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);
     }
 }
Exemple #30
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);
     }
 }