Beispiel #1
0
 public Program_Choice(Program_Manager _parent, int index, bool edit)
 {
     __parent = _parent;
     __index  = index;
     __edit   = edit;
     InitializeComponent();
 }
        public Run_Program_Handler(Program_Manager _parent, int index, bool EDIT_MODE = false, List <string> passed_List = null)
        {
            InitializeComponent();

            target_button.Visible  = false;
            richTextBox1.Visible   = false;
            cast_file_name.Visible = false;

            __EDIT_MODE    = EDIT_MODE;
            __parent       = _parent;
            __index        = index;
            __EDIT_PROGRAM = passed_List ?? new List <String>();


            frequency.Items.Add("By seconds");
            frequency.Items.Add("At time");

            frequency.SelectedIndex = 0;
        }
        public Run_File_Handler(Program_Manager _parent, int index, bool EDIT_MODE = false, List <string> passed_List = null)
        {
            __EDIT_MODE = EDIT_MODE;
            __parent    = _parent;
            __index     = index;
            InitializeComponent();
            __EDIT_PROGRAM = passed_List ?? new List <String>();

            action_dropdown.Items.Add("Copy files from source to destination");
            action_dropdown.Items.Add("Move files from source to destination");
            action_dropdown.Items.Add("Copy files to COPY destination & move files to MOVE destination");
            action_dropdown.Items.Add("Delete files from source destination");
            frequency.Items.Add("By seconds");
            frequency.Items.Add("At time");
            action_dropdown.SelectedIndex = 0;
            frequency.SelectedIndex       = 0;

            if (__EDIT_MODE)
            {
                string[] paramaters = __EDIT_PROGRAM[7].Split(new string[] { "~" }, StringSplitOptions.None);
                _SOURCE_DIRECTORY = __EDIT_PROGRAM[2];
                if (__EDIT_PROGRAM[1] == "MOVE")
                {
                    _COPY_DIRECTORY = paramaters[1];
                }
                else
                {
                    _COPY_DIRECTORY = paramaters[2];
                }
                _MOVE_DIRECTORY       = paramaters[1];
                _SET_FILE_ACTION      = __EDIT_PROGRAM[1];
                _FILE_PARAMETER       = paramaters[0];
                _PROGRAM_NAME         = __EDIT_PROGRAM[0];
                _DIAGNOSTIC_COLOR_HEX = __EDIT_PROGRAM[10];
                _FREQUENCY_CHOICE     = __EDIT_PROGRAM[4];
                _FREQUENCY            = __EDIT_PROGRAM[5];

                textBox1.Text  = _PROGRAM_NAME;
                frequency.Text = _FREQUENCY_CHOICE;
                if (_FREQUENCY.Contains("M"))
                {
                    seconds_text.Text       = "";
                    dateTimePicker1.Visible = true;
                    dateTimePicker1.Text    = _FREQUENCY;
                    _FREQUENCY_CHOICE       = "DAILY";
                    frequency.Text          = "At time";
                }
                else
                {
                    _FREQUENCY_CHOICE       = "EVERY";
                    frequency.Text          = "By seconds";
                    seconds_box.Text        = _FREQUENCY;
                    dateTimePicker1.Visible = false;
                }


                _FREQUENCY                 = __EDIT_PROGRAM[5];
                button1.BackColor          = System.Drawing.ColorTranslator.FromHtml(_DIAGNOSTIC_COLOR_HEX);
                source_directory_text.Text = _SOURCE_DIRECTORY;
                action_dropdown.Text       = _SET_FILE_ACTION;


                destination_1_Text.Text = _MOVE_DIRECTORY;
                if (_SET_FILE_ACTION == "COPY")
                {
                    destination_1_Text.Text = _COPY_DIRECTORY;
                    action_dropdown.Text    = "Copy files from source to destination";
                }
                if (_SET_FILE_ACTION == "MOVE")
                {
                    action_dropdown.Text = "Move files from source to destination";
                }
                if (_SET_FILE_ACTION == "MOVECOPY")
                {
                    action_dropdown.Text    = "Copy files to COPY destination & move files to MOVE destination";
                    destination_2_Text.Text = _COPY_DIRECTORY;
                }
                if (_SET_FILE_ACTION == "DELETE")
                {
                    action_dropdown.Text = "Delete files from source destination";
                }

                file_parameter.Text = _FILE_PARAMETER;
            }
        }