Example #1
0
        private void MainGrid_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            saveTo(MainGrid);
            EventList.Clear();
            for (int i = 0; i <= MainGrid.RowCount;)
            {
                ObjTimes Temp = new ObjTimes();
                Temp.numberRow = i;

                try {
                    if (MainGrid.Rows[i].Cells[0].Value.ToString() == "")
                    {
                        Temp.time = null;
                    }
                    else
                    {
                        Temp.time = MainGrid.Rows[i].Cells[0].Value.ToString();
                    }


                    EventList.Add(Temp);
                }
                catch { }
                i++;
            }
        }
Example #2
0
        public Form1()
        {
            InitializeComponent();
            loadTo(MainGrid);
            EventList.Clear();
            for (int i = 0; i < MainGrid.RowCount;)
            {
                ObjTimes Temp = new ObjTimes();
                Temp.numberRow = i;
                if (MainGrid.Rows[i].Cells[0].Value == null)
                {
                    Temp.time = null;
                }
                else
                {
                    Temp.time = MainGrid.Rows[i].Cells[0].Value.ToString();
                }
                try { EventList.Add(Temp); }
                catch { }
                i++;
            }
            this.Width = 972;

            TreyIcon.Visible = false;
            this.TreyIcon.MouseDoubleClick += new MouseEventHandler(TreyIcon_MouseDoubleClick);
            this.Resize += new System.EventHandler(this.Form1_Resize);

            AutoRun.Checked = Properties.Settings.Default.AutoRun;
            Notifi.Checked  = Properties.Settings.Default.Notifi;
        }
Example #3
0
 private void LoadSC_Click(object sender, EventArgs e)
 {
     try
     {
         EventList.Clear();
         for (int i = 0; i < MainGrid.RowCount;)
         {
             ObjTimes Temp = new ObjTimes();
             Temp.numberRow = i;
             if (MainGrid.Rows[i].Cells[0].Value == null)
             {
                 Temp.time = null;
             }
             else
             {
                 Temp.time = MainGrid.Rows[i].Cells[0].Value.ToString();
             }
             try { EventList.Add(Temp); }
             catch { }
             i++;
         }
         OpenFileDialog OFD = new OpenFileDialog();
         OFD.ShowDialog();
         MainGrid.Rows.Clear();
         string file = OFD.FileName;
         using (BinaryReader bw = new BinaryReader(File.Open(file, FileMode.Open)))
         {
             int n = bw.ReadInt32();
             int m = bw.ReadInt32();
             for (int i = 0; i < m; ++i)
             {
                 MainGrid.Rows.Add();
                 for (int j = 0; j < n; ++j)
                 {
                     if (bw.ReadBoolean())
                     {
                         MainGrid.Rows[i].Cells[j].Value = bw.ReadString();
                     }
                     else
                     {
                         bw.ReadBoolean();
                     }
                 }
             }
         }
     }
     catch
     {
     }
 }