Ejemplo n.º 1
0
        /// <summary>
        /// Constructs a new instance of the <see cref="ClientSettings"/> class and attempts
        /// to load the settings from the provided file.
        /// </summary>
        /// <param name="fileName">The path of the configuration file.</param>
        public ClientSettings(string fileName)
        {
            if ((fileName == null) || (fileName == String.Empty))
            {
                throw new ArgumentException("The filename cannot be empty");
            }
            LoadAtStartup   = false;
            MinimizeToTray  = false;
            MinimizeOnExit  = false;
            EnableScheduler = false;
            StartTime       = DateTime.Now;
            StopTime        = DateTime.Now;
            UserID          = 0;
            UserName        = String.Empty;
            Password        = null;
            Email           = String.Empty;
            ClientID        = Guid.Empty;
            HardwareInfo    = 0;
            LogLevel        = CWLogLevel.LogInfo;
            ConnectionSpeed = CWConnectionSpeed.Unknown;

            RemotingHost     = "localhost";
            RemotingProtocol = "tcp";
            RemotingPort     = 15461;

            configFile = fileName;
            LoadSettings();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// The constructor is private so that only the class itself can create an instance.
 /// </summary>
 private ServerSettings()
 {
     appName = "CrawlWave.Server";
     log = new SystemEventLogger(appName);
     logLevel = CWLogLevel.LogError; // by default assume only errors must be logged
     dbLogOptions = CWClientActions.LogNothing; //by default assume it's a production rel.
     dataFilesPath = String.Empty;
     connectionString = String.Empty;
     LoadSettings();
     robots = RobotsCache.Instance();
     robots.DBConnectionString = ProvideConnectionString();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// The constructor is private so that only the class itself can create an instance.
 /// </summary>
 private ServerSettings()
 {
     appName          = "CrawlWave.Server";
     log              = new SystemEventLogger(appName);
     logLevel         = CWLogLevel.LogError;        // by default assume only errors must be logged
     dbLogOptions     = CWClientActions.LogNothing; //by default assume it's a production rel.
     dataFilesPath    = String.Empty;
     connectionString = String.Empty;
     LoadSettings();
     robots = RobotsCache.Instance();
     robots.DBConnectionString = ProvideConnectionString();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Loads the server's settings from the Web.config configuration file
 /// </summary>
 private void LoadSettings()
 {
     try
     {
         logLevel      = (CWLogLevel)(Properties.Settings.Default.LogLevel);
         dbLogOptions  = (CWClientActions)(Properties.Settings.Default.DBLogOptions);
         remotingPort  = Properties.Settings.Default.RemotingPort;
         dataFilesPath = Properties.Settings.Default.DataFilesPath;
         string sqlServer = Properties.Settings.Default.SQLServer;
         string sqlLogin  = Properties.Settings.Default.SQLLogin;
         string sqlPass   = Properties.Settings.Default.SQLPass;
         connectionString = "Password="******";Persist Security Info=True;User ID=" + sqlLogin + ";Initial Catalog=CrawlWave;Data Source=" + sqlServer + ";";
     }
     catch
     { }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructs an instance of the <see cref="AppSettings"/> class with the default values.
 /// </summary>
 public AppSettings()
 {
     LoadAtStartup   = false;
     MinimizeToTray  = false;
     MinimizeOnExit  = false;
     EnableScheduler = false;
     StartTime       = DateTime.Now;
     StopTime        = DateTime.Now;
     UserID          = 0;
     UserName        = String.Empty;
     Password        = null;
     Email           = String.Empty;
     ClientID        = Guid.Empty;
     HardwareInfo    = 0;
     LogLevel        = CWLogLevel.LogInfo;
     ConnectionSpeed = CWConnectionSpeed.Unknown;
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Constructs an instance of the <see cref="ClientSettings"/> class with the default values.
        /// </summary>
        public ClientSettings()
        {
            LoadAtStartup   = false;
            MinimizeToTray  = false;
            MinimizeOnExit  = false;
            EnableScheduler = false;
            StartTime       = DateTime.Now;
            StopTime        = DateTime.Now;
            UserID          = 0;
            UserName        = String.Empty;
            Password        = null;
            Email           = String.Empty;
            ClientID        = Guid.Empty;
            HardwareInfo    = 0;
            LogLevel        = CWLogLevel.LogInfo;
            ConnectionSpeed = CWConnectionSpeed.Unknown;

            RemotingHost     = "localhost";
            RemotingProtocol = "tcp";
            RemotingPort     = 15461;

            configFile = String.Empty;
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Loads the server's settings from the Web.config configuration file
        /// </summary>
        private void LoadSettings()
        {
            try
            {

                logLevel = (CWLogLevel)(Properties.Settings.Default.LogLevel);
                dbLogOptions = (CWClientActions)(Properties.Settings.Default.DBLogOptions);
                remotingPort = Properties.Settings.Default.RemotingPort;
                dataFilesPath = Properties.Settings.Default.DataFilesPath;
                string sqlServer = Properties.Settings.Default.SQLServer;
                string sqlLogin = Properties.Settings.Default.SQLLogin;
                string sqlPass = Properties.Settings.Default.SQLPass;
                connectionString = "Password="******";Persist Security Info=True;User ID=" + sqlLogin + ";Initial Catalog=CrawlWave;Data Source=" + sqlServer + ";";
            }
            catch
            { }
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Constructs an instance of the <see cref="AppSettings"/> class with the default values.
 /// </summary>
 public AppSettings()
 {
     LoadAtStartup = false;
     MinimizeToTray = false;
     MinimizeOnExit = false;
     EnableScheduler = false;
     StartTime = DateTime.Now;
     StopTime = DateTime.Now;
     UserID = 0;
     UserName = String.Empty;
     Password = null;
     Email = String.Empty;
     ClientID = Guid.Empty;
     HardwareInfo = 0;
     LogLevel = CWLogLevel.LogInfo;
     ConnectionSpeed = CWConnectionSpeed.Unknown;
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Constructs a new instance of the <see cref="ClientSettings"/> class and attempts
        /// to load the settings from the provided file.
        /// </summary>
        /// <param name="fileName">The path of the configuration file.</param>
        public ClientSettings(string fileName)
        {
            if((fileName == null)||(fileName == String.Empty))
            {
                throw new ArgumentException("The filename cannot be empty");
            }
            LoadAtStartup = false;
            MinimizeToTray = false;
            MinimizeOnExit = false;
            EnableScheduler = false;
            StartTime = DateTime.Now;
            StopTime = DateTime.Now;
            UserID = 0;
            UserName = String.Empty;
            Password = null;
            Email = String.Empty;
            ClientID = Guid.Empty;
            HardwareInfo = 0;
            LogLevel = CWLogLevel.LogInfo;
            ConnectionSpeed = CWConnectionSpeed.Unknown;

            RemotingHost = "localhost";
            RemotingProtocol = "tcp";
            RemotingPort = 15461;

            configFile = fileName;
            LoadSettings();
        }
Ejemplo n.º 10
0
        private string configFile; // holds the path of the configuration file

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Constructs an instance of the <see cref="ClientSettings"/> class with the default values.
        /// </summary>
        public ClientSettings()
        {
            LoadAtStartup = false;
            MinimizeToTray = false;
            MinimizeOnExit = false;
            EnableScheduler = false;
            StartTime = DateTime.Now;
            StopTime = DateTime.Now;
            UserID = 0;
            UserName = String.Empty;
            Password = null;
            Email = String.Empty;
            ClientID = Guid.Empty;
            HardwareInfo = 0;
            LogLevel = CWLogLevel.LogInfo;
            ConnectionSpeed = CWConnectionSpeed.Unknown;

            RemotingHost = "localhost";
            RemotingProtocol = "tcp";
            RemotingPort = 15461;

            configFile = String.Empty;
        }