Пример #1
0
        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.PeerInfoChanged += RainbowContacts_PeerInfoChanged;

            rainbowContacts.RosterPeerAdded   += RainbowContacts_RosterPeerAdded;
            rainbowContacts.RosterPeerRemoved += RainbowContacts_RosterPeerRemoved;


            rainbowContacts.PeerAvatarDeleted += RainbowContacts_PeerAvatarDeleted;
            rainbowContacts.PeerAvatarChanged += RainbowContacts_PeerAvatarChanged;

            rainbowContactsList      = new List <Contact>();
            rainbowContactsListFound = new List <Contact>();;
        }
Пример #2
0
        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
            rainbowTelephony = rainbowApplication.GetTelephony();
            rainbowContacts  = rainbowApplication.GetContacts();

            // EVENTS WE WANT TO MANAGE SOME EVENTS
            rainbowApplication.ConnectionStateChanged += RainbowApplication_ConnectionStateChanged;

            rainbowTelephony.TelephonyStatusUpdated     += RainbowTelephony_TelephonyStatusUpdated;
            rainbowTelephony.CallForwardStatusUpdated   += RainbowTelephony_CallForwardStatusUpdated;
            rainbowTelephony.NomadicStatusUpdated       += RainbowTelephony_NomadicStatusUpdated;
            rainbowTelephony.VoiceMessagesNumberUpdated += RainbowTelephony_VoiceMessagesNumberUpdated;

            rainbowTelephony.CallUpdated += RainbowTelephony_CallUpdated;
            rainbowTelephony.CallFailed  += RainbowTelephony_CallFailed;

            // Init other objects
            voiceMessagesList = null;

            pbxCall1 = null;
            pbxCall2 = null;
        }
Пример #3
0
        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.RosterPeerAdded   += RainbowContacts_RosterPeerAdded;
            rainbowContacts.RosterPeerRemoved += RainbowContacts_RosterPeerRemoved;

            rainbowConversations.ConversationCreated += RainbowConversations_ConversationCreated;
            rainbowConversations.ConversationRemoved += RainbowConversations_ConversationRemoved;

            rainbowFavorites.FavoriteCreated += RainbowFavorites_FavoriteCreated;
            rainbowFavorites.FavoriteRemoved += RainbowFavorites_FavoriteRemoved;

            rainbowContactsList = new List <Contact>();
        }
Пример #4
0
        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();
            rainbowInstantMessaging = rainbowApplication.GetInstantMessaging();

            // EVENTS WE WANT TO MANAGE
            rainbowApplication.ConnectionStateChanged += RainbowApplication_ConnectionStateChanged;

            rainbowContacts.RosterPeerAdded   += RainbowContacts_RosterPeerAdded;
            rainbowContacts.RosterPeerRemoved += RainbowContacts_RosterPeerRemoved;

            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>();
        }
Пример #5
0
        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();
        }
Пример #6
0
        }                                                               // 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;
        }
Пример #7
0
        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();
                }
            }
        }
Пример #8
0
        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
            rainbowBubbles  = rainbowApplication.GetBubbles();
            rainbowContacts = rainbowApplication.GetContacts();

            // EVENTS WE WANT TO MANAGE SOME EVENTS
            rainbowApplication.ConnectionStateChanged += RainbowApplication_ConnectionStateChanged;
            rainbowBubbles.ConferenceUpdated          += RainbowBubbles_ConferenceUpdated;

            // Init other objects
        }
Пример #9
0
        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>();
        }
Пример #10
0
        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();
            rainbowInstantMessaging = rainbowApplication.GetInstantMessaging();

            // EVENTS WE WANT TO MANAGE
            rainbowApplication.ConnectionStateChanged += RainbowApplication_ConnectionStateChanged;

            rainbowContacts.RosterPeerAdded   += RainbowContacts_RosterPeerAdded;
            rainbowContacts.RosterPeerRemoved += RainbowContacts_RosterPeerRemoved;

            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>();


            // Get Login/password used successfully in last connexion
            String login = rainbowApplication.GetUserLoginFromCache();

            if (!String.IsNullOrEmpty(login))
            {
                tbLogin.Text = login;
            }

            String pwd = rainbowApplication.GetUserPasswordFromCache();

            if (!String.IsNullOrEmpty(pwd))
            {
                tbPassword.Text = pwd;
            }

            // Get INI File Parser
            rainbowIniFileParser = rainbowApplication.GetIniFileParser();

            // Get AutoLogon settings and launch login process automatically if set
            String autoLogon = rainbowIniFileParser.GetValue("AutoLogon", "Settings", "false");

            if (autoLogon != "true")
            {
                cbAutoLogon.Checked = false;
            }
            else
            {
                cbAutoLogon.Checked = true;

                btnLoginLogout_Click(null, null);
            }
        }