Exemplo n.º 1
0
        /// <summary>
        /// Gets a list of errors present in the current configuration.
        /// </summary>
        /// <returns>A list of errors present in the current configuration.</returns>
        private List <string> GetConfigurationErrors()
        {
            List <string> errors = new List <string>();

            DTEHelper.ClearErrorsFromOutputPane();
            if (this.trvFeatures.Nodes == null || this.trvFeatures.Nodes.Count == 0)
            {
                errors.Add("No features available. Ensure you feature model diagram(s) has features and Confeaturator is refreshed.");
            }
            else
            {
                FeatureModelTreeNode rootNode = this.trvFeatures.Nodes[0] as FeatureModelTreeNode;
                Feature feature = rootNode.FeatureModelElement as Feature;
                if (feature == null)
                {
                    errors.Add("Root node should be a feature. Please re-check you feature model diagrams.");
                }
                else
                {
                    if (rootNode.Status == FeatureModelNodeStatus.Unchecked)
                    {
                        string errorMessage = string.Format("Root Confeaturator node '{0}' should be checked.", feature.Name);
                        errors.Add(errorMessage);
                    }
                    rootNode.LogAlternativeIntervalErrors(errors);
                }
            }
            return(errors);
        }