Boo.Lang.Compiler.Steps.ProcessMethodBodies.GetInitializerFor C# (CSharp) Метод

GetInitializerFor() приватный Метод

private GetInitializerFor ( Boo.Lang.Compiler.Ast.TypeDefinition type, bool isStatic ) : Method
type Boo.Lang.Compiler.Ast.TypeDefinition
isStatic bool
Результат Boo.Lang.Compiler.Ast.Method
        private Method GetInitializerFor(TypeDefinition type, bool isStatic)
        {
            string methodName = isStatic ? "$static_initializer$" : "$initializer$";
            Method method = (Method)type[methodName];
            if (null == method)
            {
                if (isStatic)
                {
                    if (!type.HasStaticConstructor)
                    {
                        // when the class doesnt have a static constructor
                        // yet, create one and use it as the static
                        // field initializer method
                        method = CodeBuilder.CreateStaticConstructor(type);
                    }
                    else
                    {
                        method = CreateInitializerMethod(type, methodName, TypeMemberModifiers.Static);
                        AddInitializerToStaticConstructor(type, (InternalMethod)method.Entity);
                    }
                }
                else
                {
                    method = CreateInitializerMethod(type, methodName, TypeMemberModifiers.None);
                }
                type[methodName] = method;
            }
            return method;
        }
ProcessMethodBodies