private void DeleteMethod(AlignmentMethodListItem methodListItem)
        {
            if (Messages.ShowQuestion("Are you sure you want to delete this method?", "Hold On", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.No)
            {
                return;
            }

            AlignmentMethod method = AlignmentMethods[methodListItem.listIndex];

            bool isDeleted = AlignmentMethods.Remove(method);

            if (isDeleted)
            {
                containerFlowPanel.Controls.Remove(methodListItem);

                if (AlignmentMethods.Count == 0)
                {
                    if (!containerFlowPanel.Controls.Contains(emptyListLabel))
                    {
                        containerFlowPanel.Controls.Add(emptyListLabel);
                    }

                    emptyListLabel.Visible = true;
                }
            }

            for (int i = 0; i < AlignmentMethods.Count; i++)
            {
                AlignmentMethods[i].PipelineIndex = i;
                AlignmentMethodListItem alignmentMethodListItem = (AlignmentMethodListItem)containerFlowPanel.Controls[i];
                alignmentMethodListItem.listIndex = i;
            }
        }
        private void AddMethod(AlignmentMethod alignmentMethod)
        {
            AlignmentMethodListItem alignmentMethodListItem = AlignmentMethodListItem.Create(alignmentMethod);

            alignmentMethodListItem.OnControlButtonPressedEvent += OnConfigControlButtonPressed;
            containerFlowPanel.Controls.Add(alignmentMethodListItem);
            alignmentMethodListItem.Size = new Size(containerFlowPanel.Size.Width, alignmentMethodListItem.Size.Height);
            emptyListLabel.Visible       = false;

            AlignmentMethods.Add(alignmentMethod);
        }
        private void MoveMethod(AlignmentMethodListItem methodListItem, bool isUp)
        {
            int             curIndex  = methodListItem.listIndex;
            AlignmentMethod method    = AlignmentMethods[curIndex];
            int             moveIndex = 0;

            if (isUp)
            {
                moveIndex = curIndex == 0? 0 : curIndex - 1;
            }
            else
            {
                moveIndex = curIndex == AlignmentMethods.Count - 1? curIndex : curIndex + 1;
            }
            containerFlowPanel.Controls.SetChildIndex(methodListItem, moveIndex);
            AlignmentMethods.RemoveAt(curIndex);
            AlignmentMethods.Insert(moveIndex, method);
            method.PipelineIndex = moveIndex;
            AlignmentMethods[curIndex].PipelineIndex = curIndex;
            methodListItem.listIndex = moveIndex;
        }
        private bool ValidateNewMethodName(string name)
        {
            if (string.IsNullOrEmpty(name) || name[0] == ' ' || name[name.Length - 1] == ' ' || AlignmentMethods.Exists(x => x.MethodName == name))
            {
                IsNewMethodNameValid = false;
            }
            else
            {
                IsNewMethodNameValid = true;
            }

            return(IsNewMethodNameValid);
        }