示例#1
0
 public ucContact(ContactBook contactBook, FrmContactBook frmContactBook, FrmMain mainForm)
 {
     this.contactBook    = contactBook;
     this.mainForm       = mainForm;
     this.FrmContactBook = frmContactBook;
     this.Dock           = DockStyle.Top;
     listContact__User   = new List <ucContact__User>();
     InitializeComponent();
     _InitControls();
     _LoadContact();
 }
示例#2
0
        public FrmMain(FrmLogin loginform, User user, SocketClient client, TcpClient server, string Theme)
        {
            acceptClose = true;
            frmLoading  = new FrmLoading();
            time        = false;
            tick        = 0;
            timer       = new Timer();

            frmLoading.TopLevel = false;
            frmLoading.Dock     = DockStyle.Fill;
            frmLoading.BringToFront();
            frmLoading.Show();
            this.Controls.Add(frmLoading);
            timer.Interval = 1000;
            timer.Tick    += (timersender, timerEvent) => { tick++; if (time == true && tick > 1)
                                                            {
                                                                timer.Stop();
                                                                this.Controls.Remove(frmLoading);
                                                            }
            };
            timer.Start();

            this.loginForm = loginform;
            FrmMain.client = client;
            FrmMain.server = server;
            FrmMain.me     = user;
            theme          = new Theme();
            if (Theme == "Black")
            {
                theme.Black();
            }
            else
            {
                theme.White();
            }
            InitializeComponent();
            Panel temp = new Panel();

            temp.Dock      = DockStyle.Fill;
            temp.BackColor = Color.Transparent;
            this.panelRIGHT.Controls.Add(temp);
            temp.BringToFront();
            temp.Show();
            UserUIs               = new List <UserUI>();
            listUser              = new List <User>();
            listMessAwaitID       = new List <ucUserINChatBox>();
            listFileAwaitID       = new List <ucUserINChatBox>();
            GroupUIs              = new List <GroupUI>();
            listGroup             = new List <Group>();
            frmContactBook        = new FrmContactBook(this);
            UcGroup               = new ucGroup(this, GroupUIs);
            AddToGroup            = new FrmADDMemberToGroup(this);
            frmADD                = new FrmADD(this);
            frmADDMemberToContact = new FrmADDMemberToContact(this);

            me.AvatarPath = @"./images/avatarDefault/avatarDefault.png";

            LoadDataUser();
            InitServerUsersForm();
            InitFrmFriend();
            InitSettingForm();
            LoadGroupData();
            LoadContactBook();
            if (Theme == "Black")
            {
                ChangeTheme();
            }
            LoadMyData();
            AwaitReadData();
            this.SizeChanged += new EventHandler(Form1_SizeChanged);
        }