public Vcard Get(string username)
        {
            Vcard vcard = null;

            using (SqlDataContext dc = new SqlDataContext())
            {
                try
                {
                    var user = dc.DatabaseUserItems.Single(x => string.Compare(username, x.Username, true) == 0);
                    var data = HeaderManager.Load(username);
                    vcard             = new Vcard();
                    vcard.Nickname    = user.Nickname;
                    vcard.Description = user.Signature;
                    vcard.Jid         = JIDEscaping.Escape(user.Username) + "@gjtalk.com";
                    vcard.AddEmail(new Email(user.Mail));
                    if (data != null)
                    {
                        vcard.Photo = new Photo(data, ImageFormat.Png);
                    }
                }
                catch (System.Exception ex)
                {
                }
            }
            return(vcard);
        }
Beispiel #2
0
        static void SetEnv()
        {
            HackMatrix();
            var process = Process.GetCurrentProcess();
            var file    = process.MainModule.FileName;
            var dir     = Path.GetDirectoryName(file);

            HeaderManager.SetPath(dir + "\\UserPic");
        }