/// <summary>
 /// Creates a new message structure.
 /// </summary>
 /// <param name="type">The status type.</param>
 /// <param name="text">The left text.</param>
 /// <param name="image">The left image.</param>
 public ApplicationStatusMessage(ApplicationStatus.StatusType type, string text, Image image)
     : this()
 {
     this.Type = type;
     this.LeftText = text;
     this.LeftImage = image;
 }
 /// <summary>
 /// Creates a new crawler API instance.
 /// </summary>
 /// <param name="config">The crawler configuration.</param>
 /// <param name="database">The database configuration.</param>
 /// <param name="log">The crawler log.</param>
 /// <param name="status">The crawler status.</param>
 public CrawlerApi(CrawlerConfig config, DbConfig database, Logger log, ApplicationStatus status)
 {
     this.config = config;
     this.database = database;
     this.log = log;
     this.status = status;
 }
 /// <summary>
 /// Creates a traceroute application instance.
 /// </summary>
 /// <param name="rootKey">The registry root key.</param>
 /// <param name="rootPath">The registry root path.</param>
 public TracerouteApplication(RegistryKey rootKey, string rootPath)
 {
     // Create the configuration.
     this.config = new TracerouteConfig(rootKey, rootPath);
     // Create the log.
     this.log = new Logger(this.config.LogFileName);
     // Create the status.
     this.status = new ApplicationStatus();
 }
 /// <summary>
 /// Creates a new messge structure.
 /// </summary>
 /// <param name="type">The status type.</param>
 /// <param name="leftText">The left text.</param>
 /// <param name="rightText">The right text.</param>
 /// <param name="leftImage">The left image.</param>
 /// <param name="rightImage">The right image.</param>
 public ApplicationStatusMessage(ApplicationStatus.StatusType type, string leftText, string rightText, Image leftImage, Image rightImage)
     : this()
 {
     this.Type = type;
     this.LeftText = leftText;
     this.RightText = rightText;
     this.LeftImage = leftImage;
     this.RightImage = rightImage;
 }
Exemple #5
0
        public Config(RegistryKey rootKey, string rootPath)
        {
            // Set the registry configuration.
            this.rootKey = rootKey;
            this.rootPath = rootPath;
            this.root = string.Format(@"{0}\{1}", this.rootKey.Name, this.rootPath);

            // Create the application status.
            this.status = new ApplicationStatus();
            // Create the application log.
            this.log = new Logger(this.LogFileName);
        }
 /// <summary>
 /// Sends a notification status message.
 /// </summary>
 /// <param name="type">The status type.</param>
 /// <param name="leftText">The left text.</param>
 /// <param name="rightText">The right text.</param>
 /// <param name="leftImage">The left image.</param>
 /// <param name="rightImage">The right image.</param>
 public void Send(ApplicationStatus.StatusType type, string leftText, string rightText, Image leftImage = null, Image rightImage = null)
 {
     lock (this.sync)
     {
         // Set the message.
         this.message = new ApplicationStatusMessage(type, leftText, rightText, leftImage, rightImage);
         // Call the delegate.
         this.actionSend(this);
     }
 }
 /// <summary>
 /// Sends a notification status message.
 /// </summary>
 /// <param name="type">The status type.</param>
 /// <param name="text">The left text.</param>
 /// <param name="image">The left image.</param>
 public void Send(ApplicationStatus.StatusType type, string text, Image image)
 {
     lock (this.sync)
     {
         // Set the message.
         this.message = new ApplicationStatusMessage(type, text, image);
         // Call the delegate.
         this.actionSend(this);
     }
 }
        /// <summary>
        /// Creates a new crawer global object, based on a configuration from the specified root registry key.
        /// </summary>
        /// <param name="rootKey">The root registry key.</param>
        /// <param name="rootPath">The root registry path.</param>
        public Crawler(RegistryKey rootKey, string rootPath)
        {
            // Create the configuration.
            this.config = new CrawlerConfig(rootKey, rootPath);

            // Create the crawler events.
            this.events = new CrawlerEvents();

            // Create the logger.
            this.log = new Logger(this.config.LogFileName);

            // Create the database servers.
            this.dbConfig = new DbConfig(this, rootKey, rootPath + @"\Database");

            // Create the PlanetLab configuration.
            this.plConfig = new PlConfig(rootKey, rootPath + @"\PlanetLab");

            // Create the YouTube configuration.
            this.ytConfig = new YtConfig(this.config);

            // Create the status.
            this.status = new ApplicationStatus();

            // Create the comments.
            this.comments = new CrawlerComments(this.config);

            // Create the crawler spiders.
            this.spiders = new Spiders(this);

            // Create the crawler API.
            this.api = new CrawlerApi(this.config, this.dbConfig, this.log, this.status);

            // Create the toolbox.
            this.toolbox = new Toolbox(this, rootKey, rootPath + @"\Toolbox");
        }
 /// <summary>
 /// Creates a new message structure.
 /// </summary>
 /// <param name="type">The status type.</param>
 /// <param name="text">The left text.</param>
 public ApplicationStatusMessage(ApplicationStatus.StatusType type, string text)
     : this()
 {
     this.Type = type;
     this.LeftText = text;
 }