Beispiel #1
0
 /// <summary>
 /// The constructor is private so that only the class itself can create an instance.
 /// </summary>
 private PluginSettings()
 {
     settings                        = new USPluginSettings();
     settings.Threshold              = 1000;
     settings.SelectionSize          = 10000;
     settings.SelectionMode          = false;
     settings.PauseBetweenOperations = false;
     settings.PauseDelay             = 0;
     settings.UseTransactions        = false;
     settings.DBTimeout              = 60;
     dbProvider                      = DBConnectionStringProvider.Instance();
     connectionString                = dbProvider.ProvideDBConnectionString(Assembly.GetExecutingAssembly().GetName().Name);
     LoadSettings();
 }
Beispiel #2
0
 /// <summary>
 /// The constructor is private so that only the class itself can create an instance.
 /// </summary>
 private PluginSettings()
 {
     settings = new USPluginSettings();
     settings.Threshold = 1000;
     settings.SelectionSize = 10000;
     settings.SelectionMode = false;
     settings.PauseBetweenOperations = false;
     settings.PauseDelay = 0;
     settings.UseTransactions = false;
     settings.DBTimeout = 60;
     dbProvider = DBConnectionStringProvider.Instance();
     connectionString = dbProvider.ProvideDBConnectionString(Assembly.GetExecutingAssembly().GetName().Name);
     LoadSettings();
 }
Beispiel #3
0
        /// <summary>
        /// Loads the settings of the plugin from the configuration file.
        /// </summary>
        internal void LoadSettings()
        {
            string configFile = GetPluginPath() + "CrawlWave.ServerPlugins.UrlSelection.Config.xml";

            try
            {
                if (!File.Exists(configFile))
                {
                    //perhaps the file does not exist - probably because it has not been
                    //created yet. In this case just let the class retain default values.
                    return;
                }
                Stream        ReadStream = File.Open(configFile, FileMode.Open);
                XmlSerializer serializer = new XmlSerializer(typeof(USPluginSettings));
                settings = (USPluginSettings)serializer.Deserialize(ReadStream);
                ReadStream.Close();
            }
            catch
            {}
        }
Beispiel #4
0
 /// <summary>
 /// Loads the settings of the plugin from the configuration file.
 /// </summary>
 internal void LoadSettings()
 {
     string configFile = GetPluginPath()+"CrawlWave.ServerPlugins.UrlSelection.Config.xml";
     try
     {
         if(!File.Exists(configFile))
         {
             //perhaps the file does not exist - probably because it has not been
             //created yet. In this case just let the class retain default values.
             return;
         }
         Stream ReadStream=File.Open(configFile, FileMode.Open);
         XmlSerializer serializer=new XmlSerializer(typeof(USPluginSettings));
         settings=(USPluginSettings)serializer.Deserialize(ReadStream);
         ReadStream.Close();
     }
     catch
     {}
 }