Beispiel #1
0
        //public static Dialog.ImageBrowser ImageBrowser = new DmxCreator.Dialog.ImageBrowser();

        public Main()
        {
            System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
            InitializeComponent();
            try
            {
                FrameWork.LoadXml();
                FrameWork.LoadScenes();

                LoadFrameworkExplorer();

                LoadFixtureExplorer();

                this.fixtureCtrl1.OnFixtureChanged     += new OnFixtureChangedEvent(fixtureCtrl1_OnFixtureChanged);
                this.fixtureConfCtrl1.OnFixtureChanged += new OnFixtureChangedEvent(fixtureCtrl1_OnFixtureChanged);

                this.workspaceTree1.OnRealFixtureSelected    += new OnRealFixtureSelectedDelegate(workspaceTree1_OnRealFixtureSelected);
                this.workspaceTree1.OnVirtualFixtureSelected += new OnVirtualFixtureSelectedDelegate(workspaceTree1_OnVirtualFixtureSelected);

                HideAll();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }
        }
Beispiel #2
0
        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);
            }
        }