Beispiel #1
0
        private static void smethod_4()
        {
            Class232 @class = new Class232();

            while (Hotkeys.PeekMessage(out @class.msg_0, IntPtr.Zero, 786u, 786u, 1u))
            {
                IEnumerable <Hotkey> registeredHotkeys = Hotkeys.RegisteredHotkeys;
                Func <Hotkey, bool>  predicate;
                if ((predicate = @class.func_0) == null)
                {
                    predicate = (@class.func_0 = new Func <Hotkey, bool>(@class.method_0));
                }
                Hotkey hotkey = registeredHotkeys.FirstOrDefault(predicate);
                if (hotkey != null)
                {
                    //Hotkeys.ilog_0.DebugFormat(hotkey.Name + " pressed.", Array.Empty<object>());
                    hotkey.Callback(hotkey);
                }
            }
        }
 public abstract void Visit(Class232 c);
 public override void Visit(Class232 c) { }
Beispiel #4
0
        private void method_0(Assembly assembly_0)
        {
            if (this.IncludeGacAssemblies || !assembly_0.GlobalAssemblyCache)
            {
                System.Type[] types = assembly_0.GetTypes();
                for (int i = 0; i < types.Length; i++)
                {
                    Class232 <T> class2 = new Class232 <T> {
                        type_0 = types[i]
                    };
                    if ((class2.type_0.IsClass && !this.Any <T>(new Func <T, bool>(class2.method_0))) && !class2.type_0.GetCustomAttributes(typeof(TypeFinderIgnoredAttribute)).Any <Attribute>())
                    {
                        if (this.Type.IsInterface)
                        {
                            if (class2.type_0.GetInterfaces().Any <System.Type>(new Func <System.Type, bool>(this.method_2)))
                            {
                                TypeFinder <T> .ilog_0.Debug("Type " + class2.type_0.Name + " implements interface " + this.Type.Name);

                                try
                                {
                                    this.InstanceTypes.Add(class2.type_0);
                                    if (this.CreateInstances)
                                    {
                                        base.Add((T)Activator.CreateInstance(class2.type_0));
                                    }
                                }
                                catch (MissingMethodException exception)
                                {
                                    TypeFinder <T> .ilog_0.Error("Could not instantiate class " + class2.type_0 + ". It does not have a public, parameterless constructor.");

                                    TypeFinder <T> .ilog_0.Error(exception);
                                }
                                catch (Exception exception2)
                                {
                                    TypeFinder <T> .ilog_0.Error("Exception instantiating type " + class2.type_0);

                                    TypeFinder <T> .ilog_0.Error(exception2);
                                }
                            }
                        }
                        else if (class2.type_0.IsSubclassOf(this.Type))
                        {
                            TypeFinder <T> .ilog_0.Debug("Type " + class2.type_0.Name + " inherits class " + this.Type.Name);

                            try
                            {
                                this.InstanceTypes.Add(class2.type_0);
                                if (this.CreateInstances)
                                {
                                    base.Add((T)Activator.CreateInstance(class2.type_0));
                                }
                            }
                            catch (MissingMethodException exception3)
                            {
                                TypeFinder <T> .ilog_0.Error("Could not instantiate class " + class2.type_0 + ". It does not have a public, parameterless constructor.");

                                TypeFinder <T> .ilog_0.Error(exception3);
                            }
                            catch (Exception exception4)
                            {
                                TypeFinder <T> .ilog_0.Error("Exception instantiating type " + class2.type_0);

                                TypeFinder <T> .ilog_0.Error(exception4);
                            }
                        }
                    }
                }
            }
        }