Beispiel #1
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;
        }
Beispiel #2
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 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;
 }