private void RaiseLoadModuleCompleted(LoadModuleCompletedEventArgs e) { if (this.LoadModuleCompleted != null) { this.LoadModuleCompleted(this, e); } }
void manager_LoadModuleCompleted(object sender, LoadModuleCompletedEventArgs e) { if (e.ModuleInfo.UseState != "1") { object content = serviceLocator.GetInstance(e.ModuleInfo); if (this.OnLoadModuleCompleted != null) this.OnLoadModuleCompleted(this, new LoadModuleEventArgs(content, e.ModuleInfo, e.Error)); } else { if (this.OnSystemLoadModuleCompleted != null) this.OnSystemLoadModuleCompleted(this, new LoadModuleEventArgs(null, e.ModuleInfo, e.Error)); } }
private void IModuleTypeLoader_LoadModuleCompleted(object sender, LoadModuleCompletedEventArgs e) { if (e.Error == null) { //初始化完成后,设置其状态为 可进行初始化,即ReadyForInitialization if ((e.ModuleInfo.State != ModuleState.Initializing) && (e.ModuleInfo.State != ModuleState.Initialized)) { e.ModuleInfo.State = ModuleState.ReadyForInitialization; } //此回调可能在UI线程上运行,但并不不是一定的。 //如果自己在后台定义了加载方式。那么要考虑将此方法交给UI线程处理. //否则可能会发生跨线程问题. this.LoadModulesThatAreReadyForLoad(); } else { this.RaiseLoadModuleCompleted(e); //如果错误没有处理,则将错误写入日志,并抛出模块解析异常. if (!e.IsErrorHandled) { this.HandleModuleTypeLoadingError(e.ModuleInfo, e.Error); } } }