Beispiel #1
0
        private void MenuItem_Click_1(object sender, RoutedEventArgs e)//Rysuj kratę
        {
            Krata krata = new Krata();

            krata.ShowDialog();
            CrateOp(Krata.kol, Krata.wier, Krata.ru);
        }
Beispiel #2
0
        private void MenuItem_Click_5(object sender, RoutedEventArgs e)//Zapisz grę
        {
            Krata k = new Krata();

            gs.pl      = Gracze.players;
            gs.Simg    = ib.ImageSource.ToString();
            gs.kolumny = Krata.kol;
            gs.wiersze = Krata.wier;
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Filter = "RPGMaps file (*.rpgm)|*.rpgm|All files (*.*)|*.*";
            if (sfd.ShowDialog() == true)
            {
                Stream str;
                if ((str = sfd.OpenFile()) != null)
                {
                    BinaryFormatter bf = new BinaryFormatter();
                    bf.Serialize(str, gs);
                    str.Close();
                }
            }
        }