コード例 #1
0
ファイル: MainActivity.cs プロジェクト: OndrejMikulec/Buttons
        protected override void OnResume()
        {
            base.OnResume();

            scoreText.Text = null;
            SeznamVysledku.ReadFromBinaryFile();
            if (SeznamVysledku.seznam != null)
            {
                foreach (Vysledek x in SeznamVysledku.seznam.OrderByDescending(p => p.Score))
                {
                    scoreText.Text += "\n" + x.Score + "     " + x.Cas;
                }
            }

            SaveOtions.ReadFromFile();
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: OndrejMikulec/Buttons
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Game);

            layMain = FindViewById <RelativeLayout> (Resource.Id.LayoutMain);
            layMain.SetOnTouchListener(this);


            SaveOtions.ReadFromFile();

            textScore = FindViewById <TextView> (Resource.Id.textView1);

            obrazekSmile = FindViewById <ImageView> (Resource.Id.imageView1);

            casovac           = new System.Timers.Timer();
            casovac.AutoReset = true;
            casovac.Elapsed  += HandleElapsed;
        }
コード例 #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Create your application here
            SetContentView(Resource.Layout.Options);

            CheckBox     checkVibrace = FindViewById <CheckBox> (Resource.Id.checkBoxVibrace);
            ToggleButton toggle       = FindViewById <ToggleButton> (Resource.Id.toggleButton);

            SaveOtions.ReadFromFile();

            if (OptionsHodnoty.Vibrace)
            {
                checkVibrace.Checked = true;
            }
            else
            {
                checkVibrace.Checked = false;
            }

            checkVibrace.CheckedChange += delegate {
                if (checkVibrace.Checked)
                {
                    OptionsHodnoty.Vibrace = true;
                    SaveOtions.WriteToFile();
                }
                else
                {
                    OptionsHodnoty.Vibrace = false;
                    SaveOtions.WriteToFile();
                }
            };

            if (OptionsHodnoty.TouchMode)
            {
                toggle.Checked = true;
            }
            else
            {
                toggle.Checked = false;
            }

            toggle.CheckedChange += delegate {
                if (toggle.Checked)
                {
                    OptionsHodnoty.TouchMode = true;
                    SaveOtions.WriteToFile();
                }
                else
                {
                    OptionsHodnoty.TouchMode = false;
                    SaveOtions.WriteToFile();
                }
            };

            Button resetScore = FindViewById <Button> (Resource.Id.buttonResetScore);

            resetScore.LongClick += delegate {
                SeznamVysledku.ResetVysledku();
            };

            Button zpet = FindViewById <Button> (Resource.Id.buttonZpet);

            zpet.Click += delegate {
                Finish();
            };
        }