コード例 #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (!ValidInput())
            {
                return;
            }

            var game = new Game(int.Parse(TeamNumber.Text))
            {
                GameNumber            = int.Parse(GameNumber.Text),
                AutonomousDescription = GetContentOfAutoDescription(),
                AutonomousSuccess     = AutoSucsses.GetIntValue(),
                Climb            = Climb.IsChecked != null && (bool)Climb.IsChecked,
                MiddleAutonomous = MiddleAuto.IsChecked != null && (bool)MiddleAuto.IsChecked,
                MissionSuccess   = MissionSucssesSlider.GetIntValue(),
                Missions         = GetSelectedMission(),
                Stability        = StabilitySlider.GetIntValue()
            };

            MsgLabel.Visibility = Visibility.Visible;
            if (!DataLists.AddGame(game))
            {
                MsgLabel.ShowMessage("Can't send game to server.\nPlease check your internet connection.", true);
            }
            else
            {
                MsgLabel.ShowMessage("Game has successfully saved!", false);
            }
        }
コード例 #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.GameDetailsExpender = ((System.Windows.Controls.Expander)(target));
                return;

            case 2:
                this.GameDetails = ((ScoutingApp.GameDetails)(target));
                return;

            case 3:
                this.MsgLabel = ((ScoutingApp.MsgLabel)(target));
                return;

            case 4:

            #line 37 "..\..\TestTab.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.DataListsOnGameListChanged);

            #line default
            #line hidden
                return;

            case 5:
                this.CustomListView = ((ScoutingApp.CustomListView)(target));
                return;
            }
            this._contentLoaded = true;
        }
コード例 #3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Username = ((System.Windows.Controls.TextBox)(target));

            #line 12 "..\..\LogIn.xaml"
                this.Username.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.Username_OnTextChanged);

            #line default
            #line hidden
                return;

            case 2:
                this.PasswordBox = ((System.Windows.Controls.PasswordBox)(target));

            #line 16 "..\..\LogIn.xaml"
                this.PasswordBox.PasswordChanged += new System.Windows.RoutedEventHandler(this.PasswordBox_OnPasswordChanged);

            #line default
            #line hidden
                return;

            case 3:
                this.MsgLabel = ((ScoutingApp.MsgLabel)(target));
                return;

            case 4:

            #line 23 "..\..\LogIn.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Submit_OnClick);

            #line default
            #line hidden
                return;

            case 5:

            #line 26 "..\..\LogIn.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Settings_OnClick);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
コード例 #4
0
 private void UpdateList()
 {
     MsgLabel.Visibility    = Visibility.Visible;
     (string msg, bool err) = DataLists.UpdateGameList();
     MsgLabel.ShowMessage(msg, err);
     CustomListView.ItemList.Children.Clear();
     foreach (var game in  DataLists.GetGames())
     {
         CustomListViewColumn column = new CustomListViewColumn
         {
             Data1 = { Content = game.TeamNumber },
             Data2 = { Content = game.GameNumber }
         };
         column.MouseDoubleClick += DetailsButtonOnClick;
         CustomListView.ItemList.Children.Add(column);
     }
 }
コード例 #5
0
        private bool ValidInput()
        {
            bool valid = true;

            if (IsRichTextBoxEmpty(AutoDiscription))
            {
                MsgLabel.ShowMessage("Autonomous Description can't be empty", true);
                SubmitButton.IsEnabled = AllowSubmit();
                valid = false;
            }

            if (!GetSelectedMission().Equals("nothing"))
            {
                return(valid);
            }
            MsgLabel.ShowMessage("One of the mission must be selected", true);
            SubmitButton.IsEnabled = AllowSubmit();
            return(false);
        }
コード例 #6
0
 private void Submit_OnClick(object sender, RoutedEventArgs e)
 {
     Settings.Password = PasswordBox.Password;
     if (!Connections.ValidPassword())
     {
         MsgLabel.Visibility = Visibility.Visible;
         MsgLabel.ShowMessage("Incorrect Password. Maybe you're offline...", true);
         return;
     }
     Settings.SaveSettings();
     if (_switchWindow)
     {
         SwitchToMain();
     }
     if (Settings.LoadAtStartUp)
     {
         DataLists.RefreshLists();
     }
     Close();
 }
コード例 #7
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var pit = new Pit(int.Parse(TeamNumber.Text))
            {
                AutonomousOptions     = int.Parse(AutoOptions.Text),
                Climb                 = ClimbAble.IsChecked != null && (bool)ClimbAble.IsChecked,
                MiddleAutonomous      = MiddleAuto.IsChecked != null && (bool)MiddleAuto.IsChecked,
                Chassis               = SelectedChassis(),
                AutonomousDescription = AutoDescriptionContent()
            };

            MsgLabel.Visibility = Visibility.Visible;
            if (!DataLists.AddPit(pit))
            {
                MsgLabel.ShowMessage("Can't send pit to server.\nPlease check your internet connection.", true);
            }
            else
            {
                MsgLabel.ShowMessage("Pit has successfully saved!", false);
            }
        }
コード例 #8
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.MsgLabel = ((ScoutingApp.MsgLabel)(target));
                return;

            case 2:
                this.TeamNumber = ((System.Windows.Controls.TextBox)(target));

            #line 23 "..\..\AddGame.xaml"
                this.TeamNumber.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.TextBox_OnTextChanged);

            #line default
            #line hidden
                return;

            case 3:
                this.GameNumber = ((System.Windows.Controls.TextBox)(target));

            #line 26 "..\..\AddGame.xaml"
                this.GameNumber.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.TextBox_OnTextChanged);

            #line default
            #line hidden
                return;

            case 4:
                this.MiddleAuto = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 5:
                this.AutoDiscription = ((System.Windows.Controls.RichTextBox)(target));

            #line 37 "..\..\AddGame.xaml"
                this.AutoDiscription.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.AutoDescription_OnTextChanged);

            #line default
            #line hidden
                return;

            case 6:
                this.AutoSucsses = ((ScoutingApp.CustomSlider)(target));
                return;

            case 7:

            #line 40 "..\..\AddGame.xaml"
                ((System.Windows.Controls.StackPanel)(target)).GotFocus += new System.Windows.RoutedEventHandler(this.Missions_OnGotFocus);

            #line default
            #line hidden
                return;

            case 8:
                this.M1 = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 9:
                this.M2 = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 10:
                this.M3 = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 11:
                this.StabilitySlider = ((ScoutingApp.CustomSlider)(target));
                return;

            case 12:
                this.MissionSucssesSlider = ((ScoutingApp.CustomSlider)(target));
                return;

            case 13:
                this.Climb = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 14:
                this.SubmitButton = ((System.Windows.Controls.Button)(target));

            #line 60 "..\..\AddGame.xaml"
                this.SubmitButton.Click += new System.Windows.RoutedEventHandler(this.Button_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
コード例 #9
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.MsgLabel = ((ScoutingApp.MsgLabel)(target));
                return;

            case 2:
                this.TeamNumber = ((System.Windows.Controls.TextBox)(target));

            #line 11 "..\..\AddPit.xaml"
                this.TeamNumber.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.TextBox_OnTextChanged);

            #line default
            #line hidden
                return;

            case 3:
                this.MiddleAuto = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 4:
                this.ClimbAble = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 5:
                this.AutoOptions = ((System.Windows.Controls.TextBox)(target));

            #line 25 "..\..\AddPit.xaml"
                this.AutoOptions.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.TextBox_OnTextChanged);

            #line default
            #line hidden
                return;

            case 6:
                this.AutoDescription = ((System.Windows.Controls.RichTextBox)(target));

            #line 29 "..\..\AddPit.xaml"
                this.AutoDescription.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.AutoDescription_OnTextChanged);

            #line default
            #line hidden
                return;

            case 7:
                this.Tank = ((System.Windows.Controls.RadioButton)(target));

            #line 33 "..\..\AddPit.xaml"
                this.Tank.Checked += new System.Windows.RoutedEventHandler(this.Chassis_OnChecked);

            #line default
            #line hidden
                return;

            case 8:
                this.Mechanom = ((System.Windows.Controls.RadioButton)(target));

            #line 36 "..\..\AddPit.xaml"
                this.Mechanom.Checked += new System.Windows.RoutedEventHandler(this.Chassis_OnChecked);

            #line default
            #line hidden
                return;

            case 9:
                this.Omni = ((System.Windows.Controls.RadioButton)(target));

            #line 39 "..\..\AddPit.xaml"
                this.Omni.Checked += new System.Windows.RoutedEventHandler(this.Chassis_OnChecked);

            #line default
            #line hidden
                return;

            case 10:
                this.SubmitButton = ((System.Windows.Controls.Button)(target));

            #line 45 "..\..\AddPit.xaml"
                this.SubmitButton.Click += new System.Windows.RoutedEventHandler(this.Button_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }