コード例 #1
0
 partial void OnBookNameChanging(string value)      // Boilerplate
 {
     if (BookName == null || BookName.Equals(value))
     {
         return;
     }
     HasChanges = true;
 }
コード例 #2
0
 public bool Equals(BookClass other) => other is BookClass && BookName.Equals(other.BookName) &&
 AuthorName.Equals(other.AuthorName);
コード例 #3
0
        //////////////////////////////////////////////////////////////////////////
        //Операции общего назначения

        private void EditField_TextChanged(object sender, TextChangedEventArgs e)
        {
            TextBox textBox = (TextBox)sender;

            if (Name.Equals(textBox))
            {
                if (Name.Text.Length > 0)
                {
                    NameWatermark.Visibility = Visibility.Hidden;
                }
                else
                {
                    NameWatermark.Visibility = Visibility.Visible;
                }
            }
            else if (Surname.Equals(textBox))
            {
                if (Surname.Text.Length > 0)
                {
                    SurnameWatermark.Visibility = Visibility.Hidden;
                }
                else
                {
                    SurnameWatermark.Visibility = Visibility.Visible;
                }
            }
            else if (Patronymic.Equals(textBox))
            {
                if (Patronymic.Text.Length > 0)
                {
                    PatronymicWatermark.Visibility = Visibility.Hidden;
                }
                else
                {
                    PatronymicWatermark.Visibility = Visibility.Visible;
                }
            }
            else if (Password.Equals(textBox))
            {
                if (Password.Text.Length > 0)
                {
                    PasswordWatermark.Visibility = Visibility.Hidden;
                }
                else
                {
                    PasswordWatermark.Visibility = Visibility.Visible;
                }
            }
            else if (AuthorSurname.Equals(textBox))
            {
                if (AuthorSurname.Text.Length > 0)
                {
                    AuthorSurnameWatermark.Visibility = Visibility.Hidden;
                }
                else
                {
                    AuthorSurnameWatermark.Visibility = Visibility.Visible;
                }
            }
            else if (AuthorName.Equals(textBox))
            {
                if (AuthorName.Text.Length > 0)
                {
                    AuthorNameWatermark.Visibility = Visibility.Hidden;
                }
                else
                {
                    AuthorNameWatermark.Visibility = Visibility.Visible;
                }
            }
            else if (AuthorPatronymic.Equals(textBox))
            {
                if (AuthorPatronymic.Text.Length > 0)
                {
                    AuthorPatronymicWatermark.Visibility = Visibility.Hidden;
                }
                else
                {
                    AuthorPatronymicWatermark.Visibility = Visibility.Visible;
                }
            }
            else if (BookName.Equals(textBox))
            {
                if (BookName.Text.Length > 0)
                {
                    BookNameWatermark.Visibility = Visibility.Hidden;
                }
                else
                {
                    BookNameWatermark.Visibility = Visibility.Visible;
                }
            }
            else if (Publisher.Equals(textBox))
            {
                if (Publisher.Text.Length > 0)
                {
                    PublisherWatermark.Visibility = Visibility.Hidden;
                }
                else
                {
                    PublisherWatermark.Visibility = Visibility.Visible;
                }
            }
            else if (PublicationDate.Equals(textBox))
            {
                if (PublicationDate.Text.Length > 0)
                {
                    PublicationDateWatermark.Visibility = Visibility.Hidden;
                }
                else
                {
                    PublicationDateWatermark.Visibility = Visibility.Visible;
                }
            }
            else if (PageCount.Equals(textBox))
            {
                if (PageCount.Text.Length > 0)
                {
                    PageCountWatermark.Visibility = Visibility.Hidden;
                }
                else
                {
                    PageCountWatermark.Visibility = Visibility.Visible;
                }
            }
            else if (Location.Equals(textBox))
            {
                if (Location.Text.Length > 0)
                {
                    LocationWatermark.Visibility = Visibility.Hidden;
                }
                else
                {
                    LocationWatermark.Visibility = Visibility.Visible;
                }
            }
            else if (Search.Equals(textBox))
            {
                SearchUpdate();
            }
        }