コード例 #1
0
 public FormTransitionKeyboard(SceneTransition t)
 {
     InitializeComponent();
     transition          = (SceneTransitionKeyboard)t;
     checkBox1.Checked   = transition.showOverlay;
     textBoxCaption.Text = transition.caption;
     textBoxKey.Text     = transition.GetKeyName();
 }
コード例 #2
0
        public SceneTransition CreateTransition(ScenePart src, ScenePart dest, TransitionID type)
        {
            SceneTransition t = SceneTransition.Create(type);

            t.nextScene = dest;
            src.transitions.Add(t);
            dest.AddRef(src);
            group.Invalidate();
            return(t);
        }
コード例 #3
0
        private void editarToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            if (listTransitions.SelectedIndex < 0)
            {
                return;
            }

            SceneTransition t = scene.transitions[listTransitions.SelectedIndex];

            t.Configure();
        }
コード例 #4
0
        private void removerToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            if (listTransitions.SelectedIndex < 0)
            {
                return;
            }

            SceneTransition t = scene.transitions[listTransitions.SelectedIndex];

            t.nextScene.DecRef(scene);
            scene.transitions.Remove(t);
        }
コード例 #5
0
        private void thumbnail_MouseClick(object sender, MouseEventArgs e)
        {
            Control thumbnail = (Control)sender;

            if (selectNextScene)
            {
                SceneTransition t = CreateTransition(selected, scenes[(int)thumbnail.Tag], transitionType);
                t.Configure();
                selectNextScene = false;
            }
            else
            {
                /// Sets the starting scene for the "start from the selected scene" option
                selected = scenes[(int)thumbnail.Tag];
                group.Invalidate();
            }
        }
コード例 #6
0
        public void Load(string filename)
        {
            try
            {
                fname = filename;
                int       firstScene    = -1;
                bool      hasFirstScene = false;
                XmlReader xml           = XmlReader.Create(fname);

                while (xml.Read())
                {
                    if (xml.NodeType == XmlNodeType.Element)
                    {
                        if (xml.Name == "project" && xml.HasAttributes)
                        {
                            title  = xml.GetAttribute("title");
                            author = xml.GetAttribute("author");
                        }
                        else if (xml.Name == "storyboard" && xml.HasAttributes)
                        {
                            ScenePart.id_inc = int.Parse(xml.GetAttribute("lastId"));
                            hasFirstScene    = int.TryParse(xml.GetAttribute("firstScene"), out firstScene);
                        }
                        else if (xml.Name == "scene" && xml.HasAttributes)
                        {
                            ScenePart p = storyboard.CreateScene(
                                xml.GetAttribute("videoSrc"),
                                xml.GetAttribute("title"),
                                int.Parse(xml.GetAttribute("id"))
                                );
                            p.thumbnail.ImageLocation = xml.GetAttribute("thumbSrc");
                            p.timeout = int.Parse(xml.GetAttribute("timeout"));
                            int x = int.Parse(xml.GetAttribute("posX"));
                            int y = int.Parse(xml.GetAttribute("posY"));
                            p.thumbnail.Location = new System.Drawing.Point(x, y);
                        }
                        else if (xml.Name == "transition" && xml.HasAttributes)
                        {
                            ScenePart       src  = storyboard.GetScene(int.Parse(xml.GetAttribute("srcScene")));
                            ScenePart       dest = storyboard.GetScene(int.Parse(xml.GetAttribute("nextScene")));
                            TransitionID    type = (TransitionID)Enum.Parse(typeof(TransitionID), xml.GetAttribute("type"));
                            SceneTransition t    = storyboard.CreateTransition(src, dest, type);
                            if (type == TransitionID.Keyboard)
                            {
                                SceneTransitionKeyboard tk = (SceneTransitionKeyboard)t;
                                tk.keycode = int.Parse(xml.GetAttribute("keycode"));
                                if (!bool.TryParse(xml.GetAttribute("showOverlay"), out tk.showOverlay))
                                {
                                    tk.showOverlay = false;
                                }
                                if (xml.GetAttribute("caption") != null)
                                {
                                    tk.caption = xml.GetAttribute("caption");
                                }
                            }
                        }
                    }
                }
                xml.Close();

                if (hasFirstScene)
                {
                    storyboard.SetAsFirstScene(firstScene);
                }
            }
            catch (Exception e)
            {
#if DEBUG
                MessageBox.Show(e.StackTrace);
#else
                MessageBox.Show("Arquivo de projeto inválido.");
#endif
                if (storyboard != null)
                {
                    storyboard.Clear();
                }
            }
        }