public void Init() { InitializeComponent(); Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false; try { //mFrameWork.StartDmxDevice(); } catch (Exception ex) { MessageBox.Show("could not start dmx interface\r\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } //mFrameWork.StartKeybordListening(); try { mFrameWork.LoadXml(); mFrameWork.LoadScenes(); } catch (Exception ex) { MessageBox.Show("could not load configuration\r\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try { if (File.Exists(DockConfigFile)) { this.dockPanel1.LoadFromXml(DockConfigFile, new DeserializeDockContent(GetContentFromPersistString)); } else { mExplorer = new DmxSoft.Forms.Explorer(mFrameWork); mExplorer.DockPanel = dockPanel1; mExplorer.DockState = WeifenLuo.WinFormsUI.Docking.DockState.DockLeft; mExplorer.Show(); } } catch (Exception ex) { } mSaveTimer = new Timer(); //sauvegarde toute les 5 minutes .... mSaveTimer.Interval = 1000 * 60 * 5; mSaveTimer.Tick += new EventHandler(mSaveTimer_Tick); mSaveTimer.Enabled = true; for (int i = 0; i < DmxFramework.Framework.AutomaticMode.Count; i++) { LoadModeConfigurationItem(i); } }
private void explorerToolStripMenuItem_Click(object sender, EventArgs e) { if (mExplorer != null) { mExplorer.Show(); } else { mExplorer = new DmxSoft.Forms.Explorer(mFrameWork); mExplorer.DockPanel = dockPanel1; mExplorer.DockState = WeifenLuo.WinFormsUI.Docking.DockState.DockLeft; mExplorer.Show(); } }
private void newWorkspaceToolStripMenuItem_Click(object sender, EventArgs e) { //this.dockPanel1.LoadFromXml(DockConfigFile, new DeserializeDockContent(GetContentFromPersistString)); /*foreach (DockContent crl in this.dockPanel1.Contents) * crl.Close(); * * this.dockPanel1.Contents.cl*/ /*while (this.dockPanel1.Documents != null && this.dockPanel1.DocumentsCount != 0) * ((DockContent)((this.dockPanel1.DocumentsToArray())[0])).Close();*/ //IDockContent[] doc = this.dockPanel1.DocumentsToArray(); //for (int i = 0; i < doc.Length; i++) // ((DockContent)doc[i]).Close(); /* foreach (DockContent win in this.dockPanel1.Documents) * win.Close();*/ mExplorer = new DmxSoft.Forms.Explorer(mFrameWork); mExplorer.DockPanel = dockPanel1; mExplorer.DockState = WeifenLuo.WinFormsUI.Docking.DockState.DockLeft; mExplorer.Show(); }
private IDockContent GetContentFromPersistString(string persistString) { if (persistString == typeof(Forms.Explorer).ToString()) { mExplorer = new DmxSoft.Forms.Explorer(mFrameWork); return(mExplorer); } else { string[] parsedStrings = persistString.Split(new char[] { ',' }); if (parsedStrings[0] == typeof(Forms.AdvancedForm).ToString()) { if (parsedStrings.Length > 1) { DmxFramework.Fixtures.Fixture Fixture = mFrameWork.GetFixtureFromPath(parsedStrings[1]); if (Fixture == null) { return(null); } return(new Forms.AdvancedForm(Fixture)); } } else if (parsedStrings[0] == typeof(Forms.ScenePlayer).ToString()) { if (parsedStrings.Length > 1) { return(new Forms.ScenePlayer(mFrameWork.GetFixtureFromPath(parsedStrings[1]))); } } else if (parsedStrings[0] == typeof(Forms.AutoModeConfiguration).ToString()) { if (parsedStrings.Length > 1) { return(new Forms.AutoModeConfiguration(Convert.ToInt16(parsedStrings[1]))); } } else if (parsedStrings[0] == typeof(Forms.DmxOutPut).ToString()) { if (parsedStrings.Length > 1) { DmxFramework.Fixtures.Fixture Fixture = mFrameWork.GetFixtureFromPath(parsedStrings[1]); if (Fixture == null) { return(null); } return(new Forms.DmxOutPut(Fixture)); } else { return(new Forms.DmxOutPut(mFrameWork)); } } else if (parsedStrings[0] == typeof(Forms.SceneExplorer).ToString()) { if (parsedStrings.Length > 1) { return(new Forms.SceneExplorer(mFrameWork.GetFixtureFromPath(parsedStrings[1]))); } } } return(null); }