EvaluateStaticVariableInitializers() private method

private EvaluateStaticVariableInitializers ( ) : void
return void
Ejemplo n.º 1
0
        internal void EvaluateStaticVariableInitializers()
        {
            int num   = 0;
            int count = this.list.Count;

            while (num < count)
            {
                object obj2 = this.list[num];
                VariableDeclaration declaration = obj2 as VariableDeclaration;
                if (((declaration != null) && declaration.field.IsStatic) && !declaration.field.IsLiteral)
                {
                    declaration.Evaluate();
                }
                else
                {
                    StaticInitializer initializer = obj2 as StaticInitializer;
                    if (initializer != null)
                    {
                        initializer.Evaluate();
                    }
                    else
                    {
                        Class class2 = obj2 as Class;
                        if (class2 != null)
                        {
                            class2.Evaluate();
                        }
                        else
                        {
                            Constant constant = obj2 as Constant;
                            if ((constant != null) && constant.field.IsStatic)
                            {
                                constant.Evaluate();
                            }
                            else
                            {
                                Block block = obj2 as Block;
                                if (block != null)
                                {
                                    block.EvaluateStaticVariableInitializers();
                                }
                            }
                        }
                    }
                }
                num++;
            }
        }
Ejemplo n.º 2
0
 internal void EvaluateStaticVariableInitializers()
 {
     for (int i = 0, n = this.list.Count; i < n; i++)
     {
         Object elem = this.list[i];
         VariableDeclaration vard = elem as VariableDeclaration;
         if (vard != null && vard.field.IsStatic && !vard.field.IsLiteral)
         {
             vard.Evaluate();
             continue;
         }
         StaticInitializer sinit = elem as StaticInitializer;
         if (sinit != null)
         {
             sinit.Evaluate();
             continue;
         }
         Class cl = elem as Class;
         if (cl != null)
         {
             cl.Evaluate();
             continue;
         }
         Constant cnst = elem as Constant;
         if (cnst != null && cnst.field.IsStatic)
         {
             cnst.Evaluate();
             continue;
         }
         Block block = elem as Block;
         if (block != null)
         {
             block.EvaluateStaticVariableInitializers();
         }
     }
 }