private void InitializeRainbowSDK() { rainbowApplication = new Rainbow.Application(); // Set Application Id, Secret Key and Host Name rainbowApplication.SetApplicationInfo(APP_ID, APP_SECRET_KEY); rainbowApplication.SetHostInfo(HOST_NAME); // Get Rainbow main objects rainbowContacts = rainbowApplication.GetContacts(); rainbowConversations = rainbowApplication.GetConversations(); rainbowFavorites = rainbowApplication.GetFavorites(); // Events we want to manage rainbowApplication.ConnectionStateChanged += RainbowApplication_ConnectionStateChanged; rainbowContacts.RosterContactAdded += RainbowContacts_RosterContactAdded; rainbowContacts.RosterContactRemoved += RainbowContacts_RosterContactRemoved; rainbowConversations.ConversationCreated += RainbowConversations_ConversationCreated; rainbowConversations.ConversationRemoved += RainbowConversations_ConversationRemoved; rainbowFavorites.FavoriteCreated += RainbowFavorites_FavoriteCreated; rainbowFavorites.FavoriteRemoved += RainbowFavorites_FavoriteRemoved; rainbowContactsList = new List <Contact>(); rainbowConvList = new List <Conversation>(); rainbowFavList = new List <Favorite>(); }
private void InitializeRainbowSDK() { rainbowApplication = new Rainbow.Application(); // Set Application Id, Secret Key and Host Name rainbowApplication.SetApplicationInfo(APP_ID, APP_SECRET_KEY); rainbowApplication.SetHostInfo(HOSTNAME); // Get Rainbow main objects rainbowContacts = rainbowApplication.GetContacts(); rainbowConversations = rainbowApplication.GetConversations(); rainbowInstantMessaging = rainbowApplication.GetInstantMessaging(); // Events we want to manage rainbowApplication.ConnectionStateChanged += RainbowApplication_ConnectionStateChanged; rainbowContacts.RosterContactAdded += RainbowContacts_RosterContactAdded; rainbowContacts.RosterContactRemoved += RainbowContacts_RosterContactRemoved; rainbowContacts.ContactPresenceChanged += RainbowContacts_ContactPresenceChanged; rainbowConversations.ConversationCreated += RainbowConversations_ConversationCreated; rainbowConversations.ConversationRemoved += RainbowConversations_ConversationRemoved; rainbowInstantMessaging.MessageReceived += RainbowInstantMessaging_MessageReceived; rainbowInstantMessaging.ReceiptReceived += RainbowInstantMessaging_ReceiptReceived; rainbowInstantMessaging.UserTypingChanged += RainbowInstantMessaging_UserTypingChanged; rainbowContactsList = new List <Contact>(); rainbowConvList = new List <Conversation>(); }
public RainbowSdkWrapper() { RbApplication = new Rainbow.Application(Helper.GetAppFolderPath()); RbApplication.SetTimeout(10000); RbApplication.SetApplicationInfo(ApplicationInfo.APP_ID, ApplicationInfo.APP_SECRET_KEY); RbApplication.SetHostInfo(ApplicationInfo.HOST_NAME); // Set Mobile application RbApplication.Restrictions.MobileApplication = !Helper.IsDesktopPlatform(); // Use Stream Management RbApplication.Restrictions.StreamManagement = true; // Use Auto Reconnection RbApplication.Restrictions.AutoReconnection = true; RbBubbles = RbApplication.GetBubbles(); RbContacts = RbApplication.GetContacts(); RbConversations = RbApplication.GetConversations(); RbInstantMessaging = RbApplication.GetInstantMessaging(); RbFileStorage = RbApplication.GetFileStorage(); // Manage "File Storage" service events RbFileStorage.FileDownloadUpdated += RbFileStorage_FileDownloadUpdated; RbFileStorage.FileUploadUpdated += RbFileStorage_FileUploadUpdated; // Manage "Instant Messaging" service events RbInstantMessaging.MessageReceived += RbInstantMessaging_MessageReceived; RbInstantMessaging.ReceiptReceived += RbInstantMessaging_ReceiptReceived; RbInstantMessaging.MessagesAllRead += RbInstantMessaging_MessagesAllRead; RbInstantMessaging.UserTypingChanged += RbInstantMessaging_UserTypingChanged; // Manage "Contacts" service events RbContacts.PeerAdded += RbContacts_PeerAdded; RbContacts.PeerInfoChanged += RbContacts_PeerInfoChanged; RbContacts.ContactAggregatedPresenceChanged += RbContacts_ContactAggregatedPresenceChanged; RbContacts.ContactPresenceChanged += RbContacts_ContactPresenceChanged; // Manage "Conversations" service events RbConversations.ConversationCreated += RbConversations_ConversationCreated; RbConversations.ConversationRemoved += RbConversations_ConversationRemoved; RbConversations.ConversationUpdated += RbConversations_ConversationUpdated; // Manage "Bubbles" service events RbBubbles.BubbleInfoUpdated += RbBubbles_BubbleInfoUpdated; // Manage "Application" service events RbApplication.ConnectionStateChanged += RbApplication_ConnectionStateChanged; RbApplication.InitializationPerformed += RbApplication_InitializationPerformed; RbApplication.DataCleared += RbApplication_DataCleared; InitAvatarPool(); InitFilePool(); }
} // Need to be public and a property - Used as Binding from XAML public void SetRbApplication(Rainbow.Application rbApp) { rbApplication = rbApp; rbContacts = rbApp.GetContacts(); // Manage some events from Rainbow.Application rbApplication.ConnectionStateChanged += RbApplication_ConnectionStateChanged; rbApplication.InitializationPerformed += RbApplication_InitializationPerformed; // Manage some events from Rainbow.Contacts rbContacts.PeerAdded += RbContacts_PeerAdded; }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); InitLogsWithNLog(); log = Rainbow.LogFactory.CreateLogger <App>(); string appFolderPath = Path.Combine(Helper.GetTempFolder(), LogFolderName); RbApplication = new Rainbow.Application(appFolderPath); RbApplication.SetTimeout(10000); RbApplication.SetApplicationInfo(AppConfiguration.APP_ID, AppConfiguration.APP_SECRET_KEY); RbApplication.SetHostInfo(AppConfiguration.HOST_NAME); RbApplication.SetWebProxyInfo(null); RbBubbles = RbApplication.GetBubbles(); RbContacts = RbApplication.GetContacts(); RbConversations = RbApplication.GetConversations(); RbFavorites = RbApplication.GetFavorites(); RbInstantMessaging = RbApplication.GetInstantMessaging(); RbFileStorage = RbApplication.GetFileStorage(); InitAvatarPool(); InitFilePool(); if (!USE_DUMMY_DATA) { LoginWindow = new LoginView(); LoginWindow.Show(); } else { CurrentUserId = "1"; CurrentUserJid = "1"; if (USE_DUMMY_DATA && USE_LOGIN_FORM_WITH_DUMMY_DATA) { LoginWindow = new LoginView(); LoginWindow.Show(); } else { ApplicationMainWindow = new MainView(); ApplicationMainWindow.Show(); } } }
private void InitializeRainbowSDK() { rainbowApplication = new Rainbow.Application();; // Set Application Id, Secret Key and Host Name rainbowApplication.SetApplicationInfo(APP_ID, APP_SECRET_KEY); rainbowApplication.SetHostInfo(HOSTNAME); // Get Rainbow main objects rainbowBubbles = rainbowApplication.GetBubbles(); rainbowContacts = rainbowApplication.GetContacts(); // Events we want to manage rainbowApplication.ConnectionStateChanged += RainbowApplication_ConnectionStateChanged; rainbowBubbles.ConferenceUpdated += RainbowBubbles_ConferenceUpdated; // Init other objects }
private void InitializeRainbowSDK() { rainbowApplication = new Rainbow.Application(); // Set Application Id, Secret Key and Host Name rainbowApplication.SetApplicationInfo(APP_ID, APP_SECRET_KEY); rainbowApplication.SetHostInfo(HOST_NAME); // Rainbow.Contacts rainbowContacts = rainbowApplication.GetContacts(); // Events we want to manage rainbowApplication.ConnectionStateChanged += RainbowApplication_ConnectionStateChanged; rainbowContacts.ContactInfoChanged += RainbowContacts_ContactInfoChanged; rainbowContacts.RosterContactAdded += RainbowContacts_RosterContactAdded; rainbowContacts.RosterContactRemoved += RainbowContacts_RosterContactRemoved; rainbowContacts.ContactAvatarChanged += RainbowContacts_ContactAvatarChanged; rainbowContacts.ContactAvatarDeleted += RainbowContacts_ContactAvatarRemoved; rainbowContactsList = new List <Contact>(); }