Beispiel #1
0
        public TaskWizard(ETask t)
        {
            InitializeComponent();
            task = t;
            checkBox1.Checked     = t.MessageAlert;
            checkBox2.Checked     = t.SoundAlert;
            checkBox3.Checked     = t.RunProcess;
            checkBox4.Checked     = t.ExecuteBatch;
            dateTimePicker1.Value = t.ExecuteTime;
            checkBox5.Checked     = t.ExecuteEveryDay != -1;
            if (checkBox5.Checked)
            {
                execEvery.SelectedIndex = t.ExecuteEveryDay - 1;
            }
            tNameBox.Text = t.TaskName;
            tDescBox.Text = t.TaskDescription;

            msgTextBox.Text     = t.MessageText;
            msgTitleBox.Text    = t.MessageTitle;
            soundFileBox.Text   = t.SoundFile;
            batchFileBox.Text   = t.BatchFile;
            processFileBox.Text = t.ProcessFile;
            procParamsBox.Text  = t.ProcessParameters;
            Application.DoEvents();
        }
Beispiel #2
0
        public static ETask Read(byte[] data)
        {
            MemoryStream memsr  = new MemoryStream(data);
            BinaryReader reader = new BinaryReader(memsr);
            ETask        task   = new ETask(id: reader.ReadInt32(), tName: reader.ReadString(), tDesc: reader.ReadString(), date: reader.ReadInt64(), errDay: reader.ReadInt32())
            {
                MessageAlert      = reader.ReadBoolean(),
                SoundAlert        = reader.ReadBoolean(),
                RunProcess        = reader.ReadBoolean(),
                ExecuteBatch      = reader.ReadBoolean(),
                MessageTitle      = reader.ReadString(),
                MessageText       = reader.ReadString(),
                SoundFile         = reader.ReadString(),
                ProcessFile       = reader.ReadString(),
                ProcessParameters = reader.ReadString(),
                BatchFile         = reader.ReadString()
            };

            return(task);
        }
Beispiel #3
0
 public void CollectTasks()
 {
     if (!Directory.Exists("tasks\\"))
     {
         //MessageBox.Show("Couldn't find \"tasks\" folder. Please create it or reinstall the application.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Directory.CreateDirectory("tasks");
         return;
     }
     candies.Clear();
     listView1.Items.Clear();
     foreach (string file in Directory.GetFiles("tasks\\"))
     {
         if (file.Contains(".task"))
         {
             ETask et = ETask.Read(File.ReadAllBytes(file));
             candies.Add(et.TaskID, et);
             ListViewItem item = new ListViewItem(et.TaskName);
             item.SubItems.Add(et.TaskDescription);
             listView1.Items.Add(item);
         }
     }
 }
Beispiel #4
0
 public TaskWizard()
 {
     InitializeComponent();
     task = new ETask(tNameBox.Text, tNameBox.Text, dateTimePicker1.Value.ToBinary(), -1, new Random().Next());
 }