示例#1
0
 public virtual void replaceMacros(IDictionary macros)
 {
     if ((macros != null) && (macros.Count != 0))
     {
         ShortMap propGetMap = ExpMap.PropGetMap;
         if (propGetMap != null)
         {
             object obj2 = propGetMap[302];
             if (obj2 is string)
             {
                 string text = (string)obj2;
                 propGetMap.put(302, MacroCalc.replaceMacros(text, macros));
             }
         }
         string expStr = ExpMap.ExpStr;
         if (expStr != null)
         {
             ExpMap.ExpStr = MacroCalc.replaceMacros(expStr, macros);
         }
         ShortMap propEngMap = ExpMap.PropEngMap;
         if (propEngMap != null)
         {
             for (int i = 0; i < propEngMap.size(); i++)
             {
                 ExpParseInfo expInfo = (ExpParseInfo)propEngMap.getValue(i);
                 expInfo.ExpStr = MacroCalc.replaceMacros(expInfo.ExpStr, macros);
             }
         }
     }
 }
示例#2
0
        public virtual ShortMap setValuesMap(ShortMap val)
        {
            ShortMap map = _valueMap;

            _valueMap = val;
            return(map);
        }
示例#3
0
        public virtual ShortMap setExpressionsMap(ShortMap exp)
        {
            ShortMap map = _expMap;

            _expMap = exp;
            return(map);
        }
示例#4
0
文件: InputExp.cs 项目: ikvm/test
        private void method_1()
        {
            ShortMap inputMap = this.cellExt1_0.getCell(0, 0).InputMap;

            if (inputMap != null)
            {
                object obj2 = inputMap[601];
                if (obj2 is string)
                {
                    string src = (string)obj2;
                    if ((src != null) && (src.Length != 0))
                    {
                        src = Escape.unescape(src);
                        XmlDocument document = new XmlDocument();
                        document.LoadXml(src);
                        for (int i = 0; i < document.DocumentElement.ChildNodes.Count; i++)
                        {
                            Class7 class2 = new Class7 {
                                id   = document.DocumentElement.ChildNodes[i].ChildNodes[0].InnerText,
                                cols = Convert.ToInt32(document.DocumentElement.ChildNodes[i].ChildNodes[1].InnerText)
                            };
                            class2.keyCol  = document.DocumentElement.ChildNodes[i].ChildNodes[2].InnerText.Trim().Split(new char[] { ',' });
                            class2.keyNums = class2.keyCol.Length;
                            this.arrayList_0.Add(class2);
                        }
                    }
                }
            }
        }
示例#5
0
 public virtual void setPropResult(short key, object value_Renamed)
 {
     if (shortMap == null)
     {
         shortMap = new ShortMap(3);
     }
     shortMap.put(key, value_Renamed);
 }
示例#6
0
 public virtual string setExpression(short key, string exp)
 {
     if (_expMap == null)
     {
         _expMap = new ShortMap(15);
     }
     return((string)_expMap.put(key, exp));
 }
示例#7
0
 public virtual object setValue(short key, object val)
 {
     if (_valueMap == null)
     {
         _valueMap = new ShortMap(15);
     }
     return(_valueMap.put(key, val));
 }
示例#8
0
        private void method_12(int int_0, int int_1, int int_2, int int_3, int int_4, int int_5)
        {
            Cell cell = (Cell)base.matrix[int_0, int_1];

            if (cell != null)
            {
                ShortMap map = cell.getValuesMap();
                method_13(map, int_0, int_1, int_2, int_3, int_4, int_5);
                map = cell.getExpressionsMap();
                method_13(map, int_0, int_1, int_2, int_3, int_4, int_5);
            }
        }
示例#9
0
文件: InputExp.cs 项目: ikvm/test
        private string method_6(CellExt cellExt_0, short short_0)
        {
            ShortMap inputMap = cellExt_0.InputMap;

            if (inputMap != null)
            {
                object obj2 = inputMap[short_0];
                if (obj2 is string)
                {
                    return((string)obj2);
                }
            }
            return(null);
        }
示例#10
0
文件: CellSet1.cs 项目: ikvm/test
        private object method_2(int int_0, int int_1, short short_0)
        {
            object obj2 = null;
            Cell   cell = (Cell)matrix[int_0, int_1];

            if (cell != null)
            {
                obj2 = cell.getValue(short_0);
                ShortMap map = cell.getValuesMap();
                if (map != null)
                {
                    map.remove(short_0);
                }
            }
            return(obj2);
        }
示例#11
0
        public virtual void calcProperties()
        {
            ShortMap propEngMap = ExpMap.PropEngMap;

            if (propEngMap != null)
            {
                if (row != null)
                {
                    row.DataSet.CurrentRow = row;
                }
                for (int i = 0; i < propEngMap.size(); i++)
                {
                    short key = propEngMap.getKey(i);
                    if ((key != 304) && (key != 305))
                    {
                        var expInfo = (ExpParseInfo)propEngMap.getValue(i);
                        setPropResult(key, ConvertTool.getSingleValue(expInfo.Exp.calculate()));
                    }
                }
            }
        }
示例#12
0
 public virtual void prepareCalculate()
 {
     try
     {
         int_4 = 0;
         if (ExpMap.ExpStr != null)
         {
             if (!PropertyDefine.CEX_DEFAULT.Equals(Extensible))
             {
                 ExpMap.Exp = new ExpParse(CellSet, ExpMap.ExpStr);
                 // bool flag1 = !PropertyDefine.CEX_HORIZONTAL.Equals(Extensible) ? PropertyDefine.CEX_VERTICAL.Equals(Extensible) : true;
             }
             else
             {
                 ExpMap.Exp = new ExpParse(CellSet, ExpMap.ExpStr, true);
                 CellExt ext = CellSet.getCell(0, 0);
                 if (ExpMap.Exp.Extended)
                 {
                     if ((prevCell == ext) && (nextCell != ext))
                     {
                         Extensible = PropertyDefine.CEX_HORIZONTAL;
                     }
                     else if ((prevCell != ext) && (nextCell != ext))
                     {
                         Extensible = PropertyDefine.CEX_NONE;
                     }
                     else
                     {
                         Extensible = PropertyDefine.CEX_VERTICAL;
                     }
                 }
             }
             object_1 = originObject;
         }
         else
         {
             ShortMap propGetMap = ExpMap.PropGetMap;
             if (propGetMap != null)
             {
                 object_1 = propGetMap[302];
                 object obj2 = propGetMap[301];
                 if (((object_1 != null) && ((obj2 == null) || obj2.Equals(PropertyDefine.CDT_TEXT))) && (object_1 is string))
                 {
                     object_1 = ConvertTool.parse((string)object_1, false);
                     if (propGetMap[305] == null)
                     {
                         //string s = (string) propGetMap[304];
                         //if (!StringUtils.isSpaceString(s))
                         //{
                         propGetMap.put(305, ConvertTool.format(object_1, "{0}"));//s));
                         //}
                     }
                 }
             }
         }
         ShortMap propEngMap = ExpMap.PropEngMap;
         if (propEngMap != null)
         {
             for (int i = 0; i < propEngMap.size(); i++)
             {
                 ExpParseInfo expInfo = (ExpParseInfo)propEngMap.getValue(i);
                 expInfo.Exp = new ExpParse(CellSet, expInfo.ExpStr);
             }
         }
     }
     catch (ReportError error)
     {
         error.CellId = SourceId;
         throw error;
     }
     catch (Exception exception)
     {
         throw new ReportError(new StringBuilder("单元格").Append(SourceId).Append("中有错误,").Append(exception.Message).ToString().ToString(), exception);
     }
 }
示例#13
0
        private void method_13(ShortMap shortMap_0, int int_0, int int_1, int int_2, int int_3, int int_4, int int_5)
        {
            if (shortMap_0 != null)
            {
                for (int i = 0; i < shortMap_0.size(); i++)
                {
                    int    num3;
                    int    num5;
                    char   ch;
                    short  num2 = shortMap_0.getKey(i);
                    string str  = (string)method_15(int_0, int_1, num2);
                    if (((str == null) || (str.Trim().Length == 0)) || (str.StartsWith("#REF!") || str.StartsWith("#ERR!")))
                    {
                        continue;
                    }
                    StringBuilder builder = null;
                    int           num6    = str.Length;
                    bool          flag    = false;
                    int           num4    = 0;
                    goto Label_0188;
Label_0075:
                    ch = str[num4];
                    switch (ch)
                    {
                    case '\'':
                    case '"':
                        goto Label_015A;

                    default:
                        if (method_10(ch))
                        {
                            goto Label_0146;
                        }
                        num3 = method_11(str, num4);
                        num5 = num4;
                        while (num5 < num3)
                        {
                            if (str[num5] == '.')
                            {
                                break;
                            }
                            num5++;
                        }
                        break;
                    }
                    if (!method_9(str, num4, num5))
                    {
                        if (builder != null)
                        {
                            builder.Append(str.Substring(num4, num5 - num4));
                        }
                    }
                    else
                    {
                        if (builder == null)
                        {
                            builder = new StringBuilder(64);
                            builder.Append(str.Substring(0, num4));
                        }
                        if (!method_14(str, num4, num5, int_2, int_3, int_5, int_4, builder))
                        {
                            goto Label_0193;
                        }
                    }
                    if ((num5 < num3) && (builder != null))
                    {
                        builder.Append(str.Substring(num5, num3 - num5));
                    }
                    num4 = num3;
                    goto Label_0188;
Label_0146:
                    if (builder != null)
                    {
                        builder.Append(ch);
                    }
                    num4++;
                    goto Label_0188;
Label_015A:
                    num3 = ExpString.scanQuotation(str, num4, '\\');
                    if (num3 < 0)
                    {
                        goto Label_01E0;
                    }
                    if (builder != null)
                    {
                        builder.Append(str.Substring(num4, (num3 + 1) - num4));
                    }
                    num4 = num3 + 1;
Label_0188:
                    if (num4 >= num6)
                    {
                        goto Label_0202;
                    }
                    goto Label_0075;
Label_0193:
                    if (_relativeList == null)
                    {
                        _relativeList = new ArrayList(10);
                    }
                    _relativeList.Add(new RelativeFix(int_0, int_1, num2));
                    method_16(int_0, int_1, num2, "#REF!" + str.ToString().ToString());
                    flag = true;
                    goto Label_0202;
Label_01E0:
                    method_16(int_0, int_1, num2, "#ERR!" + str.ToString().ToString());
                    flag = true;
Label_0202:
                    if (!flag && (builder != null))
                    {
                        method_16(int_0, int_1, num2, builder.ToString());
                    }
                }
            }
        }
示例#14
0
 public Cell(ShortMap val, ShortMap exp)
 {
     _valueMap = val;
     _expMap   = exp;
 }
示例#15
0
 public virtual void setMap(ShortMap val, ShortMap exp)
 {
     _valueMap = val;
     _expMap   = exp;
 }