private void StartUserInterface() { try { _project.AddToContainer( b => b.Register <StatusBarController>( container => { var controller = new StatusBarController(container.Resolve <ICountGiver>()); controller.ShowConfigLauncher = _commandLineArguments.launchedByConfigTool; return(controller); })); _project.AddToContainer(b => b.RegisterType <TabbedForm>()); _tabbedForm = _project.Container.Resolve <TabbedForm>(); _tabbedForm.Show(); // so the user sees that we did launch var versionString = BasilProject.VersionString; var title = StringCatalog.Get("~WeSay", "It's up to you whether to bother translating this or not."); if (title != "WeSay") { _tabbedForm.Font = (System.Drawing.Font)StringCatalog.LabelFont.Clone(); } _tabbedForm.Text = String.Format( "{0} {1}: {2}", title, versionString, _project.Name ); Application.DoEvents(); //todo: this is what we're supposed to use the autofac "modules" for //couldn't get this to work: _project.AddToContainer(typeof(ICurrentWorkTask), _tabbedForm as ICurrentWorkTask); _project.AddToContainer(b => b.RegisterInstance <ICurrentWorkTask>(_tabbedForm)); _project.AddToContainer(b => b.RegisterInstance(_tabbedForm.StatusStrip)); _project.AddToContainer( b => b.RegisterInstance( TaskMemoryRepository.CreateOrLoadTaskMemoryRepository( _project.Name, _project.PathToWeSaySpecificFilesDirectoryInProject))); _project.LoadTasksFromConfigFile(); Application.DoEvents(); _tabbedForm.ContinueLaunchingAfterInitialDisplay(); _tabbedForm.Activate(); _tabbedForm.BringToFront(); //needed if we were previously in server mode #if (!__MonoCS__) if (WeSayWordsProject.GeckoOption) { // Currently with Gecko 29 on Windows systems, the browser objects do // not size properly without this process at startup _tabbedForm.WindowState = FormWindowState.Minimized; _tabbedForm.WindowState = FormWindowState.Maximized; } #endif RtfRenderer.HeadWordWritingSystemId = _project.DefaultViewTemplate.HeadwordWritingSystem.Id; HtmlRenderer.HeadWordWritingSystemId = _project.DefaultViewTemplate.HeadwordWritingSystem.Id; #if __MonoCS__ UglyHackForXkbIndicator(); #endif //run the ui Application.Run(_tabbedForm); Settings.Default.SkinName = DisplaySettings.Default.SkinName; } catch (IOException e) { ErrorReport.NotifyUserOfProblem(e.Message); } }
private void StartUserInterface() { try { _tabbedForm = new TabbedForm(); _tabbedForm.Show(); // so the user sees that we did launch _tabbedForm.Text = StringCatalog.Get("~WeSay", "It's up to you whether to bother translating this or not.") + ": " + _project.Name + " " + ErrorReport.UserFriendlyVersionString; Application.DoEvents(); //couldn't get this to work: _project.AddToContainer(typeof(ICurrentWorkTask), _tabbedForm as ICurrentWorkTask); _project.AddToContainer(b => b.Register<ICurrentWorkTask>(_tabbedForm)); _project.LoadTasksFromConfigFile(); Application.DoEvents(); _tabbedForm.IntializationComplete += OnTabbedForm_IntializationComplete; _tabbedForm.ContinueLaunchingAfterInitialDisplay(); _tabbedForm.Activate(); _tabbedForm.BringToFront(); //needed if we were previously in server mode RtfRenderer.HeadWordWritingSystemId = _project.DefaultViewTemplate.HeadwordWritingSystem.Id; //run the ui Application.Run(_tabbedForm); Settings.Default.SkinName = DisplaySettings.Default.SkinName; } catch (IOException e) { ErrorReport.ReportNonFatalMessage(e.Message); } }