public void Save(string file) { XmlStorage ps = new XmlStorage (); ps.New ("project"); ps.Add (details, "details"); details.Filename = file; // // Save elements in separate arrays classified by type // List <VideoProjectElement> videos = new List <VideoProjectElement> (); List <SlideShowProjectElement> slides = new List <SlideShowProjectElement> (); List <ButtonProjectElement> bts = new List <ButtonProjectElement> (); for (int i = 0; i < Elements.Count; i++) { if (typeof (Video) == Elements[i].GetType ()) { videos.Add ((VideoProjectElement)Elements [i]); continue; } if (typeof (SlideShow) == Elements[i].GetType ()) { slides.Add ((SlideShowProjectElement) Elements [i]); continue; } Logger.Debug ("Project.Save. Skipping {0}", Elements[i].GetType ()); } foreach (Button button in Buttons) bts.Add (button); ps.Add (videos, "videos"); ps.Add (slides, "slides"); ps.Add (bts, "buttons"); Logger.Debug ("Project.Save. Saving {0}", Details.Filename); ps.Save (Details.Filename); for (int i = 0; i < Elements.Count; i++) Logger.Debug ("Project.Save. {0}", Elements[i]); }
public static void Save() { XmlStorage ps = new XmlStorage (); ps.New ("ThemeConfiguration"); ps.Add (themes); ps.Save (Path.Combine (Defines.DATA_DIR, Defines.THEMES_FILE)); }
public void Write() { if (!Directory.Exists (config_path)) Directory.CreateDirectory (config_path); XmlStorage storage = new XmlStorage (); storage.New (RECENT_TAG); foreach (RecentFile item in items) storage.Add <RecentFile> (item); storage.Save (filename); }