diff options
Diffstat (limited to 'OpenSim/Framework/PluginLoader.cs')
-rw-r--r-- | OpenSim/Framework/PluginLoader.cs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Framework/PluginLoader.cs b/OpenSim/Framework/PluginLoader.cs index 616fa3e..3bc4de6 100644 --- a/OpenSim/Framework/PluginLoader.cs +++ b/OpenSim/Framework/PluginLoader.cs | |||
@@ -96,6 +96,11 @@ namespace OpenSim.Framework | |||
96 | get { return loaded; } | 96 | get { return loaded; } |
97 | } | 97 | } |
98 | 98 | ||
99 | public T Plugin | ||
100 | { | ||
101 | get { return (loaded.Count == 1)? loaded [0] : default (T); } | ||
102 | } | ||
103 | |||
99 | public PluginLoader () | 104 | public PluginLoader () |
100 | { | 105 | { |
101 | Initialiser = new PluginInitialiserBase(); | 106 | Initialiser = new PluginInitialiserBase(); |
@@ -114,11 +119,26 @@ namespace OpenSim.Framework | |||
114 | initialise_plugin_dir_ (dir); | 119 | initialise_plugin_dir_ (dir); |
115 | } | 120 | } |
116 | 121 | ||
117 | public void AddExtensionPoint (string extpoint) | 122 | public void Add (string extpoint) |
118 | { | 123 | { |
124 | if (extpoints.Contains (extpoint)) | ||
125 | return; | ||
126 | |||
119 | extpoints.Add (extpoint); | 127 | extpoints.Add (extpoint); |
120 | } | 128 | } |
121 | 129 | ||
130 | public void Add (string extpoint, IPluginConstraint cons) | ||
131 | { | ||
132 | Add (extpoint); | ||
133 | AddConstraint (extpoint, cons); | ||
134 | } | ||
135 | |||
136 | public void Add (string extpoint, IPluginFilter filter) | ||
137 | { | ||
138 | Add (extpoint); | ||
139 | AddFilter (extpoint, filter); | ||
140 | } | ||
141 | |||
122 | public void AddConstraint (string extpoint, IPluginConstraint cons) | 142 | public void AddConstraint (string extpoint, IPluginConstraint cons) |
123 | { | 143 | { |
124 | constraints.Add (extpoint, cons); | 144 | constraints.Add (extpoint, cons); |
@@ -131,7 +151,7 @@ namespace OpenSim.Framework | |||
131 | 151 | ||
132 | public void Load (string extpoint) | 152 | public void Load (string extpoint) |
133 | { | 153 | { |
134 | AddExtensionPoint (extpoint); | 154 | Add (extpoint); |
135 | Load(); | 155 | Load(); |
136 | } | 156 | } |
137 | 157 | ||