The SampleCsDropTarget class
Inheritance: MRhinoDropTarget
Beispiel #1
0
        protected override LoadReturnCode OnLoad(ref string errorMessage)
        {
            DropTarget = new SampleCsDropTarget();

            Panels.RegisterPanel(this, typeof(SampleCsUserControl), "SampleCsDragDrop", null);

            if (Settings.GetBool("DisplayPanelByDefault", true))
            {
                Settings.SetBool("DisplayPanelByDefault", false);
                Panels.OpenPanel(SampleCsUserControl.PanelId);
            }

            return(base.OnLoad(ref errorMessage));
        }
        /// <summary>
        /// Called after the plug-in is loaded and the constructor has been run.
        /// This is a good place to perform any significant initialization,
        /// license checking, and so on.  This function must return 1 for
        /// the plug-in to continue to load.
        /// </summary>
        public override int OnLoadPlugIn()
        {
            // Step 1: Create instance of our drop target
            _dropTarget = new SampleCsDropTarget();
            if (null != _dropTarget)
            {
                // Step 2: Configure the drop target
                _dropTarget.EnableAllowDropOnObject(true);
                _dropTarget.EnableAllowDropOnRhinoView(true);
                _dropTarget.EnableAllowDropOnRhinoLayerListControl(true);
                _dropTarget.EnableDeselectAllOnDrag(true);

                // Step 3: Enable the drop target
                _dropTarget.EnableRhinoDropTarget(true);
            }

            return(1);
        }
        /// <summary>
        /// Called after the plug-in is loaded and the constructor has been run.
        /// This is a good place to perform any significant initialization,
        /// license checking, and so on.  This function must return 1 for
        /// the plug-in to continue to load.
        /// </summary>
        public override int OnLoadPlugIn()
        {
            // Step 1: Create instance of our drop target
              _dropTarget = new SampleCsDropTarget();
              if (null != _dropTarget)
              {
            // Step 2: Configure the drop target
            _dropTarget.EnableAllowDropOnObject(true);
            _dropTarget.EnableAllowDropOnRhinoView(true);
            _dropTarget.EnableAllowDropOnRhinoLayerListControl(true);
            _dropTarget.EnableDeselectAllOnDrag(true);

            // Step 3: Enable the drop target
            _dropTarget.EnableRhinoDropTarget(true);
              }

              return 1;
        }