Esempio n. 1
0
        public void SaveCheats(NSWindow window)
        {
            var dlg = NSSavePanel.SavePanel;

            if (dlg.RunModal() == 1)
            {
                var serializer = new CheatSerializer();
                var cheats     = GetCheats().ToList();
                serializer.Save(dlg.Url.Path, cheats);
            }
        }
Esempio n. 2
0
        public void LoadCheats(NSWindow window)
        {
            var dlg = NSOpenPanel.OpenPanel;

            dlg.CanChooseFiles       = true;
            dlg.CanChooseDirectories = false;

            if (dlg.RunModal() == 1)
            {
                var serializer = new CheatSerializer();
                var items      = new NSMutableArray();
                items.AddObjects(serializer.Load(dlg.Url.Path).ToArray());
                SetCheat(items);
            }
        }