private void DisposeUC() { if (null != ucLogin) { ucLogin.Dispose(); ucLogin = null; } }
private void AddUC(DetectionParamsItem detectionItem) { DisposeUC(); if (null == ucLogin) { ucLogin = new UCXBoxLogin(detectionItem, XBOXLogManager.Instance) { Dock = DockStyle.Fill }; panelWeb.Controls.Add(ucLogin); } }
private void FrmTest_Load(object sender, EventArgs e) { DetectionParamsItem paramsItem = new DetectionParamsItem(); paramsItem.CurrentGameServer = GameServers.XBOXServer; AccountItem account = new AccountItem(); account.User = "******"; account.Password = "******"; UCXBoxLogin uc = new UCXBoxLogin(paramsItem, XBOXLogManager.Instance) { Dock = DockStyle.Fill }; panel1.Controls.Add(uc); using (uc) { uc.GetState(account, new AutoResetEvent(false)); } }