Exemplo n.º 1
0
        private void AddItem(JobControl control, int position, bool refreshButtons = true)
        {
            if (position < 0)
            {
                position = 0;
            }
            else if (position > jobControls.Count)
            {
                position = jobControls.Count;
            }

            jobControls.Insert(position, control);

            if (refreshButtons)
            {
                RefreshMoveButtonsEnabled();
            }

            control.MoveUpRequested   += Control_MoveUpRequested;
            control.MoveDownRequested += Control_MoveDownRequested;

            control.Margin = new Padding(0, 0, 0, 0);
            control.Dock   = DockStyle.Fill;

            AddItemToMainTlp(position, control);
        }
Exemplo n.º 2
0
        private void OnJobQueued(JobQueuedEventArgs e)
        {
            var control = new JobControl()
            {
                Job = e.Job, ActionsButtonsVisible = ShowActionsButtons
            };

            control.Fill(categoryContainer, languageContainer, playlistContainer, pscContainer);

            AddItem(control, e.Position);
        }
Exemplo n.º 3
0
        private void AddItemToMainTlp(int position, JobControl control)
        {
            if (position < 0)
            {
                position = 0;
            }
            else if (position > mainTlp.RowStyles.Count)
            {
                position = mainTlp.RowStyles.Count;
            }

            mainTlp.RowStyles.Insert(position, new RowStyle(SizeType.AutoSize));
            mainTlp.Controls.Add(control, 0, position);
        }
Exemplo n.º 4
0
 private void Control_MoveDownRequested(JobControl sender)
 {
     uploader.ChangePosition(sender.Job, jobControls.IndexOf(sender) + 1);
 }
Exemplo n.º 5
0
 private void AddItem(JobControl control, bool refreshButtons = true)
 {
     AddItem(control, int.MaxValue, refreshButtons);
 }
Exemplo n.º 6
0
 private void RemoveItemFromMainTlp(JobControl control, int position)
 {
     mainTlp.Controls.Remove(control);
     mainTlp.RowStyles.RemoveAt(position);
 }