public static TInterfaceType GetService <TInterfaceType>(string contractID) { Guid iid = multiversion <TInterfaceType> .ActualType.GUID; var obj = ServiceManager.GetServiceByContractID(contractID, ref iid); return(multiversion <TInterfaceType> .Cast(obj)); }
public static TInterfaceType GetService <TInterfaceType>(string contractID) { Guid iid = typeof(TInterfaceType).GUID; IntPtr ptr = ServiceManager.GetServiceByContractID(contractID, ref iid); return((TInterfaceType)Marshal.GetObjectForIUnknown(ptr)); }
//public static object GetService(string contractID) //{ // return GetService<nsISupports>(contractID); //} public static TInterfaceType GetService <TInterfaceType>(string contractID) { AssertCorrectThread(); Guid iid = typeof(TInterfaceType).GUID; IntPtr ptr = ServiceManager.GetServiceByContractID(contractID, ref iid); return((TInterfaceType)Xpcom.GetObjectForIUnknown(ptr)); }
public static TInterfaceType GetService <TInterfaceType>(string contractID) { Guid iid = typeof(TInterfaceType).GUID; return((TInterfaceType)ServiceManager.GetServiceByContractID(contractID, ref iid)); }