public FormNewProfile(DataModel dm) { InitializeComponent(); this.dm = dm; rename = false; p = new Profile(); }
public FormNewProfile(DataModel dm, Profile p) { this.p = p; InitializeComponent(); this.Name = "Rename Profile"; this.labelInstruct.Text = "Please enter a unique name for the profile"; this.textBoxName.Text = p.Name; this.dm = dm; rename = true; }
public void DeserializeDataModel() { FileInfo fi = new FileInfo(DATA_STORE_FILENAME); // Load demo dataStore.xml from Program folder if (!fi.Exists) { FileInfo demoFI = new FileInfo(DEMO_DS_FILE); if (demoFI.Exists) { System.IO.File.Copy(DEMO_DS_FILE, DATA_STORE_FILENAME); } fi.Refresh(); } if (fi.Exists) { TextReader reader = new StreamReader(DATA_STORE_FILENAME); try { dm = (DataModel)dm_serializer.Deserialize(reader); } catch (Exception) { string date = String.Format("{0:g}", DateTime.Now); fi.MoveTo(DATA_STORE_FILENAME + ".fail.xml"); MessageBox.Show("Unable to Load Data. Moving failed data file to: " + fi.FullName, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); dm = new DataModel(); } finally { reader.Close(); } } else { dm = new DataModel(); } }
public FormNewTherapy(DataModel dm) { InitializeComponent(); this.dm = dm; }
public FormDeleteProfile(DataModel dm) { InitializeComponent(); this.dm = dm; }
private void Main_Load(object sender, EventArgs e) { ds = new DataStorage(); dm = ds.DataModel; lvP = false; lvS = false; listProfilesRefresh(); listTherapiesRefresh(); listTherapies.SelectedIndex = -1; treeViewTasksRefresh(); //disable the Session buttons, they will be enabled when a profile is selected splitContainer2.Panel2.Enabled = false; playFullscreenToolStripMenuItem.Checked = dm.PlayFullscreen; // !!!! Skip GUI while debugging game /* selectedProfile = dm.Profiles[0]; selectedTherapy = dm.Therapies[0]; Thread thread = new Thread(new ThreadStart(RunXna)); thread.Name = "TheraWii Game"; thread.Start(); Application.Exit(); */ /* WiiUse testing */ int found = WiiUse.Connect(); Console.WriteLine("Found {0} wiimotes", found); Console.WriteLine("Wiimote " + WiiUse.IsConnected(WiiType.Remote)); Console.WriteLine("Nunchuck " + WiiUse.IsConnected(WiiType.Nunchuck)); Console.WriteLine("Balance Board " + WiiUse.IsConnected(WiiType.BalanceBoard)); //getCenterPosition(); }