コード例 #1
0
        private DatabaseFactory()
        {
            connection = new SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), APPDB_PATH);


            /*    var sync = new SQLiteConnection(APPDB_PATH);
             * connection = new SQLiteConnection(APPDB_PATH);*/

            identityDatabase    = new IdentityDatabase(connection);
            threadDatabase      = new ThreadDatabase(connection);
            groupDatabase       = new GroupDatabase(connection);
            messageDatabase     = new MessageDatabase(connection);
            textMessageDatabase = new TextMessageDatabase(connection);

            //contactDatabase = new ContactsDatabase(connection);
            //addressDatabase = new CanonicalAddressDatabase(connection);
            directoryDatabase = new TextSecureDirectory(connection);
            pushDatabase      = new PushDatabase(connection);
            recipientDatabase = new RecipientDatabase(connection);
        }
コード例 #2
0
        private DatabaseFactory()
        {

           connection = new SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), APPDB_PATH);
           

            /*    var sync = new SQLiteConnection(APPDB_PATH);
            connection = new SQLiteConnection(APPDB_PATH);*/

            identityDatabase = new IdentityDatabase(connection);
            threadDatabase = new ThreadDatabase(connection);
            groupDatabase = new GroupDatabase(connection);
            messageDatabase = new MessageDatabase(connection);
            textMessageDatabase = new TextMessageDatabase(connection);

            //contactDatabase = new ContactsDatabase(connection);
            //addressDatabase = new CanonicalAddressDatabase(connection);
            directoryDatabase = new TextSecureDirectory(connection);
            pushDatabase = new PushDatabase(connection);
            recipientDatabase = new RecipientDatabase(connection);
        }
コード例 #3
0
        public Recipient GetOrCreateRecipient(TextSecureDirectory.Directory d)
        {
            var query = conn.Table<Recipient>().Where(r => r.Number == d.Number);

            if (query.Count() != 0) return query.First();

            var recipient = new Recipient()
            {
                RecipientId = 0,
                Number = d.Number,
                ContactId = d.ContactId,
                Name = d.Name
            };

            conn.Insert(recipient);

            return recipient;
        }
コード例 #4
0
        public Recipients GetOrCreateRecipients(TextSecureDirectory.Directory d)
        {
            var recipients = new List<Recipient>();
            /*foreach (var recipientId in recipientIds)
            {

            }*/

            recipients.Add(GetOrCreateRecipient(d));

            return RecipientFactory.getRecipientsFor(recipients, false);
        }
コード例 #5
0
ファイル: MainViewModel.cs プロジェクト: smndtrl/Signal-UWP
 private void OpenChat(TextSecureDirectory.Directory contacts)
 {
     Recipients recipients = DatabaseFactory.getRecipientDatabase().GetOrCreateRecipients(SelectedContact); //RecipientFactory.getRecipientsFromContact(SelectedContact);
     var chatid = DatabaseFactory.getThreadDatabase().GetThreadIdForRecipients(recipients, 0);
     var chat = DatabaseFactory.getThreadDatabase().Get(chatid);
     OpenChat(chat);
 }