private void WatcherRefresh_Tick(object sender, EventArgs e)
 {
     if (change)
     {
         ListNotification.BeginUpdate();
         ListNotification.Items.Add(stringBuilder.ToString());
         ListNotification.EndUpdate();
         change = false;
     }
 }
Exemple #2
0
 private void Notify(object instance, ListNotification action)
 {
     if (fOwnsObjects && action == ListNotification.Deleted)
     {
         var disposable = instance as IDisposable;
         if (disposable != null)
         {
             disposable.Dispose();
         }
     }
 }
Exemple #3
0
        private async Task XLoadNotification()
        {
            await Conopen();

            Sqlcmd.Parameters.Clear();
            Strsql                   = "Select * from tbl_notification ORDER BY not_num DESC";
            Sqlcmd.CommandText       = Strsql;
            Sqlcmd.Connection        = Cnn;
            Sqladapter.SelectCommand = Sqlcmd;
            Sqlreader                = Sqlcmd.ExecuteReader();
            flowLayoutPanel1.Controls.Clear();
            var dt = new DataTable();

            dt.Load(Sqlreader);
            for (var i = 0; i < dt.Rows.Count; i++)
            {
                act_time = dt.Rows[i]["not_date"].ToString();
                XLog1();
                var a = new ListNotification {
                    label1 = { Text = not_date }, lblnottitle = { Text = dt.Rows[i]["not_title"].ToString() }, lblnotdesc = { Text = dt.Rows[i]["not_desc"].ToString() }
                };
                switch (a.lblnottitle.Text)
                {
                case @"Voided Transaction":
                    a.bunifuImageButton2.Image = Properties.Resources.error;
                    break;

                case @"Report printed":
                    a.bunifuImageButton2.Image = Properties.Resources.print_50px;
                    break;
                }

                flowLayoutPanel1.Controls.Add(a);
            }
            Sqlcmd.Dispose();
            Sqlreader.Close();
            Cnn.Close();
            Strsql = "";
            Focus();
            lblnotcount.Text = flowLayoutPanel1.Controls.Count + @" total";
        }