Example #1
0
        public static void Main(string[] args)
        {
//			foreach (Assembly assy in AppDomain.CurrentDomain.GetAssemblies()) {
//				Console.WriteLine("---------------Assembly------------------");
//				//Console.WriteLine(assy.FullName);
//				AssemblyName name = assy.GetName();
//				Console.WriteLine(name.Name);
//				Console.WriteLine(name.CodeBase);
//				Console.WriteLine(name.FullName);
//				Console.WriteLine(name.Version.ToString());
//			}

            Logger.Debug("______________________________ Starting BootManager __________________________");
            BootManager boot = BootManager.Instance;

            boot.StartServices();
            Logger.Debug("______________________________ BootManager startup completed __________________________");

            Logger.Debug("______________________________ Starting Testing Program __________________________");

            Logger.Debug("++++++++++++++++++++++++ Database Test Case +++++++++++++++++++++++++++");
            DatabaseTest dbTest = new DatabaseTest();

            dbTest.TestDatabaseInit();
            dbTest.TestLoadDatabaseAndDriverConnect();
            dbTest.TestDatabaseDeleteQuery();
            dbTest.TestDatabaseInsertQuery();
            dbTest.TestDatabaseFindOneQuery();
            dbTest.TestDatabaseFindCount();
            dbTest.TestDatabaseFindQuery();
            dbTest.TestDatabaseParentChildInsertQuery();
            dbTest.TestDatabaseParentChildFindOneQuery();

            Logger.Debug("++++++++++++++++++++++++ Create Models Test Case +++++++++++++++++++++++++++");
            CreateModelsTest modelsTest = new CreateModelsTest();

            modelsTest.TestCreateModels();
            modelsTest.TestModelsRelationships();

            Logger.Debug("++++++++++++++++++++++++ Layouts Store Test Case +++++++++++++++++++++++++++");
            LayoutsStoreTest layoutTest = new LayoutsStoreTest();

            layoutTest.TestLoadLayouts();
            layoutTest.TestInstanceOfLayout();
            layoutTest.TestSelectLayout();

            Logger.Debug("++++++++++++++++++++++++ Flags Store Test Case +++++++++++++++++++++++++++");
            FlagsStoreTest flagTest = new FlagsStoreTest();

            flagTest.TestFlagProviderInitialize();
            flagTest.TestKeyRegistration();
            flagTest.TestKeyUnregister();

            Logger.Debug("______________________________ End Testing Program __________________________");
            Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
        }
Example #2
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.ProcessExit += SaveSystemState;
            Console.CancelKeyPress += SaveSystemState;

            // Run Boot Manager on system start
            BootManager bootManager = new BootManager();

            bootManager.Boot();
        }
Example #3
0
        private void StartButton_Click(object sender, RoutedEventArgs e)
        {
            var interruptController = new InterruptController();
            var ram         = new RandomAccessMemoryController(1 * 1024 * 1024);
            var bootManager = new BootManager(MainPage.BootImage());

            this.processor = new Processor();

            this.system = new SystemBusController()
            {
                Processor           = this.processor,
                InterruptController = interruptController
            };

            this.system.AddDevice(ram);
            this.system.AddDevice(bootManager);
            this.system.AddDevice(this.processor);
            this.system.AddDevice(interruptController);

            var stream = MainPage.DiskImage();

            stream.SetLength(8 * 1024 * 1024);
            this.system.AddDevice(new DiskDrive(stream));

            this.keyboard              = new Keyboard();
            this.InputTextBox.KeyDown += this.OnKeyDown;
            this.InputTextBox.KeyUp   += this.OnKeyUp;
            this.system.AddDevice(this.keyboard);

            this.display = new Display((ulong)this.ScreenImage.Width, (ulong)this.ScreenImage.Height);
            this.system.AddDevice(this.display);

            this.processor.DebugHandler = (a, b, c) => a.Value = (ulong)DateTime.UtcNow.Ticks;

            this.processor.BreakHandler = async() => await this.Dispatcher.InvokeTaskAsync(() => {
                this.BreakButton.IsEnabled    = false;
                this.ContinueButton.IsEnabled = true;
                this.StepButton.IsEnabled     = true;

                this.RefreshDebug();
            });

            this.system.Reset();

            this.RefreshDebug();

            this.StartButton.IsEnabled    = false;
            this.StopButton.IsEnabled     = true;
            this.BreakButton.IsEnabled    = false;
            this.ContinueButton.IsEnabled = true;
            this.StepButton.IsEnabled     = true;
            this.RefreshButton.IsEnabled  = true;
        }
Example #4
0
        public static void StartMIV(IGuiConsole g)
        {
            Console.WriteLine("Enter file's filename to open:");
            Console.WriteLine("If the specified file does not exist, it will be created.");

            file = Console.ReadLine();
            try
            {
                if (File.Exists(@"0:\" + file))
                {
                    Console.WriteLine("Found file!");
                }
                else if (!File.Exists(@"0:\" + file))
                {
                    Console.WriteLine("Creating file!");
                    File.Create(@"0:\" + file);
                }
                Console.Clear();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            string text;

            Console.WriteLine("Do you want to open " + file + " content? (Yes/No)");
            if (Console.ReadLine().ToLower() == "yes" || Console.ReadLine().ToLower() == "y")
            {
                text = miv(File.ReadAllText(@"0:\" + file));
            }
            else
            {
                text = miv(null);
            }

            Console.Clear();

            if (text != null)
            {
                File.WriteAllText(@"0:\" + file, text);
                Console.WriteLine("Content has been saved to " + file);
            }
            Console.WriteLine("Press any key to continue...");
            Console.ReadKey(true);
            if (g.term is Window)
            {
                MishaOS.Gui.DesktopManager.CloseWindow((g.term as Window));
            }

            BootManager.Boot();
        }
Example #5
0
        void Application_Start(object sender, EventArgs e)
        {
            // Code that runs on application startup
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            //Booting configuration modules
            var bootModules = DependencyResolver.Current.GetServices <IBootModule>()
                              .OrderByDescending(m => m.Priority);
            var bootManager = new BootManager(bootModules);

            bootManager.Boot();
        }
Example #6
0
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public IServiceProvider ConfigureServices(IServiceCollection services)
        {
            services.Configure <CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded    = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            services.AddSignalR();
            services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();
            services.AddReact(); //https://reactjs.net/getting-started/aspnetcore.html

            // Make sure a JS engine is registered, or you will get an error!
            services.AddJsEngineSwitcher(options => options.DefaultEngineName = ChakraCoreJsEngine.EngineName)
            .AddChakraCore();

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

            //Hangfire
            //TODO: Support RavenDB as well
            services.AddHangfire(config =>
            {
                config.UseSqlServerStorage(_configuration.GetConnectionString("StockTradingAnalysis_MSSQL"));
                config.UseLog4NetLogProvider();
            });

            //DI configuration
            new BindingModulesManager(services).Load();

            var serviceProvider = services.BuildServiceProvider();

            DependencyResolver.Init(new ServiceProviderWrapper(serviceProvider));

            //Booting configuration modules
            var bootModules = serviceProvider.GetServices <IBootModule>().OrderByDescending(m => m.Priority);
            var bootManager = new BootManager(bootModules);

            bootManager.Boot();

            return(serviceProvider);
        }
Example #7
0
 /// <summary>
 /// Boots the specified boot manager. This method can be overriden if implementors wish to modify the environment prior to Rebel booting and building its dependency containers.
 /// </summary>
 /// <param name="bootManager">The boot manager.</param>
 protected virtual IRebelApplicationContext Boot(BootManager bootManager)
 {
     return(bootManager.Boot());
 }
Example #8
0
 public static void Startup()
 {
     BootManager.Startup();
 }