Exemplo n.º 1
0
        private void Run180Criteria(object sender, EventArgs e)
        {
            var orientation = new Dictionary<string, bool>();
            try {
                foreach (var file in files) {
                    var state = new MainFormState(file);
            //                    state.Rotate(180);
                    orientation[file] = state.Criteria180();
            //                    orientation[file] = new Orient.AlgorithmExecutor(file).CountPatterns();
                }
            }
            catch (Exception ex) {
            //                MessageBox.Show(ex.Message);
            }

            dataGridView1.Visible = true;
            dataGridView1.DataSource = new BindingSource(orientation, null);
            foreach (var b in orientation) {

            }
            Text = orientation.Values.Count(value => value).ToString() + '/' + orientation.Count + '/' + files.Count();
        }
Exemplo n.º 2
0
 private static void Run180Criteria(string[] files)
 {
     int ok = 0;
     int wrong = 0;
     try {
         foreach (var file in files)
         {
             Console.Write(file.PadRight(60, ' ') + "  ");
             var state = new MainFormState(file);
             if (state.Criteria180()) ok++;
             else wrong++;
             state = new MainFormState(file);
             state.Rotate(180);
             if (state.Criteria180()) wrong++;
             else ok++;
             Console.WriteLine("OK {0}; WRONG {1}", ok, wrong);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }