Example #1
0
        public void Cycle()
        {
            var platformProvider = new PlatformsProvider();

            var platformFactory = platformProvider.Platforms.FirstOrDefault(
                x => x.PlatformType == MockPlatformFactory.MockPlatform &&
                x.ToolchainType == MockPlatformFactory.MockToolchain &&
                x.ArchitectureType == ArchitectureType.X64);

            var profile = Profile.Parse("{}");

            var platform = platformFactory.CreatePlatform(profile);

            var toolchain = platformFactory.CreateToolchain(profile);

            var targetTuple = new TargetTuple(
                platformFactory.PlatformType,
                platformFactory.ArchitectureType,
                platformFactory.ToolchainType,
                ConfigurationType.Debug,
                ConfigurationFlavour.None);

            var solution = new SampleSolution();

            var resolved = new ResolvedSolution(solution, targetTuple);

            Assert.ThrowsException <ResolvingException>(() =>
            {
                resolved.Configure();

                resolved.Resolve();
            });
        }
 public override void PrintHelp(ICommandInteraction writer)
 {
     base.PrintHelp(writer);
     writer.WriteLine("\nOptions:");
     writer.WriteLine("===========================");
     foreach (var item in PlatformsProvider.GetAvailablePlatforms().OrderBy(x => x.Name))
     {
         writer.WriteLine(item.Name);
     }
 }
        private void Execute(ICommandInteraction writer, string type, string name)
        {
            var platform = PlatformsProvider.GetPlatformByName(type);

            if (platform == null)
            {
                writer.WriteError("Invalid platform type: " + type);
                return;
            }

            var mach = new Machine()
            {
                Platform = platform
            };

            EmulationManager.Instance.CurrentEmulation.AddMachine(mach, name);
            changeCurrentMachine(mach);
            monitor.TryExecuteScript(platform.ScriptPath);
        }
 public string[] ProvideSuggestions(string prefix)
 {
     return(PlatformsProvider.GetAvailablePlatforms().Where(p => p.Name.StartsWith(prefix)).Select(p => p.Name).ToArray());
 }