コード例 #1
0
        public async void mesajlariOku(Kullanici kullanici, int id, Panel p)
        {
            try
            {
                response = await client.GetTaskAsync("sayac");

                Sayac sayac = response.ResultAs <Sayac>();
                int   sonId = sayac.mesajSayisi;
                int   m     = id;
                AnaEkran.mesajId = sonId;
                while (m < sonId)
                {
                    try
                    {
                        response = await client.GetTaskAsync("mesajlar/" + m.ToString());

                        Mesajlar mesaj = response.ResultAs <Mesajlar>();
                        mesaj.icerik = sf.SifreCoz(mesaj.icerik);
                        if (mesaj.kimdenId == kullanici.id)
                        {
                            msj.gidenMesajKutusuOlustur(mesaj, p);
                        }
                        else
                        {
                            //onların group box'ı
                            msj.gelenMesajKutusuOlustur(mesaj, p);
                        }
                    }
                    catch { }
                    m++;
                }
            }
            catch { }
        }
コード例 #2
0
        public async void mesajGonder(Mesajlar mesaj)
        {
            try
            {
                response = await client.GetTaskAsync("sayac");

                Sayac sayac = response.ResultAs <Sayac>();
                int   _id   = sayac.mesajSayisi;
                mesaj.id     = _id;
                mesaj.icerik = sf.Sifrele(mesaj.icerik);
                sayac.mesajSayisi++;
                response = await client.SetTaskAsync("mesajlar/" + _id.ToString(), mesaj);

                response = await client.SetTaskAsync("sayac", sayac);
            }
            catch
            {
                MessageBox.Show("Mesaj gönderilemedi bro ! \n İnternet bağlantını bi kontrol edebilir misin sana zahmet !", "Mesaj Gönderilemedi !", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
コード例 #3
0
 private void btnGonder_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(tBoxMesaj.Text))
     {
         Mesajlar mesaj = new Mesajlar
         {
             icerik   = tBoxMesaj.Text,
             kimden   = _kullanici.isim,
             kimdenId = _kullanici.id,
             zaman    = DateTime.Now.ToShortTimeString()
         };
         fbIslemleri.mesajGonder(mesaj);
         MesajKutulari ms = new MesajKutulari();
         tBoxMesaj.Clear();
         timer1.Interval = 10;
     }
     else
     {
         MessageBox.Show("Boş yapma bro ! \n Bir şey yazmadan mesaj mı atılır !", "Mesaj Gitmedi Acaba Niye ?", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
コード例 #4
0
        public void gidenMesajKutusuOlustur(Mesajlar mesaj, Panel panel)
        {
            //İlk kısmı bo bırakmak için kullanıyorum
            Label lbl = new Label();

            lbl.Size = new Size(480, 100);
            panel.Controls.Add(lbl);
            //
            GroupBox gelenMesajKutusu = new GroupBox();

            gelenMesajKutusu.Text        = mesaj.kimden;
            gelenMesajKutusu.BackColor   = Color.Teal;
            gelenMesajKutusu.ForeColor   = Color.White;
            gelenMesajKutusu.Font        = new Font("Calibri", 12);
            gelenMesajKutusu.Size        = new Size(390, 100);
            gelenMesajKutusu.RightToLeft = RightToLeft.Yes;
            panel.Controls.Add(gelenMesajKutusu);
            //
            Label zaman = new Label();

            zaman.Text     = mesaj.zaman;
            zaman.Font     = new Font("Calibri", 8);
            zaman.Location = new Point(295, 15);
            zaman.AutoSize = true;
            gelenMesajKutusu.Controls.Add(zaman);
            //
            RichTextBox icerik = new RichTextBox();

            icerik.Text        = mesaj.icerik;
            icerik.BackColor   = Color.Teal;
            icerik.ForeColor   = Color.White;
            icerik.Location    = new Point(15, 30);
            icerik.Size        = new Size(360, 45);
            icerik.RightToLeft = RightToLeft.No;
            icerik.ReadOnly    = true;
            icerik.BorderStyle = BorderStyle.None;
            gelenMesajKutusu.Controls.Add(icerik);
        }
コード例 #5
0
        public void gelenMesajKutusuOlustur(Mesajlar mesaj, Panel panel)
        {
            GroupBox gelenMesajKutusu = new GroupBox();

            gelenMesajKutusu.Text      = mesaj.kimden;
            gelenMesajKutusu.BackColor = Color.FromArgb(0, 64, 64);
            gelenMesajKutusu.ForeColor = Color.White;
            gelenMesajKutusu.Font      = new Font("Calibri", 12);
            gelenMesajKutusu.Size      = new Size(390, 100);
            panel.Controls.Add(gelenMesajKutusu);
            //
            Label zaman = new Label();

            zaman.Text     = mesaj.zaman;
            zaman.Font     = new Font("Calibri", 8);
            zaman.Location = new Point(295, 15);
            zaman.AutoSize = true;
            gelenMesajKutusu.Controls.Add(zaman);
            //
            RichTextBox icerik = new RichTextBox();

            icerik.Text        = mesaj.icerik;
            icerik.BackColor   = Color.FromArgb(0, 64, 64);
            icerik.ForeColor   = Color.White;
            icerik.Location    = new Point(15, 30);
            icerik.Size        = new Size(360, 45);
            icerik.ReadOnly    = true;
            icerik.BorderStyle = BorderStyle.None;
            gelenMesajKutusu.Controls.Add(icerik);
            //
            //Bi alt satıra indirmek için
            Label lbl = new Label();

            lbl.Size = new Size(480, 100);
            panel.Controls.Add(lbl);
        }