예제 #1
0
        /// <summary>
        /// Create a new instance of the form. The form is responsible for retrieving and updating
        /// the tool definition in the build tool collection.
        /// </summary>
        /// <param name="buildTools">The collection of build tools registered with the build system.</param>
        /// <param name="toolId">The build tool to be configured.</param>
        public BuildToolForm(BuildToolCollection buildTools, string toolId)
        {
            InitializeComponent();

            _buildToolManager = BuildToolManager.GetInstance();
            _buildTools       = buildTools;
            _toolId           = toolId;

            List <String> documentTypes =
                _buildToolManager.GetAvailableDocumentTypes();

            if (documentTypes.Count == 0)
            {
                DisableForm();
            }
            else
            {
                foreach (string documentType in documentTypes)
                {
                    _documentTypeComboBox.Items.Add(documentType);
                }

                LoadTool();
            }

            /*
             * Allow client applications to modify the form.
             */

            BuildToolFormProxy.GetInstance().
            UpdateFormControls(Controls);
        }
예제 #2
0
        /// <summary>
        /// Get an instance of the form proxy singleton.
        /// </summary>
        /// <returns></returns>
        public static BuildToolFormProxy GetInstance()
        {
            if (_singleton == null)
            {
                _singleton = new BuildToolFormProxy();
            }

            return(_singleton);
        }