public void OnRegister(IServiceProvider serviceProvider) { offlineStore = ((StorageManager)serviceProvider.GetService(typeof(StorageManager))).OfflineStorage; rosterStore = ((StorageManager)serviceProvider.GetService(typeof(StorageManager))).RosterStorage; sender = (IXmppSender)serviceProvider.GetService(typeof(IXmppSender)); sessionManager = (XmppSessionManager)serviceProvider.GetService(typeof(XmppSessionManager)); handlerManager = (XmppHandlerManager)serviceProvider.GetService(typeof(XmppHandlerManager)); sessionManager.SessionAvailable += SessionAvailable; sessionManager.SessionUnavailable += SessionUnavailable; }