Ejemplo n.º 1
0
 private bool isCorrect(TextBoxWithErrorProvider tb)
 {
     if (!(tb.Text.All(char.IsLetter)))
     {
         tb.SetError("Wprowadź ponownie");
         return(false);
     }
     if (tb.Text.Trim() == "")
     {
         tb.SetError("Pole nie może być puste");
         return(false);
     }
     tb.SetError("");
     return(true);
 }
Ejemplo n.º 2
0
 private bool isValid(TextBoxWithErrorProvider tb)
 {
     if (tb.Text.Trim() != "" & tb.Text.All(char.IsLetter))
     {
         tb.SetError("");
         return(true);
     }
     if (tb.Text.Trim() == "")
     {
         tb.SetError("Pole nie może być puste");
         return(false);
     }
     tb.SetError("Pole nie może zawierać cyfr");
     return(false);
 }
Ejemplo n.º 3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 8 "..\..\MainWindow.xaml"
                ((Lab1.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden

            #line 8 "..\..\MainWindow.xaml"
                ((Lab1.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing);

            #line default
            #line hidden
                return;

            case 2:
                this.forename = ((Lab1.TextBoxWithErrorProvider)(target));
                return;

            case 3:
                this.surname = ((Lab1.TextBoxWithErrorProvider)(target));
                return;

            case 4:
                this.sliderAge = ((System.Windows.Controls.Slider)(target));
                return;

            case 5:
                this.sliderWeight = ((System.Windows.Controls.Slider)(target));
                return;

            case 6:
                this.buttonDodaj = ((System.Windows.Controls.Button)(target));

            #line 35 "..\..\MainWindow.xaml"
                this.buttonDodaj.Click += new System.Windows.RoutedEventHandler(this.buttonDodaj_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.buttonEdytuj = ((System.Windows.Controls.Button)(target));

            #line 36 "..\..\MainWindow.xaml"
                this.buttonEdytuj.Click += new System.Windows.RoutedEventHandler(this.buttonEdytuj_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.buttonUsun = ((System.Windows.Controls.Button)(target));

            #line 37 "..\..\MainWindow.xaml"
                this.buttonUsun.Click += new System.Windows.RoutedEventHandler(this.buttonUsun_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.listBoxPilkarze = ((System.Windows.Controls.ListBox)(target));

            #line 40 "..\..\MainWindow.xaml"
                this.listBoxPilkarze.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.listBoxPilkarze_SelectionChanged);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 4
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.stackPanelName = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 2:
                this.labelName = ((System.Windows.Controls.Label)(target));
                return;

            case 3:
                this.textBoxErrorName = ((Lab1.TextBoxWithErrorProvider)(target));
                return;

            case 4:
                this.labelSurname = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.textBoxErrorSurname = ((Lab1.TextBoxWithErrorProvider)(target));
                return;

            case 6:
                this.labelAge = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.borderAge = ((System.Windows.Controls.Border)(target));
                return;

            case 8:
                this.labelAgeValue = ((System.Windows.Controls.Label)(target));
                return;

            case 9:
                this.sliderAge = ((System.Windows.Controls.Slider)(target));

            #line 29 "..\..\MainWindow.xaml"
                this.sliderAge.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.sliderAge_ValueChanged);

            #line default
            #line hidden
                return;

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

            #line 39 "..\..\MainWindow.xaml"
                this.buttonAdd.Click += new System.Windows.RoutedEventHandler(this.buttonAdd_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.buttonEdit = ((System.Windows.Controls.Button)(target));

            #line 40 "..\..\MainWindow.xaml"
                this.buttonEdit.Click += new System.Windows.RoutedEventHandler(this.buttonEdit_Click);

            #line default
            #line hidden
                return;

            case 12:
                this.buttonDelete = ((System.Windows.Controls.Button)(target));

            #line 41 "..\..\MainWindow.xaml"
                this.buttonDelete.Click += new System.Windows.RoutedEventHandler(this.buttonDelete_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.listBoxName = ((System.Windows.Controls.ListBox)(target));

            #line 47 "..\..\MainWindow.xaml"
                this.listBoxName.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.listBoxName_SelectionChanged);

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