using System;
namespace Umbraco.Core.ObjectResolution
{
///
/// Indicates the relative weight of a resolved object type.
///
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public class WeightAttribute : Attribute
{
///
/// Initializes a new instance of the class with a weight.
///
/// The object type weight.
///
/// This internal constructor allows for internal Umbraco products to set a negative number weight
///
internal WeightAttribute(int weight)
{
Weight = weight;
}
///
/// Initializes a new instance of the class with a weight.
///
/// The object type weight.
///
/// The weight must be a positive number
///
public WeightAttribute(uint weight)
{
Weight = Convert.ToInt32(weight);
}
///
/// Gets or sets the weight of the object type.
///
public int Weight { get; private set; }
}
}