private void AddRule(Repository repository, AbstractRule abstractRule)
        {
            Project project = repository.GetProjectInterface();
            string  id      = project.DefineRule(_categoryID, EnumMVErrorType.mvError, abstractRule.ErrorMessage);

            _lookup[id] = abstractRule;
        }
        public void ValidateElementUsingRuleID(Repository repository, string ruleID, IEAElement element)
        {
            Project      project = repository.GetProjectInterface();
            AbstractRule rule    = _lookup[ruleID];

            if (rule != null && rule.GetRuleType() == RuleType.Element)
            {
                string message;
                if (!rule.Validate(element, out message))
                {
                    string name         = element.Name;
                    string stereotype   = element.Stereotype;
                    string errorMessage = string.Format(Messages.ModelValidationElementMessage, message, stereotype,
                                                        name);
                    project.PublishResult(ruleID, EnumMVErrorType.mvError, errorMessage);
                }
            }
        }
        public void ValidateConectorUsingRuleID(Repository repository, string ruleID, IEAConnector connector)
        {
            Project      project = repository.GetProjectInterface();
            AbstractRule rule    = _lookup[ruleID];

            if (rule != null && rule.GetRuleType() == RuleType.Connector)
            {
                string message;
                if (!rule.Validate(connector, out message))
                {
                    string supplierStereotype = connector.GetSupplier().Stereotype;
                    string clientStereotype   = connector.GetClient().Stereotype;
                    string errorMessage       = string.Format(Messages.ModelValidationConnectorMessage, message,
                                                              clientStereotype,
                                                              supplierStereotype, connector.Stereotype);
                    project.PublishResult(ruleID, EnumMVErrorType.mvError, errorMessage);
                }
            }
        }