Esempio n. 1
0
        private void FXStudioForm_Load(object sender, EventArgs e)
        {
            string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "FXStudio.Layout.config");

            if (File.Exists(configFile))
            {
                panelAllView.LoadFromXml(configFile, m_dockContent);
            }
            else
            {
                ResetLayout();
            }

            panelAllView.DockLeftPortion  = panelAllView.Width * 0.20d;
            panelAllView.DockRightPortion = panelAllView.DockLeftPortion;

            IntPtr hInstance   = Marshal.GetHINSTANCE(this.GetType().Module);
            var    panelRender = m_RenderView.GetRenderPanel();

            m_messageHandler.ResetRenderPanel(panelRender);

            try
            {
                if (!RenderMethods.CreateInstance(hInstance, IntPtr.Zero, panelRender.Handle, 1, panelRender.Width, panelRender.Height))
                {
                    this.Close();
                }

                if (panelRender.Width != 0 && panelRender.Height != 0)
                {
                    RenderMethods.ResizeWnd(panelRender.Width, panelRender.Height);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                this.Close();
            }
        }