예제 #1
0
        /// <summary>
        /// Initializes a new instance of
        /// <see cref="Kamilla.Network.Viewing.Plugins.PluginCommand"/> class
        /// with the specified command information.
        /// </summary>
        /// <param name="plugin">
        /// The plugin to which the current command belongs.
        /// </param>
        /// <param name="title">
        /// The localized title string of the current command.
        /// </param>
        /// <param name="gesture">
        /// The key gesture that can be used to call the current command. This value can be null.
        /// </param>
        /// <param name="callback">
        /// The delegate that is called when the command is executed.
        /// </param>
        public PluginCommand(INetworkLogViewerPlugin plugin, string title, KeyGesture gesture, Action callback)
        {
            if (plugin == null)
            {
                throw new ArgumentNullException("plugin");
            }

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

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

            title = title.Trim();
            if (title == string.Empty)
            {
                throw new ArgumentException("title must not be empty.", "title");
            }

            this.Plugin   = plugin;
            this.Title    = title;
            this.Gesture  = gesture;
            this.Callback = callback;
        }
예제 #2
0
        public static INetworkLogViewerPlugin[] CreatePluginSet()
        {
            if (!s_initialized)
                Initialize();

            var count = s_plugins.Length;
            var result = new INetworkLogViewerPlugin[count];

            for (int i = 0; i < count; i++)
                result[i] = (INetworkLogViewerPlugin)Activator.CreateInstance(s_plugins[i]);

            return result;
        }
예제 #3
0
        public static INetworkLogViewerPlugin[] CreatePluginSet()
        {
            if (!s_initialized)
            {
                Initialize();
            }

            var count  = s_plugins.Length;
            var result = new INetworkLogViewerPlugin[count];

            for (int i = 0; i < count; i++)
            {
                result[i] = (INetworkLogViewerPlugin)Activator.CreateInstance(s_plugins[i]);
            }

            return(result);
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of
        /// <see cref="Kamilla.Network.Viewing.Plugins.PluginCommand"/> class
        /// with the specified command information.
        /// </summary>
        /// <param name="plugin">
        /// The plugin to which the current command belongs.
        /// </param>
        /// <param name="title">
        /// The localized title string of the current command.
        /// </param>
        /// <param name="gesture">
        /// The key gesture that can be used to call the current command. This value can be null.
        /// </param>
        /// <param name="callback">
        /// The delegate that is called when the command is executed.
        /// </param>
        public PluginCommand(INetworkLogViewerPlugin plugin, string title, KeyGesture gesture, Action callback)
        {
            if (plugin == null)
                throw new ArgumentNullException("plugin");

            if (title == null)
                throw new ArgumentNullException("title");

            if (callback == null)
                throw new ArgumentNullException("callback");

            title = title.Trim();
            if (title == string.Empty)
                throw new ArgumentException("title must not be empty.", "title");

            this.Plugin = plugin;
            this.Title = title;
            this.Gesture = gesture;
            this.Callback = callback;
        }