Exemple #1
0
 /// <summary>
 /// Execute the command.
 /// </summary>
 public override void execute()
 {
     CadKit.Interfaces.IRenderLoop renderLoop = CadKit.Documents.Manager.Instance.ActiveView as CadKit.Interfaces.IRenderLoop;
     if (null != renderLoop)
     {
         renderLoop.UseRenderLoop = !renderLoop.UseRenderLoop;
     }
 }
Exemple #2
0
        /// <summary>
        /// Execute the command.
        /// </summary>
        public override void execute()
        {
            try
            {
                CadKit.Helios.OptionsForm form = new CadKit.Helios.OptionsForm("CadKit.Plugins.LayerManager.AddLayer");
                form.Owner = CadKit.Helios.Application.Instance.MainForm;
                form.Icon  = CadKit.Helios.Application.Instance.MainForm.Icon;
                form.Text  = CadKit.Helios.Application.Instance.Name + " - Options";
                this._addPages(form);
                if (form.NumPages > 0)
                {
                    CadKit.Interfaces.IRenderLoop renderLoop = CadKit.Documents.Manager.Instance.ActiveView as CadKit.Interfaces.IRenderLoop;

                    bool useRenderLoop = false;

                    // Turn off render loop before we show the dialog.
                    if (null != renderLoop)
                    {
                        useRenderLoop            = renderLoop.UseRenderLoop;
                        renderLoop.UseRenderLoop = false;
                    }

                    try
                    {
                        if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            _form.addLayers();
                        }
                    }
                    finally
                    {
                        // Restore the render loop state.
                        if (null != renderLoop)
                        {
                            renderLoop.UseRenderLoop = useRenderLoop;
                        }
                    }
                }
            }
            catch (System.Exception e)
            {
                System.Console.WriteLine("Error 1648821079: Failed to show options dialog: {0}", e.Message);
            }
        }
Exemple #3
0
 /// <summary>
 /// Determine if the button is checked.
 /// </summary>
 protected override bool _isChecked()
 {
     CadKit.Interfaces.IRenderLoop renderLoop = CadKit.Documents.Manager.Instance.ActiveView as CadKit.Interfaces.IRenderLoop;
     return((null == renderLoop) ? false : renderLoop.UseRenderLoop);
 }
Exemple #4
0
 /// <summary>
 /// Determine if the button should be enabled.
 /// </summary>
 protected override bool _shouldBeEnabled()
 {
     CadKit.Interfaces.IRenderLoop renderLoop = CadKit.Documents.Manager.Instance.ActiveView as CadKit.Interfaces.IRenderLoop;
     return(null != renderLoop);
 }