Exemple #1
0
 /// <summary>
 /// Raises RatingChanging event.
 /// </summary>
 /// <param name="e">Event data</param>
 protected virtual void OnRatingChanging(RatingChangeEventArgs e)
 {
     if (RatingChanging != null)
         RatingChanging(this, e);
 }
Exemple #2
0
 /// <summary>
 /// Sets the Rating value of the control and provides information about source of the rating change.
 /// </summary>
 /// <param name="newRating">New Rating value.</param>
 /// <param name="eEventSource">Source of this change.</param>
 public void SetRating(int newRating, eEventSource source)
 {
     if (newRating == _Rating) return;
     RatingChangeEventArgs e = new RatingChangeEventArgs(newRating, _Rating, source);
     OnRatingChanging(e);
     if (e.Cancel) return;
     newRating = e.NewRating;
     _Rating = newRating;
     OnRatingChanged(e);
     ExecuteCommand();
     this.Refresh();
 }