コード例 #1
0
ファイル: HeadSource.Data.cs プロジェクト: Seany84/GedcomCore
            public override bool Equals(object obj)
            {
                if (obj == null)
                {
                    throw new ArgumentNullException();
                }

                if (!(obj is Data_ data))
                {
                    return(false);
                }

                if (!base.Equals(obj))
                {
                    return(false);
                }

                if (!NameOfSourceData.Equals(data.NameOfSourceData))
                {
                    return(false);
                }

                if (!PublicationDate.Equals(data.PublicationDate))
                {
                    return(false);
                }

                if (!Copyright.Equals(data.Copyright))
                {
                    return(false);
                }

                return(true);
            }
コード例 #2
0
 public int CompareTo(Book other)
 {
     if (!Name.Equals(other.Name))
     {
         return(Name.CompareTo(other.Name));
     }
     if (!Author.Equals(other.Author))
     {
         return(Author.CompareTo(other.Author));
     }
     if (!Category.Equals(other.Category))
     {
         return(Category.CompareTo(other.Category));
     }
     if (!Language.Equals(other.Language))
     {
         return(Language.CompareTo(other.Language));
     }
     if (!PublicationDate.Equals(other.PublicationDate))
     {
         return(PublicationDate.CompareTo(other.PublicationDate));
     }
     if (!Isbn.Equals(other.Isbn))
     {
         return(Isbn.CompareTo(other.Isbn));
     }
     return(0);
 }
コード例 #3
0
 public bool Equals(Book other)
 {
     if (object.ReferenceEquals(other, null))
     {
         return(object.ReferenceEquals(this, null));
     }
     return(Name.Equals(other.Name) && Author.Equals(other.Author) && Category.Equals(other.Category) &&
            Language.Equals(other.Language) && PublicationDate.Equals(other.PublicationDate) && Isbn.Equals(other.Isbn));
 }
コード例 #4
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();
            }
        }