/// <since>5.0</since> public static void RegisterGripsEnabler(TurnOnGripsEventHandler enabler, Type customGripsType) { if (!customGripsType.IsSubclassOf(typeof(CustomObjectGrips))) { throw new ArgumentException("customGripsType must be derived from CustomObjectGrips"); } if (enabler == null) { throw new ArgumentNullException("enabler"); } Guid key = customGripsType.GUID; if (m_registered_enablers.ContainsKey(key)) { m_registered_enablers[key] = enabler; } else { // This is a new enabler that needs to be registerer with RhinoApp() m_registered_enablers.Add(key, enabler); UnsafeNativeMethods.CRhinoApp_RegisterGripsEnabler(key, m_TurnOnGrips); } }
public static void RegisterGripsEnabler(TurnOnGripsEventHandler enabler, Type customGripsType) { if (!customGripsType.IsSubclassOf(typeof(CustomObjectGrips))) throw new ArgumentException("customGripsType must be derived from CustomObjectGrips"); if (enabler == null) throw new ArgumentNullException("enabler"); Guid key = customGripsType.GUID; if (m_registered_enablers.ContainsKey(key)) m_registered_enablers[key] = enabler; else { // This is a new enabler that needs to be registerer with RhinoApp() m_registered_enablers.Add(key, enabler); UnsafeNativeMethods.CRhinoApp_RegisterGripsEnabler(key, m_TurnOnGrips); } }