Esempio n. 1
0
 public void InitializePresenter(dynamic context)
 {
     _context           = context;
     _view              = (IPreferencesForm)context.PreferencesForm;
     _view.Presenter    = this;
     _mainFormPresenter = (IMainFormPresenter)context.MainFormPresenter;
 }
Esempio n. 2
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;
        }
Esempio n. 3
0
        private static void Main()
        {
            if (!AppMutex.WaitOne(TimeSpan.Zero, true))
            {
                return;
            }

            string[] args = Environment.GetCommandLineArgs();
            isIncognitoMode = args.Length == 2 && args[1].Contains("incognito");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var container = new Container();

            container.Register <IMainForm, MainForm>().AsSingleton();
            container.Register <IMainFormPresenter, MainFormPresenter>().AsSingleton();
            container.Register <IIoManager, IoManager>().AsSingleton();

            presenter = container.Resolve <IMainFormPresenter>();
            presenter.CloseRequested += Presenter_CloseRequested;

            Application.Idle += Application_Idle;
            if (isIncognitoMode)
            {
                Application.Run();
            }
            else
            {
                Application.Run(container.Resolve <IMainForm>() as Form);
            }

            CloseApplication();
        }
Esempio n. 4
0
        public MainForm()
        {
            InitializeComponent();

            IMainFormService service = ObjectRegistry.GetRegisteredObject <IMainFormService>();

            presenter = ObjectRegistry.GetRegisteredObject <IMainFormPresenter>(this, service);
            presenter.Initialize();
        }
Esempio n. 5
0
 /// <summary>
 /// initialize
 /// </summary>
 void Initialize()
 {
     //this.TopMost = true;
     this.FormClosed += new FormClosedEventHandler(MainForm_FormClosed);
     this.Load       += new EventHandler(MainForm_Load);
     //this.Activated += new EventHandler(MainForm_Activated);
     this.tmTaskTimer.Tick += new EventHandler(tmSysTime_Tick);
     this.m_presenter       = new MainFormPresenter(this);
 }
Esempio n. 6
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            DIC.RegisterDependencies();
            IMainFormPresenter mainFormPresenter = DIC.GetInstance <IMainFormPresenter>();

            Application.Run(mainFormPresenter.GetView() as Form1);
        }
Esempio n. 7
0
        public MainForm(
            IMainFormPresenter presenter,
            IIoManager ioManager)
        {
            if (presenter == null)
            {
                throw new ArgumentNullException("presenter");
            }
            if (ioManager == null)
            {
                throw new ArgumentNullException("ioManager");
            }
            this.presenter = presenter;
            this.ioManager = ioManager;

            presenter.SetView(this);

            InitializeComponent();
        }
Esempio n. 8
0
        private static void Main()
        {
            if (!AppMutex.WaitOne(TimeSpan.Zero, true))
            {
                return;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var container = new Container();

            container.Register <IMainForm, MainForm>().AsSingleton();
            container.Register <IMainFormPresenter, MainFormPresenter>().AsSingleton();
            container.Register <IIoManager, IoManager>().AsSingleton();

            presenter = container.Resolve <IMainFormPresenter>();
            presenter.CloseRequested += Presenter_CloseRequested;

            Application.Idle += Application_Idle;
            Application.Run(container.Resolve <IMainForm>() as Form);

            CloseApplication();
        }
Esempio n. 9
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);
            }
        }
 public ThumbnailListUpdatedHandler(MainFormPresenter presenter)
 {
     this._presenter = presenter;
 }
Esempio n. 11
0
 public void SetPresenter(IMainFormPresenter presenter)
 {
     Presenter = presenter;
     Debug.Print("New presenter set" + presenter.GetType());
 }
Esempio n. 12
0
 public ThumbnailActiveSizeUpdatedHandler(MainFormPresenter presenter)
 {
     this._presenter = presenter;
 }