public static void Main(string[] args) { //Style.Add<ButtonToolItemHandler>("icons", h => h.Widget.Image.); //Style.Add<ButtonHandler>("icons", h => h.Widget.Image.); EtoAppHost.ConfigureBootstrap(false); AppHost.CheckPortable(args); Logger.Init(AppHost.GetLogFilename()); LogSysInfo(); var application = new Application(Platforms.Wpf); AppHost.InitSettings(); try { var appHost = (EtoAppHost)AppHost.Instance; appHost.Init(args, false); application.Run(); } finally { AppHost.DoneSettings(); } }
/// <summary> /// This function implements initialization of IoC-container for WinForms presentation. /// </summary> public static void ConfigureBootstrap(bool mdi) { if (mdi) { throw new ArgumentException("MDI obsolete"); } var appHost = new EtoAppHost(); IContainer container = AppHost.Container; if (container == null) { throw new ArgumentNullException("container"); } container.Reset(); // controls and other container.Register <IStdDialogs, EtoStdDialogs>(LifeCycle.Singleton); container.Register <IGraphicsProviderEx, EtoGfxProvider>(LifeCycle.Singleton); container.Register <IProgressController, ProgressController>(LifeCycle.Singleton); container.Register <ITreeChart, TreeChartBox>(LifeCycle.Transient); // dialogs container.Register <IAboutDlg, AboutDlg>(LifeCycle.Transient); container.Register <IAddressEditDlg, AddressEditDlg>(LifeCycle.Transient); container.Register <IAssociationEditDlg, AssociationEditDlg>(LifeCycle.Transient); container.Register <IBaseWindow, BaseWinSDI>(LifeCycle.Transient); container.Register <ICircleChartWin, CircleChartWin>(LifeCycle.Transient); container.Register <ICommunicationEditDlg, CommunicationEditDlg>(LifeCycle.Transient); container.Register <ICommonFilterDlg, CommonFilterDlg>(LifeCycle.Transient); container.Register <IDayTipsDlg, DayTipsDlg>(LifeCycle.Transient); container.Register <IEventEditDlg, EventEditDlg>(LifeCycle.Transient); container.Register <IFamilyEditDlg, FamilyEditDlg>(LifeCycle.Transient); container.Register <IFilePropertiesDlg, FilePropertiesDlg>(LifeCycle.Transient); container.Register <IFragmentSearchDlg, TTFamilyGroupsDlg>(LifeCycle.Transient); container.Register <IGroupEditDlg, GroupEditDlg>(LifeCycle.Transient); container.Register <ILanguageEditDlg, LanguageEditDlg>(LifeCycle.Transient); container.Register <ILanguageSelectDlg, LanguageSelectDlg>(LifeCycle.Transient); container.Register <ILocationEditDlg, LocationEditDlg>(LifeCycle.Transient); container.Register <IMapsViewerWin, MapsViewerWin>(LifeCycle.Transient); container.Register <IMediaEditDlg, MediaEditDlg>(LifeCycle.Transient); container.Register <INameEditDlg, NameEditDlg>(LifeCycle.Transient); container.Register <INoteEditDlg, NoteEditDlg>(LifeCycle.Transient); container.Register <INoteEditDlgEx, NoteEditDlgEx>(LifeCycle.Transient); container.Register <IOptionsDlg, OptionsDlg>(LifeCycle.Transient); container.Register <IOrganizerWin, OrganizerWin>(LifeCycle.Transient); container.Register <IParentsEditDlg, ParentsEditDlg>(LifeCycle.Transient); container.Register <IPatriarchsSearchDlg, TTPatSearchDlg>(LifeCycle.Transient); container.Register <IPatriarchsViewer, PatriarchsViewerWin>(LifeCycle.Transient); container.Register <IPersonsFilterDlg, PersonsFilterDlg>(LifeCycle.Transient); container.Register <IPlacesManagerDlg, TTPlacesManagerDlg>(LifeCycle.Transient); container.Register <IPersonalNameEditDlg, PersonalNameEditDlg>(LifeCycle.Transient); container.Register <IPersonEditDlg, PersonEditDlg>(LifeCycle.Transient); container.Register <IPortraitSelectDlg, PortraitSelectDlg>(LifeCycle.Transient); container.Register <IRecMergeDlg, TTRecMergeDlg>(LifeCycle.Transient); container.Register <IRecordSelectDialog, RecordSelectDlg>(LifeCycle.Transient); container.Register <IRelationshipCalculatorDlg, RelationshipCalculatorDlg>(LifeCycle.Transient); container.Register <IRepositoryEditDlg, RepositoryEditDlg>(LifeCycle.Transient); container.Register <IResearchEditDlg, ResearchEditDlg>(LifeCycle.Transient); container.Register <ISexCheckDlg, SexCheckDlg>(LifeCycle.Transient); container.Register <ISourceCitEditDlg, SourceCitEditDlg>(LifeCycle.Transient); container.Register <ISourceEditDlg, SourceEditDlg>(LifeCycle.Transient); container.Register <IScriptEditWin, ScriptEditWin>(LifeCycle.Transient); container.Register <ISlideshowWin, SlideshowWin>(LifeCycle.Transient); container.Register <IStatisticsWin, StatisticsWin>(LifeCycle.Transient); container.Register <ITaskEditDlg, TaskEditDlg>(LifeCycle.Transient); container.Register <ITreeChartWin, TreeChartWin>(LifeCycle.Transient); container.Register <ITreeCheckDlg, TTTreeCheckDlg>(LifeCycle.Transient); container.Register <ITreeCompareDlg, TTTreeCompareDlg>(LifeCycle.Transient); container.Register <ITreeFilterDlg, TreeFilterDlg>(LifeCycle.Transient); container.Register <ITreeMergeDlg, TTTreeMergeDlg>(LifeCycle.Transient); container.Register <ITreeSplitDlg, TTTreeSplitDlg>(LifeCycle.Transient); container.Register <IUserRefEditDlg, UserRefEditDlg>(LifeCycle.Transient); container.Register <IRecordInfoDlg, RecordInfoDlg>(LifeCycle.Transient); ControlsManager.RegisterHandlerType(typeof(Button), typeof(ButtonHandler)); ControlsManager.RegisterHandlerType(typeof(CheckBox), typeof(CheckBoxHandler)); ControlsManager.RegisterHandlerType(typeof(ComboBox), typeof(ComboBoxHandler)); ControlsManager.RegisterHandlerType(typeof(GKComboBox), typeof(ComboBoxHandler)); ControlsManager.RegisterHandlerType(typeof(Label), typeof(LabelHandler)); ControlsManager.RegisterHandlerType(typeof(LogChart), typeof(LogChartHandler)); ControlsManager.RegisterHandlerType(typeof(MaskedTextBox), typeof(MaskedTextBoxHandler)); ControlsManager.RegisterHandlerType(typeof(GKDateBox), typeof(DateBoxHandler)); ControlsManager.RegisterHandlerType(typeof(NumericUpDown), typeof(NumericBoxHandler)); ControlsManager.RegisterHandlerType(typeof(ProgressBar), typeof(ProgressBarHandler)); ControlsManager.RegisterHandlerType(typeof(RadioButton), typeof(RadioButtonHandler)); ControlsManager.RegisterHandlerType(typeof(TabControl), typeof(TabControlHandler)); ControlsManager.RegisterHandlerType(typeof(TextBox), typeof(TextBoxHandler)); ControlsManager.RegisterHandlerType(typeof(TreeView), typeof(TreeViewHandler)); ControlsManager.RegisterHandlerType(typeof(ButtonMenuItem), typeof(MenuItemHandler)); ControlsManager.RegisterHandlerType(typeof(TextArea), typeof(TextAreaHandler)); }