예제 #1
0
        private void buttonNext_Click(object sender, EventArgs e)
        {
            ArchAngel.Interfaces.Controls.ContentItems.ContentItem contentItem = (ArchAngel.Interfaces.Controls.ContentItems.ContentItem)panelContent.Controls[0];

            if (contentItem.HasFinish)
            {
                FinishClicked = true;
                this.Close();
                return;
            }

            if (!contentItem.Next())
            {
                return;
            }
            int indexOfCurrentItem = -1;

            for (int i = 0; i < _orderedContentItems.Count; i++)
            {
                if (_orderedContentItems[i] == contentItem)
                {
                    // If we're at the last item, do nothing
                    if (i < _orderedContentItems.Count - 1)
                    {
                        string name;

                        foreach (ScreenNames key in _contentItems.Keys)
                        {
                            if (_contentItems[key] == _orderedContentItems[i + 1])
                            {
                                if (contentItem.ValidateControls())
                                {
                                    panelContent.Controls.Clear();
                                    LoadWizardPage(key);
                                }
                                break;
                            }
                        }
                    }
                    break;
                }
            }

            //ContentItems.ContentItem contentItem = (ContentItems.ContentItem)panelContent.Controls[0];

            //if (contentItem.HasFinish)
            //{
            //    FinishClicked = true;
            //    this.Close();
            //    return;
            //}
            //ScreenNames newContentItemName = (ScreenNames)Enum.Parse(typeof(ScreenNames), contentItem.Next());

            //if (newContentItemName != ScreenNames.Nothing)
            //{
            //    //if (contentItem.ValidateControls())
            //    //{
            //        //panelContent.Controls.Clear();
            //        LoadWizardPage(newContentItemName);
            //    //}
            //}
        }