/// <summary> /// Returns true if TesServiceInfo instances are equal /// </summary> /// <param name="other">Instance of TesServiceInfo to be compared</param> /// <returns>Boolean</returns> public bool Equals(TesServiceInfo other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Name == other.Name || Name != null && Name.Equals(other.Name) ) && ( Doc == other.Doc || Doc != null && Doc.Equals(other.Doc) ) && ( Storage == other.Storage || Storage != null && Storage.SequenceEqual(other.Storage) )); }
private void button1_Click_1(object sender, EventArgs e) { foreach (ListViewItem item in ltvDocColTo.Items) { if (item.Selected) { ltvDocColTo.Items.Remove(item); } } foreach (ListViewItem item in ltvDocColFrom.Items) { ltvDocColFrom.Items.Remove(item); } foreach (string Doc in DocumentNameCollection) { bool check = true; foreach (ListViewItem item in ltvDocColTo.Items) { if (Doc.Equals(item.Text)) { check = false; } } if (check) { ListViewItem ltviDoc = new ListViewItem(); ltviDoc.Text = Doc; ltvDocColFrom.Items.Add(ltviDoc); } } }
/// <summary> /// Returns true if Collection instances are equal /// </summary> /// <param name="other">Instance of Collection to be compared</param> /// <returns>Boolean</returns> public bool Equals(Collection other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) { return(false); } return (( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( Rid == other.Rid || Rid != null && Rid.Equals(other.Rid) ) && ( Ts == other.Ts || Ts != null && Ts.Equals(other.Ts) ) && ( Self == other.Self || Self != null && Self.Equals(other.Self) ) && ( Etag == other.Etag || Etag != null && Etag.Equals(other.Etag) ) && ( Doc == other.Doc || Doc != null && Doc.Equals(other.Doc) ) && ( Sprocs == other.Sprocs || Sprocs != null && Sprocs.Equals(other.Sprocs) ) && ( Triggers == other.Triggers || Triggers != null && Triggers.Equals(other.Triggers) ) && ( Udfs == other.Udfs || Udfs != null && Udfs.Equals(other.Udfs) ) && ( Conflicts == other.Conflicts || Conflicts != null && Conflicts.Equals(other.Conflicts) ) && ( IndexingPolicy == other.IndexingPolicy || IndexingPolicy != null && IndexingPolicy.Equals(other.IndexingPolicy) )); }