Beispiel #1
0
        private bool RaiseNewPlugin(string newPluginName, IServiceInfo service, Dictionary <IServiceInfo, DependencyRequirement> serviceReferences)
        {
            if (NewPluginCreated != null)
            {
                NewPluginEventArgs args = new NewPluginEventArgs()
                {
                    PluginName        = newPluginName,
                    Service           = service,
                    ServiceReferences = serviceReferences
                };

                // Raise event
                NewPluginCreated(this, args);

                if (args.CancelReason != null)
                {
                    MessageBox.Show(args.CancelReason, "Couldn't create plugin", MessageBoxButton.OK, MessageBoxImage.Stop, MessageBoxResult.OK);
                    return(false);
                }
            }

            return(true);
        }
        private bool RaiseNewPlugin( string newPluginName, IServiceInfo service, Dictionary<IServiceInfo, DependencyRequirement> serviceReferences )
        {
            if( NewPluginCreated != null )
            {
                NewPluginEventArgs args = new NewPluginEventArgs()
                {
                    PluginName = newPluginName,
                    Service = service,
                    ServiceReferences = serviceReferences
                };

                // Raise event
                NewPluginCreated( this, args );

                if( args.CancelReason != null )
                {
                    MessageBox.Show( args.CancelReason, "Couldn't create plugin", MessageBoxButton.OK, MessageBoxImage.Stop, MessageBoxResult.OK );
                    return false;
                }
            }

            return true;
        }