Exemple #1
0
        private void LayoutEditor_Shown(object sender, EventArgs e)
        {
            if (deck == null)
            {
                deck     = new eFlash.Data.Deck();
                deck.uid = ProfileManager.getCurrentUserID();

                if (!showDeckPropertiesDialog(true))
                {
                    changed         = false;
                    templateChanged = false;
                    this.Close();
                    return;
                }

                if (deck.cardList.Count == 0)
                {
                    promptAtTemplateChange = false;
                }
            }

            changed = false;

            if (deck.cardList.Count == 0)
            {
                promptAtTemplateChange = false;
            }

            if (deck.type == Constant.noQuizDeck)
            {
                deleteSideToolStripMenuItem1.Enabled = true;
                addNewSideToolStripMenuItem.Enabled  = true;
            }
            else if (deck.type == Constant.textDeck || deck.type == Constant.imageDeck || deck.type == Constant.soundDeck)
            {
                tsObjects.Visible         = false;
                templateSelector          = new TemplateSelector(this, deck.type);
                templateSelector.Location = tsObjects.Location;

                this.Controls.Add(templateSelector);

                deleteSideToolStripMenuItem1.Enabled = false;
                addNewSideToolStripMenuItem.Enabled  = false;
            }
            else
            {
                throw new Exception("Invalid deck type");
            }
        }
Exemple #2
0
        private void LayoutEditor_Shown(object sender, EventArgs e)
        {
            if (deck == null)
            {
                deck = new eFlash.Data.Deck();
                deck.uid = ProfileManager.getCurrentUserID();

                if (!showDeckPropertiesDialog(true))
                {
                    changed = false;
                    templateChanged = false;
                    this.Close();
                    return;
                }

                if (deck.cardList.Count == 0)
                {
                    promptAtTemplateChange = false;
                }
            }

            changed = false;

            if (deck.cardList.Count == 0)
            {
                promptAtTemplateChange = false;
            }

            if (deck.type == Constant.noQuizDeck)
            {
                deleteSideToolStripMenuItem1.Enabled = true;
                addNewSideToolStripMenuItem.Enabled = true;
            }
            else if (deck.type == Constant.textDeck || deck.type == Constant.imageDeck || deck.type == Constant.soundDeck)
            {
                tsObjects.Visible = false;
                templateSelector = new TemplateSelector(this, deck.type);
                templateSelector.Location = tsObjects.Location;

                this.Controls.Add(templateSelector);

                deleteSideToolStripMenuItem1.Enabled = false;
                addNewSideToolStripMenuItem.Enabled = false;
            }
            else
            {
                throw new Exception("Invalid deck type");
            }
        }