public void InitializePresenter(dynamic context) { _context = context; _view = (IPreferencesForm)context.PreferencesForm; _view.Presenter = this; _mainFormPresenter = (IMainFormPresenter)context.MainFormPresenter; }
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; }
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(); }
public MainForm() { InitializeComponent(); IMainFormService service = ObjectRegistry.GetRegisteredObject <IMainFormService>(); presenter = ObjectRegistry.GetRegisteredObject <IMainFormPresenter>(this, service); presenter.Initialize(); }
/// <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); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DIC.RegisterDependencies(); IMainFormPresenter mainFormPresenter = DIC.GetInstance <IMainFormPresenter>(); Application.Run(mainFormPresenter.GetView() as Form1); }
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(); }
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(); }
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; }
public void SetPresenter(IMainFormPresenter presenter) { Presenter = presenter; Debug.Print("New presenter set" + presenter.GetType()); }
public ThumbnailActiveSizeUpdatedHandler(MainFormPresenter presenter) { this._presenter = presenter; }