Ejemplo n.º 1
0
        private void chkMapResultsToFile_Checked(object sender, RoutedEventArgs e)
        {
            string mappingFile = txtMappingFile.Text.Trim();

            if (string.IsNullOrEmpty(mappingFile) || _currentInjectionStrategy == null)
            {
                chkMapResultsToFile.IsChecked = false;
                return;
            }

            if (chkMapResultsToFile.IsChecked.Value)
            {
                string    error = string.Empty;
                XDocument doc   = null;
                if (XmlHelpers.CreateOrLoadMappingFile(mappingFile, _currentInjectionStrategy,
                                                       cbDbms.SelectedValue != null ? cbDbms.SelectedValue.ToString() : string.Empty,
                                                       ref error, out doc))
                {
                    _currentInjectionStrategy.MappingFile = mappingFile;
                }
                else
                {
                    MessageBox.Show(error);
                }
            }
            else
            {
                _currentInjectionStrategy.MappingFile = null;
            }
        }