Пример #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);
        }
Пример #2
0
        public async Task <ActionResult <ChangeLogViewModel> > Get(int id)
        {
            var changeLog = await changeLogSystemRepository.Get(id);

            if (changeLog != null)
            {
                ChangeLogViewModel result = changeLog;
                return(Ok(result));
            }
            else
            {
                return(NotFound());
            }
        }
Пример #3
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);
        }
Пример #4
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);
        }
Пример #5
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);
        }
Пример #6
0
        public ActionResult ChangeLog(int?log_from_day, int?log_from_month, int?log_from_year, int?log_to_day, int?log_to_month, int?log_to_year)
        {
            var changelogs = repository.GetChangeLogs();

            if (log_from_day.HasValue && log_from_month.HasValue && log_from_year.HasValue)
            {
                var from = new DateTime(log_from_year.Value, log_from_month.Value, log_from_day.Value);
                changelogs = changelogs.Where(x => x.created > from);
            }

            if (log_to_day.HasValue && log_to_month.HasValue && log_to_year.HasValue)
            {
                var to = new DateTime(log_to_year.Value, log_to_month.Value, log_to_day.Value);
                changelogs = changelogs.Where(x => x.created < to);
            }

            var viewmodel = new ChangeLogViewModel()
            {
                changelogs = changelogs.OrderByDescending(x => x.id).Take(50).ToModel(),
                total      = changelogs.Count()
            };

            return(View(viewmodel));
        }
Пример #7
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);
        }
Пример #8
0
 public LiquibaseAddView()
 {
     InitializeComponent();
     DataContext = new ChangeLogViewModel();
 }