private void RegisterServicesAndPlugins()
        {
            var registrations = new Registrations();

            // (don't care about sql version for rule configuration)
            registrations.RegisterServices(SqlVersion.Sql120, false);

            var pluginLoader      = IocContainer.Instance.Resolve <IPluginLoaderService>();
            var pluginLoadResults = pluginLoader.LoadPlugins();

            foreach (var pluginLoadResult in pluginLoadResults)
            {
                if (pluginLoadResult.SuccessfullyLoaded)
                {
                    var ruleTypes = pluginLoadResult.PluginServices.GetRuleTypes();
                    registrations.RegisterRuleTypes(ruleTypes);

                    var configControlTypes = pluginLoadResult.PluginServices.GetConfigControlTypes();
                    registrations.RegisterConfigControlTypes(configControlTypes);
                }
            }
            IocContainer.Instance.VerifyResolutions();

            // Todo improve...
            IocContainer.Instance.Register <IWinFormsRuleConfigurationControl, RuleConfigurationControl>(setup: Setup.With(allowDisposableTransient: true));
        }
        private static void RegisterServicesAndPlugins(SqlVersion sqlVersion, bool initialQuotedIdentifiers)
        {
            var registrations = new Registrations();

            registrations.RegisterServices(sqlVersion, initialQuotedIdentifiers);

            Logger.Info("Plugins:");
            var pluginLoader      = IocContainer.Instance.Resolve <IPluginLoaderService>();
            var pluginLoadResults = pluginLoader.LoadPlugins();

            foreach (var pluginLoadResult in pluginLoadResults)
            {
                if (pluginLoadResult.SuccessfullyLoaded)
                {
                    Logger.Info($"  Assembly: {pluginLoadResult.AssemblyFullName}");
                    Logger.Info($"  Name: {pluginLoadResult.PluginServices.Information.Name}, Description: {pluginLoadResult.PluginServices.Information.Description}");
                    var ruleTypes = pluginLoadResult.PluginServices.GetRuleTypes();
                    Logger.Info($"  {ruleTypes.Count} Ruletypes: {string.Join(", ", ruleTypes)}");
                    registrations.RegisterRuleTypes(ruleTypes);
                }
                foreach (var loadMessage in pluginLoadResult.LoadMessages)
                {
                    Logger.Info($"  Message:{loadMessage.Severity} {loadMessage.Message}");
                }
            }

            if (!pluginLoadResults.Any(x => x.SuccessfullyLoaded))
            {
                Logger.Warn("No rule plugins found in base directory.");
            }

            IocContainer.Instance.VerifyResolutions();
        }
        private Registrations RegisterServices()
        {
            var registrations = new Registrations();

            // Todo :-(  improve design...
            registrations.Reset();
            var sqlVersion = (SqlVersion)Enum.Parse(typeof(SqlVersion), (string)comboBoxSqlVersion.SelectedItem);

            registrations.RegisterServices(sqlVersion, checkBoxInitialQuotedIdentifiers.Checked);
            return(registrations);
        }