Esempio n. 1
0
        public void Save(CollectionVM cvm)
        {
            if (cvm == null)
            {
                return;
            }

            ConfFileSaver s = new ConfFileSaver();

            if (!cvm.IsDefaultLayout)
            {
                s.AddOption("layout", cvm.Layout);
            }
            s.AddOption("launcher", (cvm.Launcher == null) ? "" : cvm.Launcher.Name);
            s.AddOption("list.path", cvm.ListPath);
            s.AddOption("list.extensions", cvm.FileExtensions);
            s.AddOption("media.box", cvm.MediaPathBox);
            s.AddOption("media.cart", cvm.MediaPathCart);
            s.AddOption("media.logo", cvm.MediaPathLogo);
            s.AddOption("media.snap", cvm.MediaPathSnap);
            s.AddOption("media.title", cvm.MediaPathTitle);
            s.AddOption("media.video", cvm.MediaPathVideo);

            //todo: change serverPath
            string path = RetroFE.GetAbsolutePath() + "/Collections/" + cvm.Name + "/Settings.conf";

            s.Save(path);
        }
Esempio n. 2
0
        private void AddCollection(object param)
        {
            CollectionVM cvm = new CollectionVM();

            cvm.Name = param as String;
            NotifyPropertyChanged("CollectionList");

            ConfFileSaver settings = new ConfFileSaver();
            ConfFileSaver include  = new ConfFileSaver();
            ConfFileSaver exclude  = new ConfFileSaver();
            MenuParser    menu     = new MenuParser();

            //todo change path
            string path = RetroFE.GetAbsolutePath() + "/Collections/" + cvm.Name;

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            if (!File.Exists(path + "/Settings.conf"))
            {
                CollectionList.Add(cvm);
                settings.Save(path + "/Settings.conf");

                if (!File.Exists(path + "/Include.txt"))
                {
                    include.Save(path + "/Include.txt");
                }
                if (!File.Exists(path + "/Exclude.txt"))
                {
                    exclude.Save(path + "/Exclude.txt");
                }

                //menu.Save(path + "/Menu.xml");
            }
        }