public request_objs(request_objs req_dialog, string message)// отправка сообщения { this.login = req_dialog.login; this.password = req_dialog.password; this.dialog_id = req_dialog.dialog_id; this.message = message; }
public async Task <IEnumerable <Message> > GetMessages(request_objs ReqO) { string a = "/" + ReqO.login + "=" + ReqO.password + "=" + ReqO.dialog_id; HttpClient client = GetClient(); string result = await client.GetStringAsync(Mes + a); return(JsonConvert.DeserializeObject <IEnumerable <Message> >(result)); }
public async void CreateAcc(request_objs req) { request_cra ReqO = new request_cra(); ReqO.login = req.login; ReqO.password = req.password; HttpClient client = GetClient(); var response = await client.PostAsync(Acc, new StringContent( JsonConvert.SerializeObject(ReqO), Encoding.UTF8, "application/json")); }
public async void AddDialog(request_objs req, string login) { request_crd ReqO = new request_crd(); ReqO.login = req.login; ReqO.password = req.password; ReqO.interlocutor = login; HttpClient client = GetClient(); var result = await client.PostAsync(Dia, new StringContent( JsonConvert.SerializeObject(ReqO), Encoding.UTF8, "application/json")); }
private async void User_Create(object sender, EventArgs e) { NetService net = new NetService(); request_objs ReqO = new request_objs(loginEntry.Text, passwordEntry.Text); List <Dialog> Dialogs = new List <Dialog> { }; /*IEnumerable<Dialog> dialogs = await*/ net.CreateAcc(ReqO); //foreach (Dialog d in dialogs) // Dialogs.Add(d); await Navigation.PushAsync(new MainPage(ReqO, Dialogs)); }
public DialogPage(request_objs ReqO, List <Message> Messages) { this.ReqO = ReqO; this.Messages = Messages; InitializeComponent(); /*Dialog = new List<Message> * { * new Message { position=1, text = "1lolololo"}, * new Message {position=1, text = "2lolololo"}, * new Message {position=2, text = "3lolololo"}, * new Message {position=2, text = "4lolololo"}, * new Message {position=1, text = "lolololo"}, * new Message {position=2, text = "lolololo"} * };*/ this.BindingContext = this; }//{Binding text}" FontSize="38" HorizontalOptions=" {Binding position}
public async void AddMessage(request_objs req, DateTime time) { request_mes ReqO = new request_mes(); ReqO.dialog_id = req.dialog_id; ReqO.login = req.login; ReqO.password = req.password; ReqO.text = req.message; ReqO.send_time = time; HttpClient client = GetClient(); var result = await client.PostAsync(Mes, new StringContent( JsonConvert.SerializeObject(ReqO), Encoding.UTF8, "application/json")); }
public MainPage(request_objs ReqO, List <Dialog> dialogs) { //Dialogs = new List<Dialog>(); //net = new NetService(); this.ReqO = ReqO; //IEnumerable<Dialog> dialogs = await net.GetDialogs(); Dialogs = dialogs; /* Dialogs = new List<Dialog> * { * new Dialog {Name="pas"}, * new Dialog {Name="ole"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"}, * new Dialog {Name="pas"} * };*/ this.BindingContext = this; InitializeComponent(); Subscribe(); }
private async void User_Enter(object sender, EventArgs e) { NetService net = new NetService(); request_objs ReqO = new request_objs(loginEntry.Text, passwordEntry.Text); List <Dialog> Dialogs = new List <Dialog> { }; IEnumerable <Dialog> dialogs = await net.GetDialogs(ReqO); foreach (Dialog d in dialogs) { Dialogs.Add(d); } await Navigation.PushAsync(new MainPage(ReqO, Dialogs)); }
public Create_Dialog(request_objs ReqO) { this.ReqO = ReqO; InitializeComponent(); }
public request_objs(request_objs req_log, int dialog_id) //вход в диалог, создание диалога { this.login = req_log.login; this.password = req_log.password; this.dialog_id = dialog_id; }