Ejemplo n.º 1
0
        private static IMethod BindEnvironmentHandleFatalExceptionMethod(
            IBinder Binder)
        {
            var envType = Binder.BindType(new SimpleName("Environment").Qualify("System"));

            if (envType == null)
            {
                return(null);
            }

            var     name   = new SimpleName("HandleFatalException");
            IMethod result = null;

            foreach (var item in envType.Methods)
            {
                if (item.IsStatic &&
                    !item.IsConstructor &&
                    item.Name.Equals(name) &&
                    item.Parameters.Count <IParameter>() == 1)
                {
                    result = item;
                }
            }

            return(result);
        }
Ejemplo n.º 2
0
        private static IMethod BindEnvironmentInitializeMethod(
            IBinder Binder, IMethod MainThunk)
        {
            var envType = Binder.BindType(new SimpleName("Environment").Qualify("System"));

            if (envType == null)
            {
                return(null);
            }

            return(envType.GetMethod(
                       new SimpleName("Initialize"),
                       true,
                       PrimitiveTypes.String.MakeArrayType(1),
                       GetParameterTypes(MainThunk)));
        }