public ConsoleCategoryBuilder(ConsoleBackend parent, ModuleDeclaration module)
            {
                this.parent = parent;
                this.module = module;

                this.writeLineMessage = module.FindMethod(
                    module.Cache.GetType(typeof(System.Console)), "WriteLine",
                    method => method.Parameters.Count == 1 &&
                              IntrinsicTypeSignature.Is(method.Parameters[0].ParameterType, IntrinsicType.String));

                this.writeLineFormat1 = module.FindMethod(
                    module.Cache.GetType(typeof(System.Console)), "WriteLine",
                    method => method.Parameters.Count == 2 &&
                              IntrinsicTypeSignature.Is(method.Parameters[0].ParameterType, IntrinsicType.String) &&
                              IntrinsicTypeSignature.Is(method.Parameters[1].ParameterType, IntrinsicType.Object));

                this.writeLineFormat2 = module.FindMethod(
                    module.Cache.GetType(typeof(System.Console)), "WriteLine",
                    method => method.Parameters.Count == 3 &&
                              IntrinsicTypeSignature.Is(method.Parameters[0].ParameterType, IntrinsicType.String) &&
                              IntrinsicTypeSignature.Is(method.Parameters[1].ParameterType, IntrinsicType.Object) &&
                              IntrinsicTypeSignature.Is(method.Parameters[2].ParameterType, IntrinsicType.Object));

                this.writeLineFormat3 = module.FindMethod(
                    module.Cache.GetType(typeof(System.Console)), "WriteLine",
                    method => method.Parameters.Count == 4 &&
                              IntrinsicTypeSignature.Is(method.Parameters[0].ParameterType, IntrinsicType.String) &&
                              IntrinsicTypeSignature.Is(method.Parameters[1].ParameterType, IntrinsicType.Object) &&
                              IntrinsicTypeSignature.Is(method.Parameters[2].ParameterType, IntrinsicType.Object) &&
                              IntrinsicTypeSignature.Is(method.Parameters[3].ParameterType, IntrinsicType.Object));

                this.writeLineFormat4 = module.FindMethod(
                    module.Cache.GetType(typeof(System.Console)), "WriteLine",
                    method => method.Parameters.Count == 5 &&
                              IntrinsicTypeSignature.Is(method.Parameters[0].ParameterType, IntrinsicType.String) &&
                              IntrinsicTypeSignature.Is(method.Parameters[1].ParameterType, IntrinsicType.Object) &&
                              IntrinsicTypeSignature.Is(method.Parameters[2].ParameterType, IntrinsicType.Object) &&
                              IntrinsicTypeSignature.Is(method.Parameters[3].ParameterType, IntrinsicType.Object) &&
                              IntrinsicTypeSignature.Is(method.Parameters[4].ParameterType, IntrinsicType.Object));

                this.writeLineFormatArray = module.FindMethod(
                    module.Cache.GetType(typeof(System.Console)), "WriteLine",
                    method => method.Parameters.Count == 2 &&
                              IntrinsicTypeSignature.Is(method.Parameters[0].ParameterType, IntrinsicType.String) &&
                              method.Parameters[1].ParameterType.BelongsToClassification(TypeClassifications.Array));
            }
Ejemplo n.º 2
0
            public ConsoleCategoryBuilder(ConsoleBackend parent, ModuleDeclaration module)
            {
                this.parent = parent;
                this.module = module;

                this.writeLineMessage = module.FindMethod(
                    module.Cache.GetType(typeof(System.Console)), "WriteLine",
                    method => method.Parameters.Count == 1 &&
                    IntrinsicTypeSignature.Is(method.Parameters[0].ParameterType, IntrinsicType.String));

                this.writeLineFormat1 = module.FindMethod(
                    module.Cache.GetType(typeof(System.Console)), "WriteLine",
                    method => method.Parameters.Count == 2 &&
                    IntrinsicTypeSignature.Is(method.Parameters[0].ParameterType, IntrinsicType.String) &&
                    IntrinsicTypeSignature.Is(method.Parameters[1].ParameterType, IntrinsicType.Object));

                this.writeLineFormat2 = module.FindMethod(
                    module.Cache.GetType(typeof(System.Console)), "WriteLine",
                    method => method.Parameters.Count == 3 &&
                    IntrinsicTypeSignature.Is(method.Parameters[0].ParameterType, IntrinsicType.String) &&
                    IntrinsicTypeSignature.Is(method.Parameters[1].ParameterType, IntrinsicType.Object) &&
                    IntrinsicTypeSignature.Is(method.Parameters[2].ParameterType, IntrinsicType.Object));

                this.writeLineFormat3 = module.FindMethod(
                    module.Cache.GetType(typeof(System.Console)), "WriteLine",
                    method => method.Parameters.Count == 4 &&
                    IntrinsicTypeSignature.Is(method.Parameters[0].ParameterType, IntrinsicType.String) &&
                    IntrinsicTypeSignature.Is(method.Parameters[1].ParameterType, IntrinsicType.Object) &&
                    IntrinsicTypeSignature.Is(method.Parameters[2].ParameterType, IntrinsicType.Object) &&
                    IntrinsicTypeSignature.Is(method.Parameters[3].ParameterType, IntrinsicType.Object));

                this.writeLineFormat4 = module.FindMethod(
                    module.Cache.GetType(typeof(System.Console)), "WriteLine",
                    method => method.Parameters.Count == 5 &&
                    IntrinsicTypeSignature.Is(method.Parameters[0].ParameterType, IntrinsicType.String) &&
                    IntrinsicTypeSignature.Is(method.Parameters[1].ParameterType, IntrinsicType.Object) &&
                    IntrinsicTypeSignature.Is(method.Parameters[2].ParameterType, IntrinsicType.Object) &&
                    IntrinsicTypeSignature.Is(method.Parameters[3].ParameterType, IntrinsicType.Object) &&
                    IntrinsicTypeSignature.Is(method.Parameters[4].ParameterType, IntrinsicType.Object));

                this.writeLineFormatArray = module.FindMethod(
                    module.Cache.GetType(typeof(System.Console)), "WriteLine",
                    method => method.Parameters.Count == 2 &&
                    IntrinsicTypeSignature.Is(method.Parameters[0].ParameterType, IntrinsicType.String) &&
                    method.Parameters[1].ParameterType.BelongsToClassification(TypeClassifications.Array));
            }
 public ConsoleBackendInstance(ConsoleBackend parent, ModuleDeclaration module)
 {
     this.parent = parent;
     this.module = module;
 }
Ejemplo n.º 4
0
 public ConsoleBackendInstance(ConsoleBackend parent, ModuleDeclaration module)
 {
     this.parent = parent;
     this.module = module;
 }