/// <summary> /// Initializes a new instance of the <see cref="RatingBoxController"/> class. /// </summary> /// <param name="element">The element representig the related <see cref="RatingBox"/></param> /// <param name="enabled">True if the <see cref="RatingBox"/> is modifiable, false otherwise</param> public RatingBoxController(RatingBox element, bool enabled) : base(enabled) { this.element = element; starRating = new StarRating(element.Values.Length, enabled); starRating.SelectedIndex = element.SelectedIndex - 1; Content = starRating; Title = element.Name; Description = element.Description; }
/// <summary> /// Implements the Greater operation between two <see cref="RatingBox"/> returning true /// if the first element is greater than the second, false otherwise /// </summary> /// <param name="par1">The first element to analize</param> /// <param name="par2">The second one</param> /// <param name="par1Index">The value's index referred to the first element</param> /// <param name="par2Index">The value's index referred to the second element</param> /// <returns>true if the value of the second <see cref="RatingBox"/> is greater than /// the first, false otherwise</returns> public static bool Less(RatingBox par1, RatingBox par2, int par1Index, int par2Index) { return(Int32.Parse(par1.Values[par1Index]) < Int32.Parse(par1.Values[par2Index])); }
/// <summary> /// Implements the Greater operation between two <see cref="RatingBox"/> returning true /// if the first element is greater than the second, false otherwise /// </summary> /// <param name="par1">The first element to analize</param> /// <param name="par2">The second one</param> /// <param name="par1Index">The value's index referred to the first element</param> /// <param name="par2Index">The value's index referred to the second element</param> /// <returns>true if the value of the first <see cref="RatingBox"/> is greater than /// the second, false otherwise</returns> public static bool Greater(RatingBox par1, RatingBox par2, int par1Index, int par2Index) { return(Int32.Parse(par1.Values[par1Index]) > Int32.Parse(par1.Values[par2Index])); }
/// <summary> /// Overloaded constructor /// </summary> /// <param name="element">The element representig the related <see cref="RatingBox"/></param> public RatingBoxController(RatingBox element) : this(element, true) { }