internal void UpdateAutomaticLabelForSpecificAcronyms(List <KeyValuePair <string, string> > acronymsWithType) { foreach (DataGridViewRow row in _variablesForm.dgvVariables.Rows) { VarConfig.VariableRow variableRow = row.Tag as VarConfig.VariableRow; foreach (KeyValuePair <string, string> acronymWithType in acronymsWithType) { if (acronymWithType.Value.ToLower().Contains(VariablesManager.GetVariableType(variableRow.Name).ToLower()) && GetAcronymsUsedByVariable(variableRow.Name).Contains(acronymWithType.Key.ToLower())) { variableRow.AutoLabel = GetAutomaticLabel(variableRow.Name); } } } }
internal string GetVariablesUsingAcronym(string acronym, string acronymType) { string usingVariables = string.Empty; foreach (DataGridViewRow row in _variablesForm.dgvVariables.Rows) { VarConfig.VariableRow variableRow = row.Tag as VarConfig.VariableRow; if (acronymType.ToLower().Contains(VariablesManager.GetVariableType(variableRow.Name).ToLower()) && GetAcronymsUsedByVariable(variableRow.Name).Contains(acronym.ToLower())) { usingVariables += variableRow.Name + " "; } } return(usingVariables); }
internal string GetAutomaticLabel(string variableName, string currentLabel = "") { string variableType = VariablesManager.GetVariableType(variableName); if (variableType.ToLower() == IDENTIFIER_TYPE.ToLower()) { return(currentLabel); //id's (e.g. idhh, idperson) do not follow the rules, therefore don't change } string AutomaticLabel = _varConfigFacade.GetTypeDescription(variableType); foreach (string acronym in GetAcronymsUsedByVariable(variableName)) { AutomaticLabel += AUTOMATICLABEL_SEPARATOR + _varConfigFacade.GetAcronymDescription(variableType, acronym); } if (VariablesManager.IsSimulated(variableName)) { AutomaticLabel += AUTOMATICLABEL_SEPARATOR + AUTOMATICLABEL_SIMULATED; } return(AutomaticLabel); }