Exemple #1
0
        /// <summary>
        /// The constructor for the ToolDialog
        /// </summary>
        /// <param name="tool">The ITool to create the dialog box for</param>
        private void Initialize(ITool tool)
        {
            SuspendLayout();

            // Generates the form based on what inputs the ITool has
            _tool = tool;
            Text  = tool.Name;

            // Sets up the help link
            if (string.IsNullOrEmpty(tool.HelpUrl))
            {
                helpHyperlink.Visible = false;
            }
            else
            {
                helpHyperlink.Links[0].LinkData = tool.HelpUrl;
                helpHyperlink.Links.Add(0, helpHyperlink.Text.Length, tool.HelpUrl);
            }

            // Sets-up the icon for the Dialog
            Icon = Images.HammerSmall;
            panelToolIcon.BackgroundImage = tool.Icon ?? Images.Hammer;

            DialogSpacerElement inputSpacer = new DialogSpacerElement
            {
                Text = ModelingMessageStrings.Input
            };

            AddElement(inputSpacer);

            // Populates the dialog with input elements
            PopulateInputElements();

            DialogSpacerElement outputSpacer = new DialogSpacerElement
            {
                Text = ModelingMessageStrings.Output
            };

            AddElement(outputSpacer);

            // Populates the dialog with output elements
            PopulateOutputElements();

            // Populate the help text
            PopulateHelp(_tool.Name, _tool.Description, _tool.HelpImage);

            ResumeLayout();
        }
Exemple #2
0
        /// <summary>
        /// The constructor for the ToolDialog
        /// </summary>
        /// <param name="tool">The ITool to create the dialog box for</param>
        private void Initialize(ITool tool)
        {
            SuspendLayout();

            // Generates the form based on what inputs the ITool has
            _tool = tool;
            Text = tool.Name;

            // Sets up the help link
            if (string.IsNullOrEmpty(tool.HelpUrl))
            {
                helpHyperlink.Visible = false;
            }
            else
            {
                helpHyperlink.Links[0].LinkData = tool.HelpUrl;
                helpHyperlink.Links.Add(0, helpHyperlink.Text.Length, tool.HelpUrl);
            }

            // Sets-up the icon for the Dialog
            Icon = Images.HammerSmall;
            panelToolIcon.BackgroundImage = tool.Icon ?? Images.Hammer;

            DialogSpacerElement inputSpacer = new DialogSpacerElement();
            inputSpacer.Text = ModelingMessageStrings.Input;
            AddElement(inputSpacer);

            // Populates the dialog with input elements
            PopulateInputElements();

            DialogSpacerElement outputSpacer = new DialogSpacerElement();
            outputSpacer.Text = ModelingMessageStrings.Output;
            AddElement(outputSpacer);

            // Populates the dialog with output elements
            PopulateOutputElements();

            // Populate the help text
            PopulateHelp(_tool.Name, _tool.Description, _tool.HelpImage);

            ResumeLayout();
        }