コード例 #1
0
        public static Contact GetContact(RosterItem rosterItem)
        {
            Contact contact = null;

            try
            {
                using (SQLiteCommand command = _connection.CreateCommand())
                {
                    command.CommandText = "SELECT * FROM [Contact] WHERE [Jid]=@jid";

                    command.Parameters.Add(new SQLiteParameter("jid", rosterItem.Jid.Bare));

                    SQLiteDataReader reader = command.ExecuteReader();

                    if (reader.Read())
                    {
                        contact = new Contact(reader, rosterItem);
                    }

                    reader.Close();
                }
            }

            catch (Exception e)
            {
                Events.Instance.OnEvent(e, new EventError(e.Message, null));
            }

            return contact;
        }
コード例 #2
0
        public Contact(Presence presence)
        {
            _rosterItem = new RosterItem();
            _rosterItem.Jid = presence.From;

            BuildSearchText();
        }
コード例 #3
0
        public Contact(RosterItem rosterItem, int metaId)
        {
            _rosterItem = rosterItem;
            _metaId = metaId;

            AskForLastTime();

            BuildSearchText();
        }
コード例 #4
0
        public Contact(IDataRecord reader, RosterItem rosterItem)
        {
            _rosterItem = rosterItem;
            _metaId = (int) (Int64) reader["MetaId"];

            if (!reader.IsDBNull(reader.GetOrdinal("CustomName")))
            {
                _customName = (string) reader["CustomName"];
            }

            AskForLastTime();

            BuildSearchText();
        }
コード例 #5
0
ファイル: ChatFriend.cs プロジェクト: mfro/LeagueClient
    public ChatFriend(RosterItem item) {
      User = item;

      var groups = item.GetGroups();
      Group = groups.Item(0).InnerXml;
    }