示例#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);
        }
        /// <summary>
        /// Creates a new tool instance.
        /// </summary>
        /// <param name="tool">The tool for this tool item.</param>
        /// <param name="api">The tool API.</param>
        public ToolMercuryAnalytics(Tool tool, IToolApi api)
            : base(tool, api)
        {
            // Create the configuration.
            this.config = new MercuryConfig(api);

            // Create the control.
            this.control = new ControlMercuryAnalytics(this.config);
        }
        /// <summary>
        /// Creates a new control instance.
        /// </summary>
        /// <param name="config">The mercury configuration.</param>
        public ControlMercury(MercuryConfig config)
        {
            // Initialize component.
            InitializeComponent();

            // Set the configuration.
            this.config = config;

            // Set the default control properties.
            this.Visible = false;
            this.Dock = DockStyle.Fill;
        }
        /// <summary>
        /// Creates a new control instance.
        /// </summary>
        /// <param name="config">The configuration.</param>
        public ControlMercuryClient(MercuryConfig config)
        {
            // Initialize the component.
            this.InitializeComponent();

            // Set the configuration.
            this.config = config;

            // Load the configuration.
            this.OnLoadConfiguration();

            // Set the status.
            this.status = this.config.Api.Status.GetHandler(this);
            this.status.Send(ApplicationStatus.StatusType.Normal, "Ready.", Resources.Information_16);
        }
        // Public method.
        /// <summary>
        /// Shows the dialog with the specified title and text.
        /// </summary>
        /// <param name="owner">The owner window.</param>
        /// <param name="config">The Mercury client configuration.</param>
        /// <returns>The dialog result.</returns>
        public DialogResult ShowDialog(IWin32Window owner, MercuryConfig config)
        {
            // Set the configuration.
            this.config = config;

            // Set the properties.
            this.textBoxSessionUrl.Text = this.config.UploadSessionUrl;
            this.textBoxTracerouteUrl.Text = this.config.UploadTracerouteUrl;
            this.textBoxLocalAddress.Text = this.config.LocalAddress;

            // Reset the buttons.
            this.buttonApply.Enabled = false;

            // Call the base class method.
            return base.ShowDialog(owner);
        }
        /// <summary>
        /// Creates a new tool instance.
        /// </summary>
        /// <param name="tool">The tool for this tool item.</param>
        /// <param name="api">The tool API.</param>
        public ToolMercuryClient(Tool tool, IToolApi api)
            : base(tool, api)
        {
            // Create the configuration.
            this.config = new MercuryConfig(api);

            // Create the control.
            this.control = new ControlMercuryClient(this.config);

            // Create the tool methods.
            this.Tool.AddMethod(
                new Guid("24FDC1EC-FA12-4A42-B410-3A868B9576D9"),
                Resources.ToolMercuryClientMethodUploadSessionFromPlanetLabName,
                Resources.ToolMercuryClientMethodUploadSessionFromPlanetLabDescription,
                this.UploadSessionFromPlanetLab);
            this.Tool.AddMethod(
                new Guid("5AD386C4-EA86-4C31-A0A1-DCD6CF1107B2"),
                Resources.ToolMercuryClientMethodUploadTracerouteFromPlanetLabName,
                Resources.ToolMercuryClientMethodUploadTracerouteFromPlanetLabDescription,
                this.UploadTracerouteFromPlanetLab);
        }