示例#1
0
        public ToolMenuItemExt(string text, IToolPlugin tool, ExternalToolNotify chghnd)
        {
            this.tool        = tool;
            this.Text        = text;
            this.ToolTipText = text;
            Checked          = false;
            Click           += new EventHandler(LinkClicked);
            Click           += new EventHandler(ClickItem);
            chghandler       = chghnd;

            name = tool.GetType().Namespace + "." + tool.GetType().Name;
        }
示例#2
0
 public void Register(IToolPlugin tool)
 {
     if (tool != null)
     {
         if (tool.GetType().GetInterface("SimPe.Interfaces.IDockableTool", true) == typeof(SimPe.Interfaces.IDockableTool))
         {
             if (!dtools.Contains(tool))
             {
                 dtools.Add((SimPe.Interfaces.IDockableTool)tool);
             }
         }
         else if (tool.GetType().GetInterface("SimPe.Interfaces.IToolAction", true) == typeof(SimPe.Interfaces.IToolAction))
         {
             if (!atools.Contains(tool))
             {
                 atools.Add((SimPe.Interfaces.IToolAction)tool);
             }
         }
         else if (tool.GetType().GetInterface("SimPe.Interfaces.IToolPlus", true) == typeof(SimPe.Interfaces.IToolPlus))
         {
             if (!toolsp.Contains(tool))
             {
                 toolsp.Add((SimPe.Interfaces.IToolPlus)tool);
             }
         }
         else if (Helper.StartedGui != Executable.Classic && tool.GetType().GetInterface("SimPe.Interfaces.IListener", true) == typeof(SimPe.Interfaces.IListener))
         {
             if (!listeners.Contains((SimPe.Interfaces.IListener)tool))
             {
                 listeners.Add((SimPe.Interfaces.IListener)tool);
             }
         }
         else if (tool.GetType().GetInterface("SimPe.Interfaces.ITool", true) == typeof(SimPe.Interfaces.ITool))
         {
             if (!tools.Contains(tool))
             {
                 tools.Add((SimPe.Interfaces.ITool)tool);
             }
         }
     }
 }