protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); //显示初始化提示框 GuoKun.CustomControls.CustomMessageBox messageBox = new GuoKun.CustomControls.CustomMessageBox("系统正在初始化······"); messageBox.Show(); this.DispatcherUnhandledException += App_DispatcherUnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; //加载系统样式 ResourceDictionary defaultDictionary = new ResourceDictionary() { Source = new Uri("/GuoKun.Themes;component/Themes/Default.xaml", UriKind.RelativeOrAbsolute), }; this.Resources.MergedDictionaries.Add(defaultDictionary); //系统初始化 BootstrapperConfiguration bootstrapperConfiguration = ConfigurationManager.GetSection("account/bootstrapper") as BootstrapperConfiguration; CustomMefBootstrapper <Shell> bootstrapper = new CustomMefBootstrapper <Shell>(bootstrapperConfiguration); bootstrapper.Run(true); _log = UnityContainerFactory.GetUnityContainer().Resolve <ILog>(); messageBox.Close(); Application.Current.MainWindow.Show(); }
public AggregateRootType Create(Type type) { var entityType = default(EntityType); foreach (var subType in type.GetTypeHierarchyUntil(typeof(object)).Reverse()) { if (entityType == null) { entityType = new EntityType(subType, this.typeAnalyzerService); continue; } if (this.typeAnalyzerService.IsValidAggregateRoot(subType)) { break; } entityType = new EntityType(subType, this.typeAnalyzerService, entityType); } var aggregateRootType = default(AggregateRootType); foreach (var subType in type.GetTypeHierarchyUntil(typeof(Entity)).Reverse()) { aggregateRootType = new AggregateRootType(subType, this.typeAnalyzerService, aggregateRootType ?? entityType); } var configuration = new BootstrapperConfiguration(aggregateRootType, this.typeAnalyzerService); var bootstrapper = this.bootstrapperProvider.GetBootstrapper(type); bootstrapper.Invoke(configuration); return(aggregateRootType); }
public ValueObjectType Create(Type type) { var valueObjectType = new ValueObjectType(type, this.typeAnalyzerService); var configuration = new BootstrapperConfiguration(valueObjectType, this.typeAnalyzerService); var bootstrapper = this.bootstrapperProvider.GetBootstrapper(type); bootstrapper.Invoke(configuration); return(valueObjectType); }
public ValueObjectType Create(Type type) { var valueObjectType = new ValueObjectType(type, this.typeAnalyzerService); var configuration = new BootstrapperConfiguration(valueObjectType, this.typeAnalyzerService); var bootstrapper = this.bootstrapperProvider.GetBootstrapper(type); bootstrapper.Invoke(configuration); return valueObjectType; }
public EntityType Create(Type type) { var entityType = default(EntityType); foreach (var subType in type.GetTypeHierarchyUntil(typeof(object)).Reverse()) { if (entityType == null) { entityType = new EntityType(subType, this.typeAnalyzerService); continue; } entityType = new EntityType(subType, this.typeAnalyzerService, entityType); } var configuration = new BootstrapperConfiguration(entityType, this.typeAnalyzerService); var bootstrapper = this.bootstrapperProvider.GetBootstrapper(type); bootstrapper.Invoke(configuration); return entityType; }