/// <summary> /// Модификация от 30 сентября 2015 года /// Заложен 30 сентября 2015 года /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GamoLoadFromFile_Click(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); // Set filter for file extension and default file extension dlg.InitialDirectory = Properties.Settings.Default.GamoPGNStartDir; dlg.Filter = "Стандартный (*.pgn)|*.pgn|All files (*.*)|*.*"; dlg.FilterIndex = 1; dlg.RestoreDirectory = true; try { // Display OpenFileDialog by calling ShowDialog method Nullable <bool> result = dlg.ShowDialog(); if (result == true) { string filename = dlg.FileName; pgWoka wrk = new pgWoka(filename); wrk.GruzoWorko(); var winda = new GruzoGamo(); winda.Mano.DataContext = wrk; winda.Show(); } } catch (Exception ex) { MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message); } }
/// <summary> /// Модификация от 6 октября 2015 года /// Заложен 6 октября 2015 года /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GridBtn_Click(object sender, RoutedEventArgs e) { pgWoka paro = (pgWoka)Mano.DataContext; vLGamo gl1 = new vLGamo(paro.Listo); var winda = new GridoGamo(); winda.ManoDP.DataContext = gl1; winda.GamoGrido.ItemsSource = gl1.Listo; winda.Show(); }
public void FullListControlTesto() { string[] latr = { "[Site \"Kazan\"]" }; string[] intelpredo = { "EventDateHasAnswer$4$2015.06.03", "EventDateHasAnswer$5$2015.06.04"}; string fnamo = @"..\..\..\ForTestoBig.pgn"; pgWoka target = new pgWoka(fnamo); List<string> attrolist = latr.ToList(); List<string> ipredolist = intelpredo.ToList(); bool expected = true; bool actual; actual = target.FullListControl(attrolist, ipredolist); Assert.AreEqual(expected, actual); }
public void pgWokaFuncGamoMoveRegion() { string fnamo = @"..\..\..\ForTestoBig.pgn"; pgWoka BigObject = new pgWoka(fnamo); List<string> target = null; foreach (Gamo aa in BigObject.Listo) { aa.MovaControlling(); target = aa.CreateMovaRegionWithoutComments(); for (int i = 0; i < target.Count; i++) { string vanTarget = target[i]; string twoEtalon = aa.pgnMoveRegione[i]; Assert.AreEqual(twoEtalon, vanTarget); } } }
public void pgWokaConstructorTesto() { string fnamo = @"c:\tempo\nezh15_no9.pgn"; pgWoka target = new pgWoka(fnamo); Assert.IsTrue(target.Listo.Count > 340); }
/// <summary> /// Модификация от 30 сентября 2015 года /// Заложен 30 сентября 2015 года /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GamoLoadFromFile_Click(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); // Set filter for file extension and default file extension dlg.InitialDirectory = Properties.Settings.Default.GamoPGNStartDir; dlg.Filter = "Стандартный (*.pgn)|*.pgn|All files (*.*)|*.*"; dlg.FilterIndex = 1; dlg.RestoreDirectory = true; try { // Display OpenFileDialog by calling ShowDialog method Nullable<bool> result = dlg.ShowDialog(); if (result == true) { string filename = dlg.FileName; pgWoka wrk = new pgWoka(filename); wrk.GruzoWorko(); var winda = new GruzoGamo(); winda.Mano.DataContext = wrk; winda.Show(); } } catch (Exception ex) { MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message); } }