- Timestamp:
- 11/19/09 17:47:13 (15 years ago)
- Location:
- branches/PluginInfrastructure Refactoring
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/HeuristicLab.PluginInfrastructure.csproj
r2507 r2513 86 86 </ItemGroup> 87 87 <ItemGroup> 88 <Compile Include="Advanced\InstallationManager.cs" /> 88 89 <Compile Include="Attributes\ApplicationAttribute.cs" /> 89 90 <Compile Include="Attributes\AssemblyBuildDateAttribute.cs" /> -
branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Manager/PluginDescription.cs
r2504 r2513 40 40 get { return name; } 41 41 internal set { name = value; } 42 } 43 44 private string description; 45 /// <summary> 46 /// Gets or sets the description of the plugin. 47 /// </summary> 48 public string Description { 49 get { return description; } 50 internal set { description = value; } 42 51 } 43 52 private Version version; -
branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Manager/PluginManager.cs
r2504 r2513 44 44 45 45 private List<PluginDescription> plugins; 46 /// <summary> 47 /// Gets all installed plugins. 48 /// </summary> 49 internal IEnumerable<PluginDescription> Plugins { 50 get { return plugins; } 51 } 46 52 47 53 private List<ApplicationDescription> applications; -
branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Manager/PluginValidator.cs
r2504 r2513 193 193 List<string> pluginFiles = new List<string>(); 194 194 string pluginName = null; 195 string pluginDescription = null; 195 196 // iterate through all custom attributes and search for attributed that we are interested in 196 197 foreach (CustomAttributeData attributeData in attributes) { 197 198 if (IsAttributeDataForType(attributeData, typeof(PluginAttribute))) { 198 199 pluginName = (string)attributeData.ConstructorArguments[0].Value; 200 if (attributeData.ConstructorArguments.Count() == 2) { 201 pluginDescription = (string)attributeData.ConstructorArguments[1].Value; 202 } else pluginDescription = pluginName; 199 203 } else if (IsAttributeDataForType(attributeData, typeof(PluginDependencyAttribute))) { 200 204 pluginDependencies.Add((string)attributeData.ConstructorArguments[0].Value); … … 214 218 215 219 // minimal sanity check of the attribute values 216 if (!string.IsNullOrEmpty(pluginName) && 220 if (!string.IsNullOrEmpty(pluginName) && !string.IsNullOrEmpty(pluginDescription) && 217 221 pluginFiles.Count > 0 && 218 222 pluginAssemblies.Count > 0 && … … 221 225 PluginDescription info = new PluginDescription(); 222 226 info.Name = pluginName; 227 info.Description = pluginDescription; 223 228 info.Version = pluginType.Assembly.GetName().Version; 224 229 info.BuildDate = DateTime.Parse(buildDates.Single(), System.Globalization.CultureInfo.InvariantCulture); -
branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Starter/StarterForm.cs
r2507 r2513 71 71 applicationsListView.Items.Add(item); 72 72 } 73 74 75 this.Enabled = true;76 this.Visible = true;77 73 } 78 74 -
branches/PluginInfrastructure Refactoring/HeuristicLab/HeuristicLab.csproj
r2504 r2513 6 6 <SchemaVersion>2.0</SchemaVersion> 7 7 <ProjectGuid>{623FB817-8371-4A9A-A491-4DECC87B2BBB}</ProjectGuid> 8 <OutputType> WinExe</OutputType>8 <OutputType>Exe</OutputType> 9 9 <AppDesignerFolder>Properties</AppDesignerFolder> 10 10 <RootNamespace>HeuristicLab</RootNamespace> … … 20 20 <RunPostBuildEvent>Always</RunPostBuildEvent> 21 21 <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> 22 <StartupObject> 23 </StartupObject> 22 24 </PropertyGroup> 23 25 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> -
branches/PluginInfrastructure Refactoring/HeuristicLab/Program.cs
r2508 r2513 26 26 using System.Threading; 27 27 using System.Text; 28 using System.Linq; 28 29 using HeuristicLab.PluginInfrastructure; 30 using HeuristicLab.PluginInfrastructure.Advanced; 29 31 30 32 namespace HeuristicLab { … … 32 34 [STAThread] 33 35 static void Main(string[] args) { 34 try {35 if (args.Length == 0) { // normal mode36 if (args.Length == 0) { // normal mode 37 try { 36 38 Application.EnableVisualStyles(); 37 39 Application.SetCompatibleTextRenderingDefault(false); 38 40 Application.Run(new StarterForm()); 39 } else if (args[0].ToUpperInvariant() == "START") { // start specific application 40 if (args.Length != 2) { 41 Console.WriteLine("Usage: HeuristicLab.exe start <application name>"); 42 } else { 43 Application.EnableVisualStyles(); 44 Application.SetCompatibleTextRenderingDefault(false); 45 Application.Run(new StarterForm(args[1])); 46 } 41 } 42 catch (Exception ex) { 43 ShowErrorMessageBox(ex); 44 } 45 46 } else { 47 var cmd = args[0].ToUpperInvariant(); 48 switch (cmd) { 49 case "START": { 50 if (args.Length != 2) { 51 PrintUsage(); 52 } else { 53 Application.EnableVisualStyles(); 54 Application.SetCompatibleTextRenderingDefault(false); 55 Application.Run(new StarterForm(args[1])); 56 } 57 break; 58 } 59 case "SHOW": { 60 InstallationManager manager = new InstallationManager(); 61 foreach (string info in manager.Show(args.Skip(1))) { 62 Console.WriteLine(info); 63 } 64 break; 65 } 66 case "INSTALL": { 67 InstallationManager manager = new InstallationManager(); 68 manager.Install(args.Skip(1)); 69 break; 70 } 71 case "UPDATE": { 72 InstallationManager manager = new InstallationManager(); 73 manager.Update(args.Skip(1)); 74 break; 75 } 76 case "REMOVE": { 77 InstallationManager manager = new InstallationManager(); 78 manager.Remove(args.Skip(1)); 79 break; 80 } 81 default: PrintUsage(); break; 47 82 } 48 83 } 49 catch (Exception ex) { 50 ShowErrorMessageBox(ex); 51 } 84 } 85 86 private static void PrintUsage() { 87 Console.WriteLine("Usage: HeuristicLab.exe <command> <args>"); 88 Console.WriteLine("Commands:"); 89 Console.WriteLine("\tstart <application name>"); 90 Console.WriteLine("\tshow <plugin name(s)>"); 91 Console.WriteLine("\tupdate <plugin name(s)>"); 92 Console.WriteLine("\tremove <plugin name(s)>"); 93 Console.WriteLine("\tinstall <plugin name(s)>"); 52 94 } 53 95
Note: See TracChangeset
for help on using the changeset viewer.