Пример #1
0
 public oneChat(string id, string mylogin, BridgeClient e)
 {
     this.id      = id;
     this.enginee = e;
     image        = "resources/readmsg.png";
     if (id.StartsWith("gr") == true)
     {
         name = id.Remove(0, 2);
     }
     else
     {
         if (id.StartsWith("pm") == true)
         {
             string   newid = id.Remove(0, 2);
             string[] qqq   = newid.Split('|');
             if (qqq[0] == mylogin)
             {
                 name  = "/pm " + qqq[1];
                 nick  = qqq[1];
                 image = this.enginee.map[qqq[1]].pict;
             }
             else
             {
                 name  = "/pm " + qqq[0];
                 nick  = qqq[0];
                 image = this.enginee.map[qqq[0]].pict;
             }
         }
         else
         {
             name = id;
         }
     }
 }
Пример #2
0
 public OneUser(string id, BridgeClient e)
 {
     eng     = e;
     this.id = id;
     name    = this.id;
     _pict   = eng.map[id].pict;
 }
Пример #3
0
        private void tryLogOut()
        {
            chates  = new ObservableCollection <oneChat>();
            msges   = new ObservableCollection <oneMsg>();
            friends = new ObservableCollection <OnePeople>();
            chatsList.ItemsSource = chates;
            msgsList.ItemsSource  = msges;
            enginee = new BridgeClient(chates, msges, this);
            users   = new ObservableCollection <OneUser>();
            lbUsersKek.ItemsSource = users;
            //lbFriends.Items.Clear();
            lbFriends.ItemsSource = friends;
            //chatsList.Focus();
            btnAddUser.Visibility       = Visibility.Hidden;
            btnLeaveChat.Visibility     = Visibility.Hidden;
            btnShowUsers.Visibility     = Visibility.Hidden;
            msgsList.Visibility         = Visibility.Hidden;
            btnSendMsg.Visibility       = Visibility.Hidden;
            boxtomsg.Visibility         = Visibility.Hidden;
            btnFriendsDelete.Visibility = Visibility.Hidden;
            btnFriendsSend.Visibility   = Visibility.Hidden;
            this.Visibility             = Visibility.Hidden;
            loginWindow lw = new loginWindow(enginee);

            lw.Top   = this.Top + 100;
            lw.Left  = this.Left + 100;
            lw.Owner = this;
            lw.Show();
            lw.Focus();
            lw.tbLogin.Focus();
            System.Windows.Forms.Timer tim = new System.Windows.Forms.Timer();
            tim.Tick    += new EventHandler(enginee._sendEmpty);
            tim.Interval = 20000;
            tim.Start();
        }
Пример #4
0
 public OnePeople(BridgeClient e)
 {
     eng  = e;
     id   = null;
     name = null;
     pict = null;
 }
Пример #5
0
 public void updateIcons(BridgeClient e)
 {
     if (pict != e.map[idfrom].pict)
     {
         pict = e.map[idfrom].pict;
     }
     if (name != e.map[idfrom].name)
     {
         name = e.map[idfrom].name;
     }
 }
Пример #6
0
 public chooseUser(bool b, BridgeClient e, MainWindow mm, Action <string> a)
 {
     full       = new ObservableCollection <OnePeople>();
     friend     = new ObservableCollection <OnePeople>();
     other      = new ObservableCollection <OnePeople>();
     act        = a;
     useFriends = b;
     eng        = e;
     mw         = mm;
     InitializeComponent();
     clearThis();
 }
Пример #7
0
 public void updateIcon(BridgeClient e)
 {
     if (id.StartsWith("pm"))
     {
         if (image != e.map[nick].pict)
         {
             image = e.map[nick].pict;
         }
         if (name != e.map[nick].name)
         {
             name = "/pm " + e.map[nick].name;
         }
     }
 }
Пример #8
0
 public oneMsg(string id, string text, string ttime, string login, BridgeClient e)
 {
     string[] retime = ttime.Split(new char[] { ' ', ':' });
     time       = " at " + retime[4] + ":" + retime[5] + " of " + retime[0] + " " + retime[2] + " " + retime[1] + " " + retime[3];
     eng        = e;
     idfrom     = id;
     name       = id;
     this.login = login;
     textmsg    = text;
     if (idfrom == login)
     {
         fromSelf = true;
     }
     else
     {
         fromSelf = false;
     }
     pict = this.eng.map[idfrom].pict;
 }
Пример #9
0
 public MainWindow()
 {
     InitializeComponent();
     chates  = new ObservableCollection <oneChat>();
     msges   = new ObservableCollection <oneMsg>();
     friends = new ObservableCollection <OnePeople>();
     chatsList.ItemsSource = chates;
     msgsList.ItemsSource  = msges;
     enginee = new BridgeClient(chates, msges, this);
     users   = new ObservableCollection <OneUser>();
     lbUsersKek.ItemsSource = users;
     //lbFriends.Items.Clear();
     lbFriends.ItemsSource = friends;
     //chatsList.Focus();
     btnAddUser.Visibility       = Visibility.Hidden;
     btnLeaveChat.Visibility     = Visibility.Hidden;
     btnShowUsers.Visibility     = Visibility.Hidden;
     msgsList.Visibility         = Visibility.Hidden;
     btnSendMsg.Visibility       = Visibility.Hidden;
     boxtomsg.Visibility         = Visibility.Hidden;
     btnFriendsDelete.Visibility = Visibility.Hidden;
     btnFriendsSend.Visibility   = Visibility.Hidden;
 }
Пример #10
0
 public formFriendAdd(BridgeClient e)
 {
     eng = e;
     InitializeComponent();
 }
Пример #11
0
 public addUserWindow(BridgeClient e)
 {
     eng = e;
     InitializeComponent();
 }
Пример #12
0
 public loginWindow(BridgeClient e)
 {
     eng = e;
     InitializeComponent();
 }
Пример #13
0
 public Window1(BridgeClient e)
 {
     eng = e;
     InitializeComponent();
 }