Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MenuListener" /> class.
        /// </summary>
        /// <param name="context">The application context.</param>
        /// <param name="plugin">The plugin.</param>
        /// <param name="sampleDockWindow">The sample dock wi</param>
        public MenuListener(IAppContext context, InitPlugin plugin, SampleDockWindow sampleDockWindow)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            if (plugin == null)
            {
                throw new ArgumentNullException("plugin");
            }

            if (sampleDockWindow == null)
            {
                throw new ArgumentNullException("sampleDockWindow");
            }

            // Save to local properties:
            _context          = context;
            _sampleDockWindow = sampleDockWindow;
            _plugin           = plugin;

            // Create event handlers:
            plugin.ItemClicked += Plugin_ItemClicked;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MenuGenerator"/> class.
        /// </summary>
        /// <param name="context">
        /// The application context.
        /// </param>
        /// <param name="plugin">
        /// The plugin.
        /// </param>
        public MenuGenerator(IAppContext context, InitPlugin plugin)
        {
            _commands = new MenuCommands(plugin.Identity);

            // Create the toolbar:
            InitToolbar(context, plugin.Identity);

            // Create new top-level menu:
            InitMenu(context, plugin.Identity);
        }