Пример #1
0
 public static void ShowHide(this System.Windows.Forms.Control ctrl)
 {
     if (ctrl.Visible)
     {
         ctrl.Hide();
     }
     else
     {
         ctrl.Show();
     }
 }
Пример #2
0
 public void Start()
 {
     target = new System.Windows.Forms.Form();
     target.Show();
     target.Update();
     ready = true;
     StartInternal();
     PhysicsThread      = new Thread(new ThreadStart(PhysicsLoop));
     PhysicsThread.Name = "Physics thread";
     RenderThread.Start();
     PhysicsThread.Start();
     MainLoop();
 }
Пример #3
0
 private void StartInternal()
 {
     running           = true;
     graphic_invoke    = new Queue <Action>();
     physics_invoke    = new Queue <Action>();
     logic_invoke      = new Queue <Action>();
     resource_invoke   = new Queue <Action>();
     scene             = new Glorg2.Scene.Scene(this);
     RenderThread      = new System.Threading.Thread(new System.Threading.ThreadStart(RenderLoop));
     RenderThread.Name = "Rendering thread";
     target.Show();
     target.HandleDestroyed += (sender, e) => { running = false; System.Windows.Forms.Application.Exit(); };
     Scene.ParentNode.InternalPostSerialize();
 }
Пример #4
0
        /// <summary>
        /// Called when the selected page changed.
        /// </summary>
        private void _selectedPageChanged(object sender, System.EventArgs args)
        {
            lock (_mutex)
            {
                try
                {
                    System.Windows.Forms.ListView lv = sender as System.Windows.Forms.ListView;
                    if (null == lv || null == lv.SelectedItems || lv.SelectedItems.Count < 1)
                    {
                        return;
                    }

                    int index = lv.SelectedItems[0].Index;
                    CadKit.Interfaces.IOptionsPage page = ((index >= 0 && index < _pages.Count) ? _pages[index] : null);
                    if (null == page)
                    {
                        return;
                    }

                    System.Windows.Forms.Control contents = page.Contents as System.Windows.Forms.Control;
                    if (null == contents)
                    {
                        return;
                    }

                    _contentPanel.Controls.Clear();
                    _contentPanel.Controls.Add(contents);
                    contents.Dock = System.Windows.Forms.DockStyle.Fill;
                    contents.Show();
                }
                catch (System.Exception e)
                {
                    System.Console.WriteLine("Error 7515917920: {0}", e.Message);
                }
            }
        }
Пример #5
0
 public void StartAsync()
 {
     target = new System.Windows.Forms.Form();
     target.Show();
     target.Update();
     ready = true;
     StartInternal();
     LogicThread = new System.Threading.Thread(new System.Threading.ThreadStart(MainLoop));
     LogicThread.Name = "Logic thread";
     PhysicsThread = new Thread(new ThreadStart(PhysicsLoop));
     PhysicsThread.Name = "Physics thread";
     RenderThread.Start();
     LogicThread.Start();
     PhysicsThread.Start();
 }