Esempio n. 1
0
 void RemoveCellVauleRuleCondition(CellValueRule cellVauleRule)
 {
     if (this.cellValues.ContainsKey(cellVauleRule))
     {
         this.RemoveConditionsByRange(cellVauleRule.Ranges, this.cellValues[cellVauleRule].ToArray());
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        public override object Clone()
        {
            CellValueRule rule = base.Clone() as CellValueRule;

            rule.value1 = this.value1;
            rule.value2 = this.value2;
            return(rule);
        }
Esempio n. 3
0
 static string GetExpectedFormula(CellValueRule cellValueRule, int index)
 {
     if ((cellValueRule != null) && (cellValueRule.Condition != null))
     {
         if (cellValueRule.Condition is RelationCondition)
         {
             RelationCondition condition = cellValueRule.Condition as RelationCondition;
             if (((index != 10) && (index != 11)) || ((condition.Item1 == null) || !(condition.Item1 is RelationCondition)))
             {
                 if (((index != 20) && (index != 0x15)) || ((condition.Item2 == null) || !(condition.Item2 is RelationCondition)))
                 {
                     if (((index == 0) && (condition.Item1 != null)) && (condition.Item1.ExpectedFormula != null))
                     {
                         return("=" + condition.Item1.ExpectedFormula);
                     }
                     if (((index == 1) && (condition.Item2 != null)) && (condition.Item2.ExpectedFormula != null))
                     {
                         return("=" + condition.Item2.ExpectedFormula);
                     }
                 }
                 else
                 {
                     condition = condition.Item2 as RelationCondition;
                     if (((index == 20) && (condition.Item1 != null)) && (condition.Item1.ExpectedFormula != null))
                     {
                         return("=" + condition.Item1.ExpectedFormula);
                     }
                     if (((index == 0x15) && (condition.Item2 != null)) && (condition.Item2.ExpectedFormula != null))
                     {
                         return("=" + condition.Item2.ExpectedFormula);
                     }
                 }
             }
             else
             {
                 condition = condition.Item1 as RelationCondition;
                 if (((index == 10) && (condition.Item1 != null)) && (condition.Item1.ExpectedFormula != null))
                 {
                     return("=" + condition.Item1.ExpectedFormula);
                 }
                 if (((index == 11) && (condition.Item2 != null)) && (condition.Item2.ExpectedFormula != null))
                 {
                     return("=" + condition.Item2.ExpectedFormula);
                 }
             }
         }
         else if (((index == 0) && (cellValueRule.Condition != null)) && (cellValueRule.Condition.ExpectedFormula != null))
         {
             return("=" + cellValueRule.Condition.ExpectedFormula);
         }
     }
     return(null);
 }
Esempio n. 4
0
 void AddCellValueRuleCondtion(CellValueRule cellValueRule)
 {
     if (cellValueRule != null)
     {
         List <DummyCellValue> dummyCellvalues = DummyCellValue.GetDummyCellvalues(cellValueRule);
         if (dummyCellvalues.Count > 0)
         {
             this.cellValues.Add(cellValueRule, dummyCellvalues);
             this.AddConditionsByRange(cellValueRule.Ranges, dummyCellvalues.ToArray());
         }
     }
 }
Esempio n. 5
0
        public static List <DummyCellValue> GetDummyCellvalues(CellValueRule cellValueRule)
        {
            List <DummyCellValue> list = new List <DummyCellValue>();

            if (cellValueRule != null)
            {
                int[] numArray = new int[] { 0, 1, 10, 11, 20, 0x15 };
                foreach (int num in numArray)
                {
                    if (GetExpectedFormula(cellValueRule, num) != null)
                    {
                        list.Add(new DummyCellValue(cellValueRule, num));
                    }
                }
            }
            return(list);
        }
Esempio n. 6
0
 public DummyCellValue(CellValueRule cellValueRule, int index)
 {
     this.cellValueRule = cellValueRule;
     this.index         = index;
 }