Permalink
Browse files

-IIORegistry register method to choose first or last

-Registry base as public (can't exten otherwise)
-Containers as Public
-GenericIO as public
-HDE Host creates IORegistry
-Dot Net factory imports registry
  • Loading branch information...
1 parent 6c3db76 commit 5486304fcad02ed03e3245a4c73b8318c3cc3bee unknown committed Mar 19, 2012
@@ -42,11 +42,14 @@ public class DotNetPluginFactory : AbstractFileFactory<IInternalPluginHost>
[Import]
private StartableRegistry FStartableRegistry;
+
+ [Import]
+ private IORegistry FIORegistry;
private readonly Dictionary<IPluginBase, PluginContainer> FPluginContainers;
private readonly CompositionContainer FParentContainer;
private readonly Type FReflectionOnlyPluginBaseType;
- private readonly IORegistry FIORegistry = new IORegistry();
+
protected Regex FDynamicRegExp = new Regex(@"(.*)\._dynamic_\.[0-9]+\.dll$");
@@ -51,6 +51,9 @@ class HDEHost : IInternalHDEHost, IHDEHost,
[Export(typeof(ILogger))]
public DefaultLogger Logger { get; private set; }
+
+ [Export(typeof(IORegistry))]
+ public IORegistry IORegistry { get; private set; }
[Export]
public INodeBrowserHost NodeBrowserHost { get; protected set; }
@@ -118,6 +121,8 @@ public HDEHost()
EnumManager.SetHDEHost(this);
Logger = new DefaultLogger();
+
+ IORegistry = new IORegistry();
}
private HashSet<ProxyNodeInfo> LoadNodeInfos(string filename, string arguments)
@@ -6,7 +6,7 @@ namespace VVVV.Hosting.Pins
{
[Guid("31B5051D-09D5-45E7-BF67-4FEC1E28BF35"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- interface IGenericIO
+ public interface IGenericIO
{
object GetSlice(int slice);
}
@@ -6,7 +6,7 @@
namespace VVVV.Hosting.IO
{
[ComVisible(false)]
- static class IOContainer
+ public static class IOContainer
{
public static IIOContainer Create<TIOObject>(
IOBuildContext context,
@@ -24,7 +24,7 @@ static class IOContainer
}
[ComVisible(false)]
- class IOContainer<TIOObject> : IOContainerBase, IIOContainer<TIOObject>
+ public class IOContainer<TIOObject> : IOContainerBase, IIOContainer<TIOObject>
{
private readonly Action<TIOObject> SyncAction;
private readonly Action<TIOObject> FlushAction;
@@ -114,7 +114,7 @@ private void HandleCreated(object sender, EventArgs args)
}
[ComVisible(false)]
- abstract class IOContainerBase : IIOContainer
+ public abstract class IOContainerBase : IIOContainer
{
public IOContainerBase(IOBuildContext context, IIOFactory factory, IIOContainer baseContainer, object rawIOObject)
{
@@ -22,7 +22,7 @@
namespace VVVV.Hosting.IO
{
[ComVisible(false)]
- class IORegistry : IORegistryBase
+ public class IORegistry : IORegistryBase
{
public IORegistry()
{
@@ -22,7 +22,7 @@
namespace VVVV.Hosting.IO
{
[ComVisible(false)]
- class IORegistryBase : IIORegistry
+ public class IORegistryBase : IIORegistry
{
protected readonly List<IIORegistry> FRegistries = new List<IIORegistry>();
protected readonly Dictionary<Type, Func<IIOFactory, IOBuildContext<InputAttribute>, IIOContainer>> FInputDelegates = new Dictionary<Type, Func<IIOFactory, IOBuildContext<InputAttribute>, IIOContainer>>();
@@ -92,10 +92,18 @@ public void RegisterConfig<TIO>(Func<IIOFactory, IOBuildContext<ConfigAttribute>
RegisterConfig(typeof(TIO), createConfigFunc, registerInterfaces);
}
- public void Register(IIORegistry registry)
+ public void Register(IIORegistry registry, bool first = false)
{
- FRegistries.Add(registry);
+ if (first)
+ {
+ FRegistries.Insert(0, registry);
+ }
+ else
+ {
+ FRegistries.Add(registry);
+ }
}
+
public virtual bool CanCreate(IOBuildContext context)
{
@@ -16,7 +16,7 @@ public interface IIORegistry
/// Register a new IO registry which will be used by IO factories
/// to lookup and create custom IO classes.
/// </summary>
- void Register(IIORegistry registry);
+ void Register(IIORegistry registry, bool first);
/// <summary>
/// Whether or not this registry can create the IO class as described

0 comments on commit 5486304

Please sign in to comment.