public void AddSlide() { SlideControl slide = CreateSlide(); Controls.SetChildIndex((Control)slide, 0); SetFocusControl(slide); }
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); }
internal void SetFocusControl(SlideControl slide) { if (_focusControl != null) { _focusControl.LostFocus(); } _focusControl = slide; slide.GotFocus(); Point point = ScrollToControl((Control)slide); SetDisplayRectLocation(point.X, point.Y); }
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); }
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; } }