Esempio n. 1
0
 public Dictionary <Dictionary <int, string>, Dictionary <string, string> > GetRequestedConnections(int userID)
 {
     return(screenShareComplexManager.GetRequestedConnections(userID));
 }
Esempio n. 2
0
        private void PendingConnections_Load(object sender, EventArgs e)
        {
            acceptedRequestTimer.Start();

            Dictionary <Dictionary <int, string>, Dictionary <string, string> > requestedConnsDictionary = screenShareManager.GetRequestedConnections(userID);

            itemList = new List <RequestedConnectionItem>();

            foreach (var outerDict in requestedConnsDictionary)
            {
                RequestedConnectionItem rci = new RequestedConnectionItem();

                rci.RequestID      = outerDict.Key.FirstOrDefault().Key;
                rci.ConnectionName = outerDict.Key.FirstOrDefault().Value;

                rci.RequesterUsername = outerDict.Value.FirstOrDefault().Key;
                rci.CategoryName      = outerDict.Value.FirstOrDefault().Value;

                itemList.Add(rci);
            }

            pConnectionsGridView.DataSource         = itemList;
            pConnectionsGridView.Columns[0].Visible = false;

            for (int i = 0; i < itemList.Count; i++)
            {
                DataGridViewButtonColumn newButton = new DataGridViewButtonColumn();
                newButton.UseColumnTextForButtonValue = true;

                newButton.Tag  = itemList[i].RequestID;
                newButton.Text = "Accept";
                pConnectionsGridView.Columns.Add(newButton);
            }



            List <SentRequestedConnectionItem> itemList2 = new List <SentRequestedConnectionItem>();

            Dictionary <Dictionary <int, string>, Dictionary <string, string> > sentConnsDictionary = screenShareManager.GetSentRequestedConnections(userID);

            foreach (var outerDict in sentConnsDictionary)
            {
                SentRequestedConnectionItem rci = new SentRequestedConnectionItem();

                rci.RequestID      = outerDict.Key.FirstOrDefault().Key;
                rci.ConnectionName = outerDict.Key.FirstOrDefault().Value;

                rci.RequesterUsername = outerDict.Value.FirstOrDefault().Key;
                rci.CategoryName      = outerDict.Value.FirstOrDefault().Value;

                rci.IsOnline = screenShareManager.GetOnlineStatus(rci.RequesterUsername);
                itemList2.Add(rci);
            }

            rConnectionsGridView.DataSource         = itemList2;
            rConnectionsGridView.ReadOnly           = true;
            rConnectionsGridView.Columns[0].Visible = false;
        }