コード例 #1
0
        public void AddSlide()
        {
            SlideControl slide = CreateSlide();

            Controls.SetChildIndex((Control)slide, 0);
            SetFocusControl(slide);
        }
コード例 #2
0
        public void InsertSlide()
        {
            SlideControl slide = CreateSlide();
            int          num   = 0;

            if (_focusControl != null)
            {
                num = Controls.IndexOf((Control)_focusControl);
            }
            Controls.SetChildIndex((Control)slide, num + 1);
            SetFocusControl(slide);
        }
コード例 #3
0
        internal void SetFocusControl(SlideControl slide)
        {
            if (_focusControl != null)
            {
                _focusControl.LostFocus();
            }
            _focusControl = slide;
            slide.GotFocus();
            Point point = ScrollToControl((Control)slide);

            SetDisplayRectLocation(point.X, point.Y);
        }
コード例 #4
0
        private SlideControl CreateSlide()
        {
            IsDirty = true;
            SlideControl slideControl = new SlideControl();

            slideControl.ParentBox = this;
            slideControl.Dock      = DockStyle.Top;
            Controls.Add((Control)slideControl);
            slideControl.typeLookup.Focus();
            slideControl.Changed += new SlideControl.ChangedEventHandler(slide_Changed);
            return(slideControl);
        }
コード例 #5
0
 public void OpenFromFile(string fileName)
 {
     Visible = false;
     try
     {
         Controls.Clear();
         XmlReader reader = XmlReader.Create((Stream) new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read));
         reader.Read();
         if (!reader.IsStartElement("Root"))
         {
             throw new ApplicationException("An Invalid file format was selected.");
         }
         while (reader.Read())
         {
             if (reader.IsStartElement() && reader.HasAttributes)
             {
                 if (reader.Name == "Slide")
                 {
                     SlideControl slide = CreateSlide();
                     Controls.SetChildIndex((Control)slide, 0);
                     slide.ReadFromXML(reader);
                 }
                 else if (reader.Name == "Font")
                 {
                     string attribute = reader.GetAttribute("Name");
                     if (attribute == "SongFont")
                     {
                         SongFont.ReadFromXML(reader);
                     }
                     else if (attribute == "IndicatorFont")
                     {
                         IndicatorFont.ReadFromXML(reader);
                     }
                     else if (attribute == "MessageFont")
                     {
                         MessageFont.ReadFromXML(reader);
                     }
                 }
             }
         }
         reader.Close();
         IsDirty = false;
     }
     finally
     {
         Visible = true;
     }
 }