///<summary> /// Check if the current instance equals another instance of this class. ///</summary> ///<param name="obj">The instance to compare the current instance with.</param> ///<returns><code>true</code> if the instances are the same instance or have the same content.</returns> public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } Quantity q = (Quantity)obj; if (!Caption.Equals(q.Caption)) { return(false); } if (!Unit.Equals(q.Unit)) { return(false); } if (Description == null && q.Description != null) { return(false); } if (Description != null && !Description.Equals(q.Description)) { return(false); } return(true); }
protected override void OnGotFocus(EventArgs e) { base.OnGotFocus(e); this.PaintingType = PaintType.MouseOver; if (!Caption.Equals(captionString)) { toolTip.SetToolTip(this, ToolTipText); } else { toolTip.RemoveAll(); } }
/// <summary>Determines whether the specified object is equal to the current object.</summary> /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns> /// <param name="obj">The object to compare with the current object. </param> public override bool Equals(object obj) { if (obj == this) { return(true); } else if (!(obj is TimeRangeItem)) { return(false); } else { var other = (TimeRangeItem)obj; return(Caption.Equals(other.Caption) && TimedCountDuration.Equals(other.TimedCountDuration) && EventTimeRange.Equals(other.EventTimeRange) && GroupTimeRange.Equals(other.GroupTimeRange)); } }
///<summary> /// Check if the current instance equals another instance of this class. ///</summary> ///<param name="obj">The instance to compare the current instance with.</param> ///<returns><code>true</code> if the instances are the same instance or have the same content.</returns> public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } ElementSet s = (ElementSet)obj; if (Description == null && s.Description != null) { return(false); } if (Description != null && !Description.Equals(s.Description)) { return(false); } if (!Caption.Equals(s.Caption)) { return(false); } if (SpatialReferenceSystemWkt == null && s.SpatialReferenceSystemWkt != null) { return(false); } if (SpatialReferenceSystemWkt != null && !SpatialReferenceSystemWkt.Equals(s.SpatialReferenceSystemWkt)) { return(false); } if (!ElementType.Equals(s.ElementType)) { return(false); } if (ElementCount != s.ElementCount) { return(false); } for (int i = 0; i < ElementCount; i++) { if (!GetElement(i).Equals(s.GetElement(i))) { return(false); } } return(true); }
private void mnuSearch_Click(object sender, RoutedEventArgs e) { CLookupConfig cfg = (CLookupConfig)lookupTypeConfigs[Lookup]; CCriteriaBase cr = (CCriteriaBase)Activator.CreateInstance(Type.GetType(cfg.ScreenCriteriaClassName)); cr.SetActionEnable(false); criteriaInitFunc(cr); String caption = Caption; if (Caption.Equals("")) { caption = lookupTypeToCaption(Lookup); } WinLookupSearch2 w = new WinLookupSearch2(cr, caption); w.ShowDialog(); if (w.IsOK) { SelectedObject = w.ReturnedObj; } }