private static string GetConfiguration(Assembly appAssembly) { Type type = typeof(AssemblyConfigurationAttribute); AssemblyConfigurationAttribute conf = AssemblyConfigurationAttribute.GetCustomAttribute(appAssembly, type) as AssemblyConfigurationAttribute; if (conf != null) { return(conf.Configuration); } else { return(""); } }
private void LoadAssemblies(string asmName) { checkSumComboBox.SelectedIndex = 0; Assembly asm = Assembly.LoadFrom(asmName); AssemblyConfigurationAttribute atrDescr = (AssemblyConfigurationAttribute)AssemblyConfigurationAttribute.GetCustomAttribute(asm, typeof(AssemblyConfigurationAttribute)); string[] config = atrDescr.Configuration.Split(' '); try { for (int i = 0; i < config.Length; i++) { string[] configParametrs = config[i].Split('/'); if (configParametrs[1] == "C") { checkSumComboBox.Items.Add(configParametrs[0]); } else { fileNameTextEdit.Text = configParametrs[0]; } } } catch (IndexOutOfRangeException ex) { } }