Beispiel #1
0
 public IEntanglementHostService Register <TBase, T>(EntanglementAccess access)
     where TBase : class/*, IEntangledObject*/
     where T : EntangledHostedObjectBase, TBase
 {
     Register(typeof(TBase), typeof(T), access);
     return(this);
 }
Beispiel #2
0
        private void Register(Type baseType, Type type, EntanglementAccess access)
        {
            var            guid = baseType.GetTypeInfo().GUID;
            InterfaceEntry e;

            if (!Interfaces.TryAdd(guid,
                                   e = new InterfaceEntry
            {
                Access = access,
                Type = type,
                InterfaceId = guid,
                InterfaceDescriptor = InterfaceDescriptor.Get(baseType)
            }))
            {
                Interfaces[guid].Access = access;
            }
            else
            {
                if (Host?.TypeResolver != null)
                {
                    RegisterTypes(Host.TypeResolver, e);
                }
            }
        }