示例#1
0
文件: Main.cs 项目: atsushieno/slingr
        public string Login(string user, string pass)
        {
            try {
                Console.WriteLine ("button_login.TouchDown");
                client = new LingrClient ();
                client.CreateSession (user, pass);
                Console.WriteLine ("Login successful.");
                // save settings.
                using (var sw = File.CreateText (cfgfile)) {
                    sw.WriteLine (user);
                    sw.WriteLine (pass);
                }

                room_list_controller.TableView.DataSource = new RoomListDataSource (client.GetRooms ());
                room_list_controller.TableView.Delegate = new RoomListDelegate () { AppDelegate = this };
                navigation_controller.PopViewControllerAnimated (false);
                navigation_controller.PushViewController (room_list_controller, true);
                return null;
            } catch (LingrException ex) {
                return ex.Message;
            }
        }
示例#2
0
文件: Main.cs 项目: atsushieno/slingr
 public RoomDataSource(LingrClient client, string roomName)
 {
     this.client = client;
     room_name = roomName;
     client.Subscribe (roomName);
     var res = client.Show (roomName);
     room = res.Rooms.First (r => r.Id == roomName);
 }