public string VdaInitialization(string serverIp, string userName, string password) { MyLog4Net.Container.Instance.Log.Debug("COMLibrary VdaInitialization "); Trace.WriteLine(string.Format("COMLibrary VdaInitialization {0} {1} {2}", serverIp, userName, password)); OcxMain = new ucXDMain(); OcxMain.Dock = DockStyle.Fill; try { bool ret = OcxMain.LoginWnd(serverIp, userName, password); this.Controls.Add(OcxMain); OcxMain.InitWnd(); m_isInited = true; MyLog4Net.Container.Instance.Log.Debug("COMLibrary finish VdaInitialization "); return(MakeRetMsg(0, "")); } catch (Exception ex) { m_isInited = false; MyLog4Net.Container.Instance.Log.Debug("COMLibrary finish VdaInitialization error :ret=[-1]" + ex.Message); return(MakeRetMsg(-1, ex.Message)); } }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { Framework.Environment.IsCloseMainForm = true; this.Controls.Clear(); c = null; Framework.Container.Instance.Cleanup(); }
public string VdaUninitialization() { MyLog4Net.Container.Instance.Log.Debug("COMLibrary VdaUninitialization"); if (!m_isInited) { return(MakeRetMsg(-1, "未初始化")); } try { this.Controls.Clear(); OcxMain = null; Framework.Container.Instance.Cleanup(); m_isInited = false; MyLog4Net.Container.Instance.Log.Debug("COMLibrary finish VdaUninitialization"); return(MakeRetMsg(0, "")); } catch (SDKCallException ex) { m_isInited = false; MyLog4Net.Container.Instance.Log.Debug("COMLibrary finish VdaUninitialization error :ret=[" + ex.ErrorCode + "]" + ex.Message); return(MakeRetMsg((int)ex.ErrorCode, ex.Message)); } }
private void MainForm_Load(object sender, EventArgs e) { //Framework.Container.Instance.VVMDataBindings.AddBinding(this, "Text", m_viewModel, "ComposedCaption"); c = new ucXDMain(); this.panel1.Controls.Add(c); c.Dock = DockStyle.Fill; this.Text = "XD " + Framework.Environment.VersionDetail; }