コード例 #1
0
        /// <summary>
        /// Calls the Start method of the Plugin class.
        /// </summary>
        /// <param name="context">The PluginContext that is hosting this Plugin instance.</param>
        /// <param name="e">EventArgs that contain a PluginDescriptor with meta-data about the Plugin instance.</param>
        internal void OnStart(PluginContext context, PluginDescriptorEventArgs e)
        {
            try
            {
                SingletonLogger.Instance.Debug(string.Format("Starting Plugin, Plugin: '{0}'.", e.Descriptor.PluginName));

                // inform the plugin that it should start its services
                Start(context, e);

                _CairoShell.DoEvents(); // Since we are WPF we use this DoEvents instead of the Application.DoEvents from System.Windows.Forms

                // fire the PluginStarted event of the PluginContext
                context.OnPluginStarted(e);
            }
            catch (Exception ex)
            {
                SingletonLogger.Instance.Debug(ex.Message, ex);
            }
        }