Ejemplo n.º 1
0
        /*
         * Poniższy przykład pozwala na zgłaszanie błędu pustego pola poprzez
         * wywołanie metody void SerError(string s), która dla pustego string
         * zgłasza błąd, a dla niepustego włącza obsługę błędu i wypisuje ten
         * string w toolTip'ie.
         */

        private bool isNoEmpty(TextBoxWithErrorProvider tb)
        {
            if (tb.Text.Trim() == "")
            {
                tb.SetError("Pole nie może być puste!");
                return(false);
            }
            tb.SetError("");
            return(true);
        }
Ejemplo n.º 2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

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

            #line default
            #line hidden

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

            #line default
            #line hidden
                return;

            case 2:
                this.textBoxWEPImie = ((dodawanieDanych.TextBoxWithErrorProvider)(target));
                return;

            case 3:
                this.textBoxWEPNazwisko = ((dodawanieDanych.TextBoxWithErrorProvider)(target));
                return;

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

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

            #line 33 "..\..\MainWindow.xaml"
                this.wiekSlider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Wiek_ValueChanged);

            #line default
            #line hidden
                return;

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

            case 7:
                this.wagaSlider = ((System.Windows.Controls.Slider)(target));

            #line 40 "..\..\MainWindow.xaml"
                this.wagaSlider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Waga_ValueChanged);

            #line default
            #line hidden
                return;

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

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

            #line default
            #line hidden
                return;

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

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

            #line default
            #line hidden
                return;

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

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

            #line default
            #line hidden
                return;

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

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

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