public void Conversation_Send_Text_Message()
        {
            AVClient.Initialize("JXyR8vfpeSr8cfaYnob2zYl0-9Nh9j0Va", "Fgq2YlPdnP1KJEoWyF5tk2az");
            var client = new AVIMClient("Tom");

            AVIMConversation conversation = AVIMConversation.CreateWithoutData("573df12679df540060417452", client);

            client.ConnectAsync().ContinueWith(_ =>
            {
                client.RegisterMessage <AVIMTextMessage>((message) =>
                {
                    var textMessage = message as AVIMTextMessage;
                    Trace.WriteLine(textMessage.TextContent);
                });

                client.RegisterMessage <AVIMAudioMessage>((audio) =>
                {
                });

                var text = new AVIMTextMessage("Hi,Jerry");
                conversation.SendMessageAsync(text).ContinueWith(t =>
                {
                    Trace.WriteLine(text.Id);
                }).Wait();
            }).Wait();
        }
        public void AVIMClient_Connect()
        {
            AVClient.Initialize("uay57kigwe0b6f5n0e1d4z4xhydsml3dor24bzwvzr57wdap", "kfgz7jjfsk55r5a8a3y4ttd3je1ko11bkibcikonk32oozww");
            var client = new AVIMClient("Tom");

            client.ConnectAsync().Wait();
        }
        private async void btn_Connect_Click(object sender, EventArgs e)
        {
            selfClient = new AVIMClient(txb_clientId.Text.Trim());
            await selfClient.ConnectAsync();

            LoadData();
            BindEventHandler();
            Log(txb_clientId.Text.Trim() + " 登陆成功!");
        }
        public void Conversation_Send_Image_Message()
        {
            AVClient.Initialize("uay57kigwe0b6f5n0e1d4z4xhydsml3dor24bzwvzr57wdap", "kfgz7jjfsk55r5a8a3y4ttd3je1ko11bkibcikonk32oozww");
            var client = new AVIMClient("Tom");

            client.ConnectAsync().ContinueWith(_ =>
            {
                AVIMImageMessage message = AVIMImageMessage.FromUrl("http://ww3.sinaimg.cn/bmiddle/596b0666gw1ed70eavm5tg20bq06m7wi.gif");
            }).Wait();
        }
        public void Conversation_Join()
        {
            AVClient.Initialize("uay57kigwe0b6f5n0e1d4z4xhydsml3dor24bzwvzr57wdap", "kfgz7jjfsk55r5a8a3y4ttd3je1ko11bkibcikonk32oozww");
            var client = new AVIMClient("John");

            client.UseLeanEngineSignatureFactory();

            client.ConnectAsync().ContinueWith(_ =>
            {
                AVIMConversation consersation = AVIMConversation.CreateWithoutData("575e88521532bc0060995d32", client);
                consersation.JoinAsync().Wait();
            }).Wait();
        }
        public void Create_Conversation()
        {
            AVClient.Initialize("uay57kigwe0b6f5n0e1d4z4xhydsml3dor24bzwvzr57wdap", "kfgz7jjfsk55r5a8a3y4ttd3je1ko11bkibcikonk32oozww");
            var client = new AVIMClient("Tom");

            client.UseLeanEngineSignatureFactory();
            AVIMConversation convseation = new AVIMConversation()
            {
                Name        = "xman",
                IsTransient = false,
            };

            convseation.MemberIds = new List <string>();
            convseation.MemberIds.Add("Jerry");

            client.ConnectAsync().ContinueWith(_ =>
            {
                client.CreateConversationAsync(convseation, true).Wait();
            }).Wait();
        }
 public Task<AVIMClient> CreateClient(string clientId, ISignatureFactory signatureFactory = null, string tag = null)
 {
     CurrentConfiguration = new Configuration()
     {
         ApplicationId = CurrentConfiguration.ApplicationId,
         ApplicationKey = CurrentConfiguration.ApplicationKey,
         SignatureFactory = signatureFactory
     };
     var client = new AVIMClient(clientId, tag)
     {
         SignatureFactory = signatureFactory
     };
     return client.ConnectAsync().ContinueWith(t =>
     {
         return Task.FromResult(client);
     }).Unwrap();
     //return Task.FromResult(new AVIMClient(clientId, tag)
     //{
     //    SignatureFactory = signatureFactory
     //});
 }
 private async void btn_Connect_Click(object sender, EventArgs e)
 {
     selfClient = new AVIMClient(txb_clientId.Text.Trim());
     await selfClient.ConnectAsync();
     LoadData();
     BindEventHandler();
     Log(txb_clientId.Text.Trim() + " 登陆成功!");
 }