예제 #1
1
        /// <summary>
        /// Creates a new tool instance.
        /// </summary>
        /// <param name="api">The tool API.</param>
        /// <param name="toolset">The toolset information.</param>
        public ToolMercury(IToolApi api, ToolsetInfoAttribute toolset)
            : base(api, toolset)
        {
            // Create the configuration.
            this.config = new MercuryConfig(api);

            // Create the control.
            this.control = new ControlMercury(this.config);
        }
예제 #2
0
 /// <summary>
 /// Creates a new tool instance.
 /// </summary>
 /// <param name="api">The tool API.</param>
 /// <param name="toolset">The toolset information.</param>
 public ToolCdnFinder(IToolApi api, ToolsetInfoAttribute toolset)
     : base(api, toolset)
 {
     // Create the configuration.
     this.config = new CdnFinderConfig(api);
     // Create the control.
     this.control = new ControlCdnFinder(this.config);
 }
예제 #3
0
        /// <summary>
        /// Creates a new tool instance.
        /// </summary>
        /// <param name="api">The tool API.</param>
        /// <param name="toolset">The toolset information.</param>
        public ToolWebClient(IToolApi api, ToolsetInfoAttribute toolset)
            : base(api, toolset)
        {
            // Create the configuration.
            this.config = new WebClientConfig(api);

            // Initialize the control.
            this.control = new ControlWebClient(this.config);
        }
예제 #4
0
        /// <summary>
        /// Creates a new tool instance.
        /// </summary>
        /// <param name="api">The tool API.</param>
        /// <param name="toolset">The toolset information.</param>
        public ToolTraceroute(IToolApi api, ToolsetInfoAttribute toolset)
            : base(api, toolset)
        {
            // Create the configuration.
            this.config = new TracerouteConfig(api);

            // Initialize the control.
            this.control = new ControlTraceroute(this.config);
        }
예제 #5
0
        /// <summary>
        /// Creates a new tool API instance.
        /// </summary>
        /// <param name="application">The application.</param>
        /// <param name="toolset">The toolset information.</param>
        /// <param name="tool">The tool information.</param>
        /// <param name="key">The registry key for this tool.</param>
        public ToolApi(IDbApplication application, ToolsetInfoAttribute toolset, ToolInfoAttribute tool, RegistryKey key)
        {
            // Check the arguments.
            if (null == application) throw new ArgumentNullException("application");
            if (null == toolset) throw new ArgumentNullException("toolset");
            if (null == tool) throw new ArgumentNullException("tool");
            if (null == key) throw new ArgumentNullException("key");

            // Set the parameters.
            this.application = application;
            this.toolset = toolset;
            this.tool = tool;
            this.key = key;
        }
예제 #6
0
        /// <summary>
        /// Creates a new toolset instance.
        /// </summary>
        /// <param name="name">The toolset name.</param>
        public Toolset(string name)
        {
            // Check the arguments.
            if (null == name) throw new ArgumentNullException("name");

            // Set the toolset parameters.
            this.name = name;

            // Get the toolset information.
            this.info = Toolset.GetToolsetInfo(this.GetType());

            // Check the toolset information is not null.
            if (null == this.info) throw new ToolException("Cannot create a toolset object from a class without the toolset information attribute.");
        }
예제 #7
0
        /// <summary>
        /// Creates a new tool instance.
        /// </summary>
        /// <param name="api">The tool API.</param>
        /// <param name="toolset">The toolset information.</param>
        public Tool(IToolApi api, ToolsetInfoAttribute toolset)
        {
            // Check the arguments.
            if (null == api) throw new ArgumentNullException("api");
            if (null == toolset) throw new ArgumentNullException("toolset");

            // Set the parameters.
            this.api = api;
            this.toolset = toolset;

            // Get the tool information.
            this.info = Tool.GetToolInfo(this.GetType());

            // Check the tool information is not null.
            if (null == this.info) throw new InvalidOperationException("Cannot create a tool object from a class without the tool information attribute.");
        }
        /// <summary>
        /// Creates a new tool instance.
        /// </summary>
        /// <param name="api">The tool API.</param>
        /// <param name="toolset">The toolset information.</param>
        public ToolAlexaTopSites(IToolApi api, ToolsetInfoAttribute toolset)
            : base(api, toolset)
        {
            // Create the control.
            this.control = new ControlAlexaTopSites(api);

            // Create the Alexa ranking database table.
            this.dbTableRanking = new DbTableTemplate<AlexaRankDbObject>(new Guid("7D65B301-C4C9-4823-9D64-0EB4E2CA43F4"), "Alexa ranking");
            this.dbTableHistory = new DbTableTemplate<AlexaHistoryDbObject>(new Guid("BD058EA2-0D75-4671-80A0-5A94A979B7E9"), "Alexa history");

            // Add the tables to the database.
            this.Api.DatabaseAddTable(this.dbTableRanking);
            this.Api.DatabaseAddTable(this.dbTableHistory);

            this.Api.DatabaseAddRelationship(this.dbTableHistory, this.dbTableRanking, "Timestamp", "Timestamp", true);
            this.Api.DatabaseAddRelationship(this.dbTableHistory, this.dbTableRanking, "Global", "Global", true);
            this.Api.DatabaseAddRelationship(this.dbTableHistory, this.dbTableRanking, "Country", "Country", true);
        }
예제 #9
0
 /// <summary>
 /// Creates a new tool exception instance, when the exception is generated by a tool
 /// </summary>
 /// <param name="message">The exception message.</param>
 /// <param name="innerException">The inner exception.</param>
 /// <param name="toolset">The toolset.</param>
 /// <param name="tool">The tool.</param>
 public ToolException(string message, Exception innerException, ToolsetInfoAttribute toolset, ToolInfoAttribute tool)
     : base(message, innerException)
 {
     this.Toolset = toolset;
     this.Tool = tool;
 }
예제 #10
0
 /// <summary>
 /// Creates a new tool exception instance, when the exception is generated by a toolset.
 /// </summary>
 /// <param name="message">The exception message.</param>
 /// <param name="toolset">The toolset.</param>
 public ToolException(string message, ToolsetInfoAttribute toolset)
     : base(message)
 {
     this.Toolset = toolset;
 }
예제 #11
0
 /// <summary>
 /// Creates a new tool instance.
 /// </summary>
 /// <param name="api">The tool API.</param>
 /// <param name="toolset">The toolset information.</param>
 public ToolWebCrawler(IToolApi api, ToolsetInfoAttribute toolset)
     : base(api, toolset)
 {
 }