Changeset 2504 for branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Attributes
- Timestamp:
- 11/18/09 18:33:30 (15 years ago)
- Location:
- branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Attributes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Attributes/ApplicationAttribute.cs
r2488 r2504 27 27 /// <summary> 28 28 /// This attribute can be used to specify meta data for applications. 29 /// For example to specify name , versionand description of applications.29 /// For example to specify name and description of applications. 30 30 /// </summary> 31 31 [AttributeUsage(AttributeTargets.Class)] 32 public class ApplicationAttribute : System.Attribute {32 public sealed class ApplicationAttribute : System.Attribute { 33 33 private string name; 34 34 /// <summary> 35 /// Gets or setsthe name of the application.35 /// Gets the name of the application. 36 36 /// </summary> 37 37 public string Name { 38 38 get { return name; } 39 set { name = value; }40 39 } 41 42 //private string version;43 ///// <summary>44 ///// Gets or sets the version of the application.45 ///// </summary>46 //public string Version {47 // get { return version; }48 // set { version = value; }49 //}50 40 51 41 private string description; 52 42 /// <summary> 53 /// Gets or setsthe description of the application.43 /// Gets the description of the application. 54 44 /// </summary> 55 45 public string Description { 56 46 get { return description; } 57 set { description = value; }58 47 } 59 48 60 49 private bool restartOnErrors; 61 50 /// <summary> 62 /// Gets or sets the boolean flagwhether the plugin should be automatically restarted when it is closed because of an exception (for services).51 /// Gets whether the plugin should be automatically restarted when it is closed because of an exception (for services). 63 52 /// </summary> 64 53 public bool RestartOnErrors { 65 54 get { return restartOnErrors; } 66 set { restartOnErrors = value; }67 55 } 68 56 … … 72 60 /// </summary> 73 61 public ApplicationAttribute(string name) 74 : this(name, "") {62 : this(name, String.Empty) { 75 63 } 76 64 … … 84 72 } 85 73 86 ///// <summary>87 ///// Initializes a new instance of <see cref="ApplicationAttribute"/>.88 ///// <param name="name">Name of the application</param>89 ///// <param name="description">Description of the application</param>90 ///// <param name="version">Version string of the application</param>91 ///// </summary>92 //public ApplicationAttribute(string name, string description, string version)93 // : this(name, description, version, false) {94 //}95 96 74 /// <summary> 97 75 /// Initializes a new instance of <see cref="ApplicationAttribute"/>. … … 102 80 /// </summary> 103 81 public ApplicationAttribute(string name, string description, bool restartOnErrors) { 82 if (name == null) throw new ArgumentNullException("name", "Application name is null."); 83 if (description == null) throw new ArgumentNullException("description", "Application description is null."); 104 84 this.name = name; 105 85 this.description = description; -
branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Attributes/AssemblyBuildDateAttribute.cs
r2475 r2504 30 30 /// </summary> 31 31 [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)] 32 public class AssemblyBuildDateAttribute : Attribute {32 public sealed class AssemblyBuildDateAttribute : Attribute { 33 33 private DateTime buildDate; 34 34 /// <summary> 35 /// Gets or setsthe build date.35 /// Gets the build date. 36 36 /// </summary> 37 37 public DateTime BuildDate { 38 38 get { return buildDate; } 39 set { buildDate = value; }40 39 } 40 41 41 /// <summary> 42 42 /// Initializes a new instance of <see cref="AssemblyBuildDateAttribute"/> with the given … … 44 44 /// </summary> 45 45 /// <exception cref="FormatException">Thrown when the time stamp could not be parsed as build date.</exception> 46 /// <param name=" timeStamp">The build date of the assembly.</param>47 public AssemblyBuildDateAttribute(string timeStamp)46 /// <param name="buildDate">The build date of the assembly.</param> 47 public AssemblyBuildDateAttribute(string buildDate) 48 48 : base() { 49 50 if(!DateTime.TryParse(timeStamp, out buildDate)) { 51 throw new FormatException("Can't parse AssemblyBuildDate " + timeStamp); 49 if (!DateTime.TryParse(buildDate, out this.buildDate)) { 50 throw new FormatException("Can't parse AssemblyBuildDate " + buildDate); 52 51 } 53 52 } -
branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Attributes/PluginAttribute.cs
r2488 r2504 27 27 /// <summary> 28 28 /// This attribute can be used to specify meta data for plugins. 29 /// For example to specify name , versionand description of plugins.29 /// For example to specify name and description of plugins. 30 30 /// </summary> 31 31 [AttributeUsage(AttributeTargets.Class)] 32 public class PluginAttribute : System.Attribute {32 public sealed class PluginAttribute : System.Attribute { 33 33 private string name; 34 34 /// <summary> 35 /// Gets or setsthe name of the plugin.35 /// Gets the name of the plugin. 36 36 /// </summary> 37 37 public string Name { 38 38 get { return name; } 39 // set { name = value; }40 39 } 41 42 //private string version;43 ///// <summary>44 ///// Gets or sets the version of the plugin.45 ///// </summary>46 //public string Version {47 // get { return version; }48 // set { version = value; }49 //}50 40 51 41 private string description; 52 42 /// <summary> 53 /// Gets or setsthe description of the plugin.43 /// Gets the description of the plugin. 54 44 /// </summary> 55 45 public string Description { 56 46 get { return description; } 57 // set { description = value; }58 47 } 59 48 … … 75 64 this.description = description; 76 65 } 77 78 ///// <summary>79 ///// Initializes a new instance of <see cref="PluginDescriptionAttribute"/>.80 ///// <param name="name">Name of the plugin</param>81 ///// <param name="description">Description of the plugin</param>82 ///// <param name="version">Version string of the plugin</param>83 ///// </summary>84 //public PluginDescriptionAttribute(string name, string description, string version) {85 // this.name = name;86 // this.version = version;87 // this.description = description;88 //}89 66 } 90 67 } -
branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Attributes/PluginDependencyAttribute.cs
r2481 r2504 33 33 34 34 /// <summary> 35 /// Gets or setsthe name of the plugin that is needed to load a plugin.35 /// Gets the name of the plugin that is needed to load a plugin. 36 36 /// </summary> 37 37 public string Dependency { 38 38 get { return dependency; } 39 // set { dependency = value; }40 39 } 41 40 … … 45 44 /// </summary> 46 45 public PluginDependencyAttribute(string dependency) { 46 if (string.IsNullOrEmpty(dependency)) throw new ArgumentException("Dependency is null or empty.", "dependency"); 47 47 this.dependency = dependency; 48 48 } -
branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Attributes/PluginFileAttribute.cs
r2496 r2504 23 23 using System.Collections.Generic; 24 24 using System.Text; 25 using System.IO; 25 26 26 27 namespace HeuristicLab.PluginInfrastructure { … … 40 41 /// </summary> 41 42 [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] 42 public class PluginFileAttribute : System.Attribute {43 private string file name;43 public sealed class PluginFileAttribute : System.Attribute { 44 private string fileName; 44 45 45 46 /// <summary> 46 /// Gets or sets the filename of the plugin.47 /// Gets the file name of the plugin. 47 48 /// </summary> 48 public string Filename { 49 get { return filename; } 50 //set { filename = value; } 49 public string FileName { 50 get { return fileName; } 51 51 } 52 52 53 private PluginFileType file type = PluginFileType.Data;53 private PluginFileType fileType = PluginFileType.Data; 54 54 55 55 /// <summary> 56 /// Gets or sets the filetype of the plugin file.56 /// Gets the file type of the plugin file. 57 57 /// </summary> 58 public PluginFileType Filetype { 59 get { return filetype; } 60 //set { filetype = value; } 58 public PluginFileType FileType { 59 get { return fileType; } 61 60 } 62 61 63 62 /// <summary> 64 63 /// Initializes a new instance of <see cref="PluginFileAttribute"/>. 65 /// <param name="file name">Name of the file</param>66 /// <param name=" type">Type of the file (Assembly, Executable, Data, License)</param>64 /// <param name="fileName">Name of the file</param> 65 /// <param name="fileType">Type of the file (Assembly, NativeDll, Data, License)</param> 67 66 /// </summary> 68 public PluginFileAttribute(string filename, PluginFileType type) { 69 this.filename = filename; 70 this.filetype = type; 67 public PluginFileAttribute(string fileName, PluginFileType fileType) { 68 if (string.IsNullOrEmpty(fileName)) throw new ArgumentException("File name is empty.", "fileName"); 69 // NB: doesn't check if the file actually exists 70 this.fileName = fileName; 71 this.fileType = fileType; 71 72 } 72 73 }
Note: See TracChangeset
for help on using the changeset viewer.