コード例 #1
0
        private void ConnectToRainbow()
        {
            if (rainbowApplication.IsConnected())
            {
                rainbowApplication.Logout(callback =>
                {
                    if (!callback.Result.Success)
                    {
                        string logline = String.Format("Impossible to logout:\r\n{0}", Util.SerializeSdkError(callback.Result));
                        AddStateLine(logline);
                        log.Warn(logline);
                    }
                });
            }
            else
            {
                String login    = txt_login.StringValue;
                String password = txt_password.StringValue;

                rainbowApplication.Login(login, password, callback =>
                {
                    if (callback.Result.Success)
                    {
                        rainbowMyContact = rainbowContacts.GetCurrentContact();
                        AddStateLine("Welcome " + rainbowMyContact.DisplayName);
                    }
                    else
                    {
                        string logline = String.Format("Impossible to login:\r\n{0}", Util.SerializeSdkError(callback.Result));
                        AddStateLine(logline);
                        log.Warn(logline);
                    }
                });
            }
        }
コード例 #2
0
        private void StoreGlobalInfo()
        {
            if (!ApplicationInfo.DataStorageUsed)
            {
                return;
            }

            // We store a snapshot of presences
            DataStorage.StoreAggregatedPresences(RbContacts.GetAllAggregatedPresences());
            DataStorage.StorePresences(RbContacts.GetAllPresences());

            // We store a snapshot of Contacts
            DataStorage.StoreContacts(RbContacts.GetAllContactsFromCache());
            DataStorage.StoreCurrentContact(RbContacts.GetCurrentContact());

            // We store a snapshot of Bubbles
            DataStorage.StoreBubbles(RbBubbles.GetAllBubblesFromCache());

            // We store a snapshot of Files Descrpitor
            DataStorage.StoreFilesDescriptor(RbFiles.GetAllFilesDescriptorFromCache());
            DataStorage.StoreConversationsByFilesDescriptor(RbFiles.GetAllConversationIdByFilesDescriptorIdFromCache());
        }