/// <summary> /// Handles the MediaOpened event of the Media control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private void Media_MediaOpened(object sender, RoutedEventArgs e) { MediaZoom = 1d; var source = Media.Source.ToString(); if (Config.HistoryEntries.Contains(source)) { var oldIndex = Config.HistoryEntries.IndexOf(source); Config.HistoryEntries.RemoveAt(oldIndex); } Config.HistoryEntries.Add(Media.Source.ToString()); Config.Save(); RefreshHistoryItems(); }
/// <summary> /// Handles the MediaOpened event of the Media control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private void Media_MediaOpened(object sender, RoutedEventArgs e) { // Set a start position (see issue #66) // Media.Position = TimeSpan.FromSeconds(5); // Media.Play(); MediaZoom = 1d; var source = Media.Source.ToString(); if (Config.HistoryEntries.Contains(source)) { var oldIndex = Config.HistoryEntries.IndexOf(source); Config.HistoryEntries.RemoveAt(oldIndex); } Config.HistoryEntries.Add(Media.Source.ToString()); Config.Save(); RefreshHistoryItems(); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ int IDL.addTest(Test testToAdd) { //to do: make a running code for tests int testCode = int.Parse(ConfigRoot.Element("BeginningSerialTestNumber").Element("Value").Value); int testNumber = (from test in TestRoot.Elements() where (int.Parse(test.Element("TestNumber").Value) == testToAdd.TestNumber) select(int.Parse(test.Element("TestNumber").Value))).FirstOrDefault(); if (testNumber != 0) { throw new TestNumberAlreadyExistsException(testNumber); } testToAdd.TestNumber = testCode; TestRoot.Add(testToAdd.ToXmlTest()); TestRoot.Save(TestPath); ConfigRoot.Element("BeginningSerialTestNumber").Element("Value").Value = (testCode + 1).ToString(); ConfigRoot.Save(ConfigPath); return(testCode); }
/// <summary> /// adds to the next code number of the messages /// </summary> public void AddToMessageCode() { ConfigRoot.Element("MessageCode").Value = (GetMessageCode() + 1).ToString(); ConfigRoot.Save(ConfigPath); }
/// <summary> /// adds 1 to the code of the Config test code /// </summary> public void AddToTestCode() { ConfigRoot.Element("TestCode").Value = (GetTestCode() + 1).ToString(); ConfigRoot.Save(ConfigPath); }