Example #1
0
        /// <summary>
        /// Runs this plugin passing it the specified Windows forms parent object.
        /// </summary>
        /// <param name="owner">The Windows forms parent object.</param>
        /// <returns>
        /// 	<c>true</c> if the execution was successful; otherwise, <c>false</c>.
        /// </returns>
        public override bool Run(IWin32Window owner)
        {
            try
            {
                base.Log.Verbose(string.Format("Running {0} plugin.", PluginName));
                using (var form = new PluginMainForm())
                {
                    form.Plugin = this;
                    form.ShowDialog(owner);
                }

                return true;
            }
            catch (Exception ex)
            {
                base.Log.Error(ex);
                var message = string.Format(
                    "There was an error while executing plugin {0}:\r\n\r\n{1}", PluginName, ex.Message);
                ErrorBox.Show(owner, message);

                return false;
            }
        }
        /// <summary>
        /// Runs this plugin passing it the specified Windows forms parent object.
        /// </summary>
        /// <param name="owner">The Windows forms parent object.</param>
        /// <returns>
        ///     <c>true</c> if the execution was successful; otherwise, <c>false</c>.
        /// </returns>
        public override bool Run(IWin32Window owner)
        {
            try
            {
                base.Log.Verbose(string.Format("Running {0} plugin.", PluginName));
                using (var form = new PluginMainForm())
                {
                    form.Plugin = this;
                    form.ShowDialog(owner);
                }

                return(true);
            }
            catch (Exception ex)
            {
                base.Log.Error(ex);
                var message = string.Format(
                    "There was an error while executing plugin {0}:\r\n\r\n{1}", PluginName, ex.Message);
                ErrorBox.Show(owner, message);

                return(false);
            }
        }