Esempio n. 1
0
        public void InitData(GroupInfo group, bool isAdmin)
        {
            m_groupId = group.GroupId;
            string mycustomerId = DataManager.Instance.Customer.CustomerId;

            dgvMemberList.Rows.Clear();
            if (isAdmin)
            {
                foreach (string customer in group.CustomerList)
                {
                    if (group.AdminList.Contains(customer))
                        dgvMemberList.Rows.Add(customer, GetImage(), true);
                    else
                        dgvMemberList.Rows.Add(customer, GetImage(), false);
                }
            }
            else
            {
                ColumnRemoveCustomer.Visible = false;
                ColumnAdmin.Visible = false;
                foreach (string customer in group.CustomerList)
                        dgvMemberList.Rows.Add(customer);
            }
        }
Esempio n. 2
0
 public void OnUpdateGroup(string updateType, GroupInfo group)
 {
     switch (updateType)
     {
         case ClientEventNames.OnChangeGroupName:
         case ClientEventNames.OnChangeGroupPrivacy:
         case ClientEventNames.OnChangeGroupDescription:
             if (m_groupDict.ContainsKey(group.GroupId))
                 m_groupDict[group.GroupId] = group;
             FireEvent(ClientEventNames.OnUpdateGroup, new object[] { group });
             break;
     }
 }
Esempio n. 3
0
 private void OnJoinGroup(string customerId, GroupInfo group)
 {
     if (!m_groupDict.ContainsKey(group.GroupId))
         m_groupDict.TryAdd(group.GroupId, group);
     else
         m_groupDict[group.GroupId].CustomerList = group.CustomerList;
     FireEvent(ClientEventNames.OnJoinGroup, new object[] { customerId, group.GroupId });
 }
Esempio n. 4
0
        private void OnInviteToGroupRespond(string customerId, GroupInfo group, bool agree)
        {
            if (agree)
            {
                if (customerId.Equals(Customer.CustomerId))
                    m_groupDict.TryAdd(group.GroupId, group);
                else
                    m_groupDict[group.GroupId].CustomerList.Add(customerId);
            }
            FireEvent(ClientEventNames.OnInviteToGroupRespond, new object[] { customerId, group, agree });

        }
Esempio n. 5
0
 private void OnAddGroup(GroupInfo group)
 {
     if (!m_groupDict.ContainsKey(group.GroupId))
         m_groupDict.TryAdd(group.GroupId, group);
     FireEvent(ClientEventNames.OnAddGroup, new object[] { group });
 }