Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ContingentAttribute" /> class.
 /// </summary>
 /// <param name="dependencyType">The type of action to take if the dependency condition is met.</param>
 /// <param name="dependentProperty">The dependent property in the model that this object is dependent on.</param>
 /// <param name="comparisonType">The comparison type to use.</param>
 /// <param name="dependentValue">The value to compare against.</param>
 protected ContingentAttribute(ActionForDependencyType dependencyType, string dependentProperty, ComparisonType comparisonType, object dependentValue)
 {
     DependencyType    = dependencyType;
     DependentProperty = dependentProperty;
     ComparisonType    = comparisonType;
     DependentValue    = dependentValue;
 }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Employment.Web.Mvc.Infrastructure.DataAnnotations.ButtonAttribute" /> class.
        /// </summary>
        /// <param name="name">Name of button.</param>
        /// <param name="dependencyType">The type of action to take if the dependency condition is met.</param>
        /// <param name="dependentProperty">The dependent property in the model that this object is dependent on.</param>
        /// <param name="comparisonType">The comparison type to use.</param>
        /// <param name="dependentValue">The value to compare against.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="name"/> is <c>null</c> or empty.</exception>
        public ButtonAttribute(string name, ActionForDependencyType dependencyType, string dependentProperty, ComparisonType comparisonType, object dependentValue) : base(dependencyType, dependentProperty, comparisonType, dependentValue)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            Name = name;
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Employment.Web.Mvc.Infrastructure.DataAnnotations.ExternalLinkAttribute" /> class.
        /// </summary>
        /// <param name="url">External URL.</param>
        /// <param name="dependencyType">The type of action to take if the dependency condition is met.</param>
        /// <param name="dependentProperty">The dependent property in the model that this object is dependent on.</param>
        /// <param name="comparisonType">The comparison type to use.</param>
        /// <param name="dependentValue">The value to compare against.</param>
        /// <exception cref="ArgumentNullException">Thrown if <see>
        ///                                                       <cref>url</cref>
        ///                                                   </see>
        ///     is null or empty.</exception>
        public ExternalLinkAttribute(string url, ActionForDependencyType dependencyType, string dependentProperty, ComparisonType comparisonType, object dependentValue) : base(dependencyType, dependentProperty, comparisonType, dependentValue)
        {
            if (string.IsNullOrEmpty(url))
            {
                throw new ArgumentNullException("url");
            }

            Url  = url;
            Name = url;
        }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Employment.Web.Mvc.Infrastructure.DataAnnotations.GroupAttribute" /> class.
 /// </summary>
 /// <param name="name">Name of group.</param>
 /// <param name="rowName"></param>
 /// <param name="groupRowType">Group Row type.</param>
 /// <param name="dependencyType">The type of action to take if the dependency condition is met.</param>
 /// <param name="dependentProperty">The dependent property in the model that this object is dependent on.</param>
 /// <param name="comparisonType">The comparison type to use.</param>
 /// <param name="dependentValue">The value to compare against.</param>
 /// <exception cref="ArgumentNullException">Thrown if <paramref name="name"/> is <c>null</c> or empty.</exception>
 public GroupAttribute(string name, string rowName, GroupRowType groupRowType, ActionForDependencyType dependencyType, string dependentProperty, ComparisonType comparisonType, object dependentValue)
     : this(name, dependencyType, dependentProperty, comparisonType, dependentValue)
 {
     Name      = name;
     RowName   = rowName;
     GroupType = GroupType.Default;
     RowType   = groupRowType;
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Employment.Web.Mvc.Infrastructure.DataAnnotations.LinkAttribute" /> class.
 /// </summary>
 /// <param name="name">Name of link.</param>
 /// <param name="dependencyType">The type of action to take if the dependency condition is met.</param>
 /// <param name="dependentProperty">The dependent property in the model that this object is dependent on.</param>
 /// <param name="comparisonType">The comparison type to use.</param>
 /// <param name="dependentValue">The value to compare against.</param>
 public LinkAttribute(string name, ActionForDependencyType dependencyType, string dependentProperty, ComparisonType comparisonType, object dependentValue) : base(dependencyType, dependentProperty, comparisonType, dependentValue)
 {
     Name = name;
 }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ContingentAttribute" /> class.
 /// </summary>
 /// <param name="dependencyType">The type of action to take if the dependency condition is met.</param>
 /// <param name="dependentProperty">The dependent property in the model that this object is dependent on.</param>
 /// <param name="dependentValue">The value to compare against.</param>
 protected ContingentAttribute(ActionForDependencyType dependencyType, string dependentProperty, object dependentValue) : this(dependencyType, dependentProperty, ComparisonType.EqualTo, dependentValue)
 {
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ContingentAttribute" /> class.
 /// </summary>
 /// <param name="dependencyType">The type of action to take if the dependency condition is met.</param>
 /// <param name="dependentProperty">The dependent property in the model that this object is dependent on.</param>
 protected ContingentAttribute(ActionForDependencyType dependencyType, string dependentProperty) : this(dependencyType, dependentProperty, null)
 {
 }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ContingentAttribute" /> class.
 /// </summary>
 /// <param name="dependencyType">The type of action to take if the dependency condition is met.</param>
 protected ContingentAttribute(ActionForDependencyType dependencyType) : this(dependencyType, null)
 {
 }