/// <summary>
 /// Executes the specified rule context.
 /// </summary>
 /// <param name="ruleContext">The rule context.</param>
 /// <returns>
 /// Returns value indicating whether the specified property is true or not
 /// </returns>
 protected override bool Execute(T ruleContext)
 {
     Assert.ArgumentNotNull(ruleContext, "ruleContext");
     return(DeviceResolverHelper.GetCompareProperty(
                Helper.GetPropertyName(this.Property),
                this.LowerLimit,
                this.UpperLimit));
 }
Esempio n. 2
0
 /// <summary>
 /// Executes the specified rule context.
 /// </summary>
 /// <param name="ruleContext">The rule context.</param>
 /// <returns>
 /// Returns value indicating whether the specified property is true or not
 /// </returns>
 protected override bool Execute(T ruleContext)
 {
     Assert.ArgumentNotNull(ruleContext, "ruleContext");
     return(DeviceResolverHelper.GetStringProperty(
                Helper.GetPropertyName(this.Property),
                Helper.GetValueName(this.Value),
                StringConditionOperator.Equals));
 }
 /// <summary>
 /// Executes the specified rule context.
 /// </summary>
 /// <param name="ruleContext">The rule context.</param>
 /// <returns>
 /// Returns value indicating whether the specified property is true or not
 /// </returns>
 protected override bool Execute(T ruleContext)
 {
     Assert.ArgumentNotNull(ruleContext, "ruleContext");
     return(DeviceResolverHelper.GetDoubleProperty(
                Helper.GetPropertyName(this.Property),
                this.Value,
                base.GetOperator()));
 }
Esempio n. 4
0
        /// <summary>
        /// Executes the specified rule context.
        /// </summary>
        /// <param name="ruleContext">The rule context.</param>
        /// <returns>Returns value indicating whether specified Device property matches Value or not</returns>
        protected override bool Execute(T ruleContext)
        {
            Assert.ArgumentNotNull(ruleContext, "ruleContext");
            string str           = this.Value ?? string.Empty;
            var    propertyValue = DeviceResolverHelper.GetStringProperty(this.Property);

            if (!string.IsNullOrEmpty(propertyValue))
            {
                return(Compare(propertyValue, str));
            }

            return(false);
        }
Esempio n. 5
0
 /// <summary>
 /// Executes the specified rule context.
 /// </summary>
 /// <param name="ruleContext">The rule context.</param>
 /// <returns>
 /// Returns value indicating whether the specified property is true or not
 /// </returns>
 protected override bool Execute(T ruleContext)
 {
     Assert.ArgumentNotNull(ruleContext, "ruleContext");
     return(DeviceResolverHelper.GetBoolProperty(
                Helper.GetPropertyName(this.Property)));
 }
Esempio n. 6
0
 /// <summary>
 /// Checks to see if the difference is below the maximum allowed.
 /// </summary>
 /// <param name="ruleContext">The rule context.</param>
 /// <returns>
 /// Returns value indicating whether the result is valid.
 /// </returns>
 protected override bool Execute(T ruleContext)
 {
     Assert.ArgumentNotNull(ruleContext, "ruleContext");
     return(DeviceResolverHelper.GetDifference(
                this.MaximumDifference));
 }