Example #1
0
        public override void OnBackPressed()
        {
            // TODO: Ask user if they would like to save the event
            Event.Current.Save();

            Instance      = null;
            Event.Current = null;
            Finish();
        }
Example #2
0
        // GUI Events
        protected override void OnCreate(Bundle bundle)
        {
            // Go to the event-selection screen if no event has been selected
            if (Event.Current == null)
            {
                OnBackPressed();
                return;
            }

            // Setup GUI
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.ScoutMasterLayout);
            Instance = this;

            // Assign local references to GUI elements
            prevBtn  = FindViewById <Button>(Resource.Id.ScoutMasterPrevBtn);
            roundLbl = FindViewById <TextView>(Resource.Id.ScoutMasterRoundLbl);
            nextBtn  = FindViewById <Button>(Resource.Id.ScoutMasterNextBtn);

            teamSlots    = new Button[Round.TeamCount];
            teamSlots[0] = FindViewById <Button>(Resource.Id.RedTeamSlot1);
            teamSlots[1] = FindViewById <Button>(Resource.Id.RedTeamSlot2);
            teamSlots[2] = FindViewById <Button>(Resource.Id.RedTeamSlot3);
            teamSlots[3] = FindViewById <Button>(Resource.Id.BlueTeamSlot1);
            teamSlots[4] = FindViewById <Button>(Resource.Id.BlueTeamSlot2);
            teamSlots[5] = FindViewById <Button>(Resource.Id.BlueTeamSlot3);

            exportBtn     = FindViewById <Button>(Resource.Id.ScoutMasterExportBtn);
            startRoundBtn = FindViewById <Button>(Resource.Id.ScoutMasterStartRoundBtn);

            // Assign events to GUI elements
            prevBtn.Click += PrevBtn_Click;
            nextBtn.Click += NextBtn_Click;

            foreach (var btn in teamSlots)
            {
                btn.Click += TeamSlot_Click;
            }

            exportBtn.Click     += ExportBtn_Click;
            startRoundBtn.Click += StartRoundBtn_Click;

            // Update GUI Elements
            UpdateUI();
        }