Ejemplo n.º 1
0
 public override void Init()
 {
     for (int i = 0; i < this.RowNumber; i++)
     {
         for (int j = 0; j < this.ColumnNumber; j++)
         {
             string cellElement = this.GetCellElement(i, j);
             if ((cellElement.Length != 0) && (cellElement[0] == '='))
             {
                 ExpressionCalculator calculator = new ExpressionCalculator();
                 calculator.Init(cellElement.Substring(1));
                 for (int k = 0; k < calculator.ParamList.Count; k++)
                 {
                     string           str2  = calculator.ParamList.Keys[k];
                     MapTemplateParam param = base.MapTemplate.FindParamByName(str2);
                     if (param != null)
                     {
                         calculator.ParamList[str2] = param.Value;
                     }
                 }
                 object       obj2    = calculator.Calculate();
                 ITextElement element = (this.Element as ITableElement).GetCellElement(i, j) as ITextElement;
                 if (element != null)
                 {
                     element.Text = obj2.ToString();
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 public override void Init()
 {
     if (this.Text[0] == '=')
     {
         ExpressionCalculator calculator = new ExpressionCalculator();
         calculator.Init(this.Text.Substring(1));
         for (int i = 0; i < calculator.ParamList.Count; i++)
         {
             string           str   = calculator.ParamList.Keys[i];
             MapTemplateParam param = base.MapTemplate.FindParamByName(str);
             if (param != null)
             {
                 calculator.ParamList[str] = param.Value;
             }
         }
         object obj2 = calculator.Calculate();
         if (obj2 == null)
         {
             (base.m_pElement as ITextElement).Text = "";
         }
         else
         {
             string str2 = obj2.ToString();
             if (str2.Length == 0)
             {
                 str2 = " ";
             }
             this.Text = str2;
             (base.m_pElement as ITextElement).Text = obj2.ToString();
         }
     }
 }
Ejemplo n.º 3
0
 private void method_3()
 {
     for (int i = 0; i < this.MapTemplate.MapTemplateParam.Count; i++)
     {
         MapTemplateParam item = this.MapTemplate.MapTemplateParam[i];
         this.Fieldlist.Items.Add(item);
     }
     this.memEditWhereCaluse.Text = this.string_0;
 }