Beispiel #1
0
        public override void DocumentContextChanged(Grasshopper.Kernel.GH_Document document, Grasshopper.Kernel.GH_DocumentContext context)
        {
            base.DocumentContextChanged(document, context);
            if (context == Grasshopper.Kernel.GH_DocumentContext.Loaded)
            {
                //Rhino.RhinoDoc.ReplaceRhinoObject += RhinoDoc_ReplaceRhinoObject;

                timer          = new System.Windows.Forms.Timer();
                timer.Tick    += timer_Tick;
                timer.Enabled  = false;
                timer.Interval = 1;

                // register evens

                keyboardHook.KeyDown     = new RamGecTools.KeyboardHook.KeyboardHookCallback(keyboardHook_KeyDown);
                keyboardHook.KeyUp       = new RamGecTools.KeyboardHook.KeyboardHookCallback(keyboardHook_KeyUp);
                keyboardHook._activate   = new RamGecTools.KeyboardHook.activate(activate);
                keyboardHook._deactivate = new RamGecTools.KeyboardHook.deactivate(deactivate);
                keyboardHook.Uninstall();

                keyboardHook.Install();
                full = new mikity.visualize.fullScreen(DEV);
                full.deactivate();
                full.Show();
                full.resetGo();
                full.drift1();
                full.renewPlot(Drift1);
                full.onRF();
                if (!DEV)
                {
                    full.onNorm();
                    _normalize = true;
                }
                else
                {
                    full.offNorm();
                    _normalize = false;
                }
                full.onGeo();
                full.offVN();
                full.offIF();
            }
            if (context == Grasshopper.Kernel.GH_DocumentContext.Unloaded)
            {
                keyboardHook.Uninstall();
                keyboardHook.KeyDown -= new RamGecTools.KeyboardHook.KeyboardHookCallback(keyboardHook_KeyDown);
                keyboardHook.KeyUp   -= new RamGecTools.KeyboardHook.KeyboardHookCallback(keyboardHook_KeyUp);
                if (full != null)
                {
                    full.Close();
                    full = null;
                }
            }
        }
Beispiel #2
0
 public override void RemovedFromDocument(Grasshopper.Kernel.GH_Document document)
 {
     base.RemovedFromDocument(document);
     keyboardHook.Uninstall();
     keyboardHook.KeyDown -= new RamGecTools.KeyboardHook.KeyboardHookCallback(keyboardHook_KeyDown);
     keyboardHook.KeyUp   -= new RamGecTools.KeyboardHook.KeyboardHookCallback(keyboardHook_KeyUp);
     if (full != null)
     {
         full.Close();
         full = null;
     }
     if (timer != null)
     {
         timer = null;
     }
 }