Changeset 2369
- Timestamp:
- 11/7/2011 11:56:39 AM (19 months ago)
- Location:
- branches/eraser6/pluginsRewrite
- Files:
-
- 1 added
- 4 edited
-
Eraser.Manager/Settings.cs (modified) (1 diff)
-
Eraser.Plugins/Eraser.Plugins.csproj (modified) (1 diff)
-
Eraser.Plugins/IPlugin.cs (modified) (1 diff)
-
Eraser.Plugins/PersistentStore.cs (added)
-
Eraser.Plugins/PluginInfo.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/pluginsRewrite/Eraser.Manager/Settings.cs
r2366 r2369 60 60 } 61 61 62 /// <summary>63 /// Settings class. Represents settings to a given client.64 /// </summary>65 public abstract class Settings66 {67 /// <summary>68 /// Gets the setting for the given name, coercing the object stored in the backend69 /// to the given type <typeparamref name="T"/>.70 /// </summary>71 /// <typeparam name="T">The type of the setting that is currently stored in the72 /// backend.</typeparam>73 /// <param name="name">The name of the setting that is used to uniquely refer74 /// to the value.</param>75 /// <param name="defaultValue">The default to return if the no data is assocated76 /// with the given setting.</param>77 /// <returns>The value stored in the backend, or null if none exists.</returns>78 public abstract T GetValue<T>(string name, T defaultValue);79 80 /// <summary>81 /// Overload for <see cref="GetValue"/> which returns a default for the given type.82 /// </summary>83 /// <typeparam name="T">The type of the setting that is currently stored in the84 /// backend.</typeparam>85 /// <param name="name">The name of the setting that is used to uniquely refer86 /// to the value.</param>87 /// <param name="defaultValue">The default to return if the no data is assocated88 /// with the given setting.</param>89 /// <returns>The value stored in the backend, or null if none exists.</returns>90 public T GetValue<T>(string name)91 {92 return GetValue<T>(name, default(T));93 }94 95 /// <summary>96 /// Sets the setting with the given name.97 /// </summary>98 /// <param name="name">The name of the setting.</param>99 /// <param name="value">The value to store in the backend. This may be serialised.</param>100 public abstract void SetValue(string name, object value);101 102 /// <summary>103 /// Gets or sets the given setting, without type hinting. This will not attempt to coerce104 /// a type from an old version of the assembly to its current type.105 /// </summary>106 /// <param name="setting">The name of the setting.</param>107 /// <returns>The object stored in the settings database, or null if undefined.</returns>108 [Obsolete("Use the GetValue<T> and SetValue functions instead")]109 public object this[string setting]110 {111 get112 {113 return GetValue<object>(setting);114 }115 set116 {117 SetValue(setting, value);118 }119 }120 }121 122 62 #region Default attributes 123 63 /// <summary> -
branches/eraser6/pluginsRewrite/Eraser.Plugins/Eraser.Plugins.csproj
r2357 r2369 63 63 <Compile Include="IRegistrar.cs" /> 64 64 <Compile Include="LoadingPolicy.cs" /> 65 <Compile Include="PersistentStore.cs" /> 65 66 <Compile Include="PluginInfo.cs" /> 66 67 <Compile Include="PluginLoadedEventArgs.cs" /> -
branches/eraser6/pluginsRewrite/Eraser.Plugins/IPlugin.cs
r2291 r2369 37 37 /// Initializer. 38 38 /// </summary> 39 /// <param name=" host">The host object which can be used for two-way40 /// c ommunication with the program.</param>41 void Initialize( Host host);39 /// <param name="info">The Plugin Information structure describing the 40 /// current plugin.</param> 41 void Initialize(PluginInfo info); 42 42 43 43 /// <summary> -
branches/eraser6/pluginsRewrite/Eraser.Plugins/PluginInfo.cs
r2298 r2369 64 64 /// Executes the plugin's initialisation routine. 65 65 /// </summary> 66 /// <param name="host">The host for the plugin</param>67 66 internal void Load(Host host) 68 67 { … … 78 77 //Initialize the plugin 79 78 Plugin = (IPlugin)Activator.CreateInstance(typePlugin); 80 Plugin.Initialize( host);79 Plugin.Initialize(this); 81 80 } 82 81 catch (InvalidOperationException e) … … 143 142 144 143 /// <summary> 144 /// Gets the Persistent Data Store for this plugin. 145 /// </summary> 146 public PersistentStore PersistentStore { get; private set; } 147 148 /// <summary> 145 149 /// Gets whether this particular plugin is currently loaded in memory. 146 150 /// </summary>
Note: See TracChangeset
for help on using the changeset viewer.
