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

            if (currentItem.HasFinish)
            {
                if (Save())
                {
                    //Project.Instance.IsDirty = true;
                    DialogResult = DialogResult.OK;
                    Close();
                }
                return;
            }
            if (currentItem.HasFinish || !currentItem.HasNext || !currentItem.Next())
            {
                return;
            }
            for (int i = 0; i < ContentItems.Count; i++)
            {
                if (ContentItems[i] == currentItem)
                {
                    LoadScreen(ContentItems[i + 1]);
                }
            }
        }
        internal void LoadNextScreen()
        {
            Interfaces.Controls.ContentItems.ContentItem currentItem = (Interfaces.Controls.ContentItems.ContentItem)panelContent.Controls[0];

            if (currentItem.HasFinish)
            {
                DialogResult = DialogResult.OK;
                Close();
                return;
            }
            if (!currentItem.HasNext || !currentItem.Next())
            {
                return;
            }
            if (currentItem.HasFinish)
            {
                DialogResult = DialogResult.OK;
                Close();
                return;
            }
            if (typeof(ScreenStart).IsInstanceOfType(currentItem))
            {
                ScreenStart.Actions action = ScreenStart.Action;

                switch (action)
                {
                case ScreenStart.Actions.Purchase:
                    break;

                case ScreenStart.Actions.Trial:
                    Result = ScreenStart.Actions.Trial;

                    if (ScreenStart.Action == ScreenStart.Actions.Trial && DaysRemaining > 0)
                    {
                        DialogResult = DialogResult.OK;
                        Close();
                        return;
                    }
                    break;

                default:
                    throw new NotImplementedException(action.ToString());
                }
            }
            else
            {
                throw new NotImplementedException(currentItem.GetType().Name);
            }
        }