public static void SubscribeToEvents(string description, string subscriptionName, string subscriptionID, object subscribingObject, Type subscribingType) { // activate subscriber try { //create and populate a subscription object IEventSubscription sub = new EventSubcription() as IEventSubscription; sub.Description = description; sub.SubscriptionName = subscriptionName; sub.SubscriptionID = subscriptionID; //Get the GUID from the ISensLogon interface sub.InterfaceID = GetInterfaceGuid(subscribingType); sub.SubscriberInterface = subscribingObject; //Store the actual Event. EventSystem.Store(PROGID_EventSubscription, sub); } catch (Exception ex) { Console.WriteLine(ex); } }
public static void SubscribeToEvents(string description, string subscriptionName, string subscriptionID, object subscribingObject, Type subscribingType) { // activate subscriber try { //create and populate a subscription object IEventSubscription sub = new EventSubcription() as IEventSubscription; sub.Description = description; sub.SubscriptionName = subscriptionName; sub.SubscriptionID = subscriptionID; //Get the GUID from the ISensLogon interface sub.InterfaceID = GetInterfaceGuid(subscribingType); sub.SubscriberInterface = subscribingObject; //Store the actual Event. EventSystem.Store(PROGID_EventSubscription, sub); } catch (Exception ex) { Console.WriteLine(ex); } }