public async Task HostObject(ICOMClassEntry ent, object obj, bool factory)
{
Dictionary <string, string> props = new Dictionary <string, string>();
if (ent == null)
{
ent = new COMCLSIDEntry(m_registry, Guid.Empty, COMServerType.UnknownServer);
}
props.Add("CLSID", ent.Clsid.FormatGuid());
props.Add("Name", ent.Name);
props.Add("Server", ent.DefaultServer);
/* Need to implement a type library reader */
Type dispType = COMUtilities.GetDispatchTypeInfo(this, obj);
if (!ent.InterfacesLoaded)
{
await ent.LoadSupportedInterfacesAsync(false, null);
}
IEnumerable <COMInterfaceInstance> intfs = factory ? ent.FactoryInterfaces : ent.Interfaces;
ObjectInformation view = new ObjectInformation(m_registry, ent, ent.Name, obj,
props, intfs.Select(i => m_registry.MapIidToInterface(i.Iid)).ToArray());
HostControl(view);
}