Esempio n. 1
0
 IQuerySettings GetSettings()
 {
     if (settings_ != null)
     {
         return(settings_);
     }
     return(new QuerySettings.Loader()
            .Load(
                Path.AbsoluteForCallingAssembly(Strings.kConfigFileName),
                Strings.kConfigRootNode));
 }
Esempio n. 2
0
        public IRubyService CreateService(string command_line_string)
        {
            CommandLine switches = CommandLine.FromString(command_line_string);

            if (switches.HasSwitch("debug"))
            {
                Debugger.Launch();
            }

            string config_file_name = switches
                                      .GetSwitchValue(S.kConfigFileNameSwitch, S.kDefaultConfigFileName);
            string config_root_node = switches
                                      .GetSwitchValue(S.kConfigRootNodeSwitch, S.kDefaultConfigRootNode);

            Settings settings = new Settings.Loader()
                                .Load(Path.AbsoluteForCallingAssembly(config_file_name),
                                      config_root_node);

            var app = new AppFactory(settings);

            return(app.CreateService());
        }