Exemplo n.º 1
0
        /// <summary>
        /// Prevents a default instance of the <see cref="MainViewModel" /> class from being created.
        /// </summary>
        private MainViewModel()
        {
            OutputViewModel.GetInstance().Log(OutputViewModel.LogLevel.Info, "Squalr started");
            OutputViewModel.GetInstance().AddOutputMask(new OutputMask(MainViewModel.AccessTokenRegex, "access_token={{REDACTED}}"));


            this.DisplayChangeLogCommand = new RelayCommand(() => ChangeLogViewModel.GetInstance().DisplayChangeLog(new Content.ChangeLog().TransformText()), () => true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Prevents a default instance of the <see cref="MainViewModel" /> class from being created.
        /// </summary>
        private MainViewModel() : base()
        {
            // Attach the logger view model to the engine's output
            Logger.Subscribe(OutputViewModel.GetInstance());

            ApplicationUpdater.UpdateApp();

            Squalr.Engine.Projects.Compiler.Compile(true);

            if (Vectors.HasVectorSupport)
            {
                Logger.Log(LogLevel.Info, "Hardware acceleration enabled");
                Logger.Log(LogLevel.Info, "Vector size: " + Vector <Byte> .Count);
            }

            Logger.Log(LogLevel.Info, "Squalr started");

            this.DisplayChangeLogCommand = new RelayCommand(() => ChangeLogViewModel.GetInstance().DisplayChangeLog(new Content.ChangeLog().TransformText()), () => true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Prevents a default instance of the <see cref="MainViewModel" /> class from being created.
        /// </summary>
        private MainViewModel()
        {
            OutputViewModel.GetInstance().Log(OutputViewModel.LogLevel.Info, "Squalr started");
            OutputViewModel.GetInstance().AddOutputMask(new OutputMask(MainViewModel.AccessTokenRegex, "access_token={{REDACTED}}"));

            // Note: These cannot be async, as the logic to update the layout or window cannot be on a new thread
            this.DisplayChangeLogCommand = new RelayCommand(() => ChangeLogViewModel.GetInstance().DisplayChangeLog(), () => true);
            this.CloseCommand            = new RelayCommand <Window>((window) => this.Close(window), (window) => true);
            this.MaximizeRestoreCommand  = new RelayCommand <Window>((window) => this.MaximizeRestore(window), (window) => true);
            this.MinimizeCommand         = new RelayCommand <Window>((window) => this.Minimize(window), (window) => true);

            this.ResetLayoutCommand = new RelayCommand <DockingManager>((dockingManager)
                                                                        => DockingViewModel.GetInstance().LoadLayoutFromResource(dockingManager, MainViewModel.DefaultLayoutResource), (dockingManager) => true);
            this.LoadLayoutCommand = new RelayCommand <DockingManager>((dockingManager)
                                                                       => DockingViewModel.GetInstance().LoadLayoutFromFile(dockingManager, MainViewModel.LayoutSaveFile, MainViewModel.DefaultLayoutResource), (dockingManager) => true);
            this.SaveLayoutCommand = new RelayCommand <DockingManager>((dockingManager)
                                                                       => DockingViewModel.GetInstance().SaveLayout(dockingManager, MainViewModel.LayoutSaveFile), (dockingManager) => true);

            this.LaunchDeveloperToolsCommand        = new RelayCommand(() => this.LaunchDeveloperTools(asAdmin: false), () => true);
            this.LaunchDeveloperToolsAsAdminCommand = new RelayCommand(() => this.LaunchDeveloperTools(asAdmin: true), () => true);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Prevents a default instance of the <see cref="MainViewModel" /> class from being created.
        /// </summary>
        private MainViewModel() : base()
        {
            /*
             * using (UpdateManager manager = new UpdateManager("C:\\Projects\\MyApp\\Releases"))
             * {
             *  ReleaseEntry result = manager.UpdateApp().Result;
             * }*/

            // Attach our view model to the engine's output
            Logger.Subscribe(OutputViewModel.GetInstance());

            if (Vectors.HasVectorSupport)
            {
                Logger.Log(LogLevel.Info, "Hardware acceleration enabled");
                Logger.Log(LogLevel.Info, "Vector size: " + System.Numerics.Vector <Byte> .Count);
            }


            Logger.Log(LogLevel.Info, "Squalr developer tools started");

            this.DisplayChangeLogCommand = new RelayCommand(() => ChangeLogViewModel.GetInstance().DisplayChangeLog(new Content.ChangeLog().TransformText()), () => true);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Prevents a default instance of the <see cref="MainViewModel" /> class from being created.
        /// </summary>
        private MainViewModel() : base()
        {
            OutputViewModel.GetInstance().Log(OutputViewModel.LogLevel.Info, "Squalr developer tools started");

            this.DisplayChangeLogCommand = new RelayCommand(() => ChangeLogViewModel.GetInstance().DisplayChangeLog(new Content.ChangeLog().TransformText()), () => true);
        }