protected bool RegisterCommand(Rhino.Commands.Command command)
 {
   return CreateCommandsHelper(this, this.NonConstPointer(), command.GetType(), command);
 }
Exemple #2
0
		/// <summary>
		/// Creates a new scope node, moving symbol table information
		/// from "scope" to the new node, and making "scope" a nested
		/// scope contained by the new node.
		/// </summary>
		/// <remarks>
		/// Creates a new scope node, moving symbol table information
		/// from "scope" to the new node, and making "scope" a nested
		/// scope contained by the new node.
		/// Useful for injecting a new scope in a scope chain.
		/// </remarks>
		public static Rhino.Ast.Scope SplitScope(Rhino.Ast.Scope scope)
		{
			Rhino.Ast.Scope result = new Rhino.Ast.Scope(scope.GetType());
			result.symbolTable = scope.symbolTable;
			scope.symbolTable = null;
			result.parent = scope.parent;
			result.SetParentScope(scope.GetParentScope());
			result.SetParentScope(result);
			scope.parent = result;
			result.top = scope.top;
			return result;
		}
 /// <summary>
 /// 
 /// </summary>
 /// <param name="skin"></param>
 /// <returns></returns>
 public static PersistentSettingsManager Create(Rhino.Runtime.Skin skin)
 {
   System.Reflection.Assembly assembly = skin.GetType().Assembly;
   for (int i = 0; i < m_all_managers.Count; i++)
     if (m_all_managers[i].m_assembly == assembly)
       return m_all_managers[i];
   var ps = new PersistentSettingsManager(assembly, Guid.Empty);
   m_all_managers.Add(ps);
   return ps;
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="plugin"></param>
 /// <returns></returns>
 public static PersistentSettingsManager Create(Rhino.PlugIns.PlugIn plugin)
 {
   Guid pluginId = plugin.Id;
   System.Reflection.Assembly assembly = plugin.GetType().Assembly;
   for (int i = 0; i < m_all_managers.Count; i++)
   {
     if (m_all_managers[i].m_assembly == assembly || m_all_managers[i].m_plugin_id == pluginId)
     {
       m_all_managers[i].m_assembly = assembly;
       return m_all_managers[i];
     }
   }
   var ps = new PersistentSettingsManager(assembly, pluginId);
   m_all_managers.Add(ps);
   return ps;
 }
 /// <summary>
 /// PersistentSettingsManager constructor.
 /// </summary>
 /// <param name="skin"></param>
 PersistentSettingsManager(Rhino.Runtime.Skin skin)
 {
   m_plugin_id = Guid.Empty;
   System.Reflection.Assembly assembly = skin.GetType().Assembly;
   SettingsLocal = new PlugInSettings(assembly, m_plugin_id, new PlugInSettings(assembly, m_plugin_id, null));
 }
 PersistentSettingsManager(Rhino.Runtime.Skin skin)
 {
   m_assembly = skin.GetType().Assembly;
   SettingsLocal = new PlugInSettings(m_assembly, new PlugInSettings(m_assembly, null));
 }