/// <summary> /// Gets the <see cref="System.Configuration.Configuration"/> for the specified module name. /// </summary> /// <param name="moduleName">The name of the module to lookup the configuration for.</param> /// <returns>A <see cref="System.Configuration.Configuration"/> instance.</returns> public System.Configuration.Configuration FindModuleConfiguration(string moduleName) { foreach (IModuleInfo moduleInfo in ModuleEnumerator.EnumerateModules()) { if (String.Equals(moduleInfo.Name, moduleName, StringComparison.CurrentCultureIgnoreCase)) { if (!String.IsNullOrEmpty(moduleInfo.VirtualPath)) { return(WebConfigurationManager.OpenWebConfiguration(moduleInfo.VirtualPath)); } } } return(null); }
public override void OnViewReady() { base.OnViewReady(); foreach (IModuleInfo info in ModuleEnumerator.EnumerateModules()) { AssemblyName assemblyName = Assembly.ReflectionOnlyLoadFrom(info.AssemblyFile).GetName(); View.AddModule(assemblyName.Name, assemblyName.Version.ToString()); } View.Text = "关于 " + ConfigurationManager.AppSettings["ShellCaption"]; Bitmap bitmap = ImageService.GetBitmap(ConfigurationManager.AppSettings["SplashTop"]); View.TopPanel.BackgroundImage = bitmap; bitmap = ImageService.GetBitmap(ConfigurationManager.AppSettings["ShellIcon"], new Size(32, 32)); View.IconPanel.BackgroundImage = bitmap; }