Пример #1
0
        private void btnOpen_Click(object sender, EventArgs e)
        {
            // Сохраняем
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            openFileDialog.Filter           = "(*.xml)|*.xml";
            if (DialogResult.OK == openFileDialog.ShowDialog(this))
            {
                Crossword newSudocu = Crossword.Load(openFileDialog.FileName);

                numHeigth.Value     = newSudocu.Size.Height;
                numWidth.Value      = newSudocu.Size.Width;
                numVertical.Value   = newSudocu.Vertical.GetMaxCount();
                numHorizontal.Value = newSudocu.Horizontal.GetMaxCount();

                FormGrid();

                for (byte i = 0; i < newSudocu.Horizontal.Count; i++)
                {
                    byte[] bytelst = newSudocu.Horizontal[i].list;
                    for (byte j = 0; j < bytelst.Length; i++)
                    {
                        dataHorizontal.Rows[i].Cells[j + 1].Value =
                            bytelst[j].ToString();
                    }
                }


                _isForm = true;
            }
        }
 //-----------------------------------------------------------------
 public void LoadSudocu(String Path)
 {
     _Sudocu = Crossword.Load(Path);
     DoSolve();
 }