private void RestoreState() { try { IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null); XmlSerializer ser = new XmlSerializer(typeof(TestState)); TestState ti = null; using (IsolatedStorageFileStream isfs = new IsolatedStorageFileStream(storagefile, FileMode.Open, isoStore)) { ti = (TestState)ser.Deserialize(isfs); isfs.Close(); } comboTests.SelectedIndex = comboTests.FindStringExact(ti.TestName); comboMethods.SelectedIndex = comboMethods.FindStringExact(ti.MethodName); } catch (Exception e) { MessageBox.Show(e.Message); } }
private void InitTests() { ti = new TestInvoker(Assembly.GetExecutingAssembly()); string[] tests = ti.GetTests(); comboTests.Items.Clear(); if (tests != null) { foreach (string t in tests.OrderBy(x => x)) comboTests.Items.Add(t); } }