Пример #1
0
        public bool IsAvailable(Type tool)
        {
            if (!ServiceInjector.IsAvailable(Global.Emulator.ServiceProvider, tool) ||
                !lazyAsmTypes.Value.Contains(tool.AssemblyQualifiedName) ||                 // not a tool
                (tool == typeof(LuaConsole) && OSTailoredCode.CurrentOS != OSTailoredCode.DistinctOS.Windows))                    // simply doesn't work (for now)
            {
                return(false);
            }

            ToolAttribute attr = tool.GetCustomAttributes(false).OfType <ToolAttribute>().SingleOrDefault();

            if (attr == null)
            {
                return(true);                // no ToolAttribute on given type -> assumed all supported
            }

            var sysName = Global.Emulator.DisplayName();

            return(!attr.UnsupportedCores.Contains(sysName) &&          // not unsupported
                   (!attr.SupportedSystems.Any() || attr.SupportedSystems.Contains(sysName)));                // supported (no supported list -> assumed all supported)
        }
Пример #2
0
        public bool IsAvailable(Type tool)
        {
            if (!ServiceInjector.IsAvailable(Global.Emulator.ServiceProvider, tool) ||
                !lazyAsmTypes.Value.Contains(tool.AssemblyQualifiedName))                    // not a tool
            {
                return(false);
            }

            ToolAttribute attr = tool.GetCustomAttributes(false).OfType <ToolAttribute>().SingleOrDefault();

            if (attr == null)
            {
                return(true);                // no ToolAttribute on given type -> assumed all supported
            }

            var displayName = Global.Emulator.DisplayName();
            var systemId    = Global.Emulator.SystemId;

            return(!attr.UnsupportedCores.Contains(displayName) &&          // not unsupported
                   (!attr.SupportedSystems.Any() || attr.SupportedSystems.Contains(systemId)));                // supported (no supported list -> assumed all supported)
        }