Ejemplo n.º 1
0
        private async void RefreshAllPeriods()
        {
            Asset[]        newassets = assets;
            List <Asset>[] l         = ClassAssistant.FillQueue(newassets);

            for (int i = 3; i < 13; i++)
            {
                if ((File.GetLastWriteTime(Program.path + "\\" + i + ".txt").Date != DateTime.Now.Date) || !File.Exists(Program.path + "\\" + i + ".txt"))
                {
                    await VolatilityTask(dataPath, l, i);

                    ClassAssistant.SaveData(Program.path + "\\" + i + ".txt", newassets);
                }
            }
            isCalculate = true;
        }
Ejemplo n.º 2
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         ClassAssistant.SaveData(Application.StartupPath + "\\assets.txt", assets);
         using (StreamWriter sw = new StreamWriter(Application.StartupPath + "\\options.txt", false, Encoding.GetEncoding(1251)))
         {
             sw.WriteLine("period=" + trackBar_period.Value);
             if (dataGridView2.Rows.Count != 0)
             {
                 foreach (DataGridViewRow r in dataGridView2.Rows)
                 {
                     sw.WriteLine(r.Cells[0].Value + ";" + r.Cells[1].Value);
                 }
             }
         }
     }
     catch (Exception) { }
 }