Exemplo n.º 1
0
        public MainForm(IFormOpener formManager, IMainFormPresenter presenter, MainFormStyler mainFormStyler, IPubSub pubsub, IPropertiesRepository propertiesRepository)
        {
            InitializeComponent();

            _mainFormStyler = mainFormStyler;
            _pubsub         = pubsub;
            RenderTheme();
            if (propertiesRepository.GetValue <bool>(Constants.AppProperties.UpdateSettings))
            {
                propertiesRepository.Upgrade();
                propertiesRepository.SetValue(Constants.AppProperties.UpdateSettings, false);
                propertiesRepository.Save();
            }

            _formManager = formManager;
            presenter.InitializePresenter(new
            {
                MainForm = this,
                PubSub   = _pubsub
            });

            var selectedPath = propertiesRepository.GetValue <string>(Constants.AppProperties.SelectedPath);

            if (!string.IsNullOrEmpty(selectedPath))
            {
                Presenter.PopulateTreeView(selectedPath);
            }

            _propertiesRepository = propertiesRepository;
        }
Exemplo n.º 2
0
        public MainForm(IFormOpener formManager, IMainFormPresenter presenter, MainFormStyler mainFormStyler)
        {
            InitializeComponent();

            mainFormStyler.ApplyTheme(ThemeType.Dark, this);

            if (Properties.Settings.Default.UpdateSettings)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.UpdateSettings = false;
                Properties.Settings.Default.Save();
            }

            _formManager = formManager;
            presenter.InitializePresenter(new
            {
                MainForm = this
            });

            if (!string.IsNullOrEmpty(Properties.Settings.Default.SelectedPath))
            {
                Presenter.PopulateTreeView(Properties.Settings.Default.SelectedPath);
            }
        }