private Table GetDefinition() { var definitions = m_definitions.Tables.Where(t => t.Name == m_dbcName); if (!definitions.Any()) { definitions = m_definitions.Tables.Where(t => t.Name == Path.GetFileName(m_dbcFile)); } if (!definitions.Any()) { return(null); } else if (definitions.Count() == 1) { return(definitions.First()); } else { m_selector = new DefinitionSelect(); m_selector.SetDefinitions(definitions); var result = m_selector.ShowDialog(); if (result != DialogResult.OK || m_selector.DefinitionIndex == -1) { return(null); } return(definitions.ElementAt(m_selector.DefinitionIndex)); } }
private XmlElement GetDefinition() { XmlNodeList definitions = m_definitions["DBFilesClient"].GetElementsByTagName(m_dbcName); if (definitions.Count == 0) { var msg = String.Format(CultureInfo.InvariantCulture, "{0} missing definition!", m_dbcName); ShowErrorMessageBox(msg); return(null); } else if (definitions.Count == 1) { return((XmlElement)definitions[0]); } else { m_selector = new DefinitionSelect(); m_selector.SetDefinitions(definitions); var result = m_selector.ShowDialog(this); if (result != DialogResult.OK || m_selector.DefinitionIndex == -1) { return(null); } return((XmlElement)definitions[m_selector.DefinitionIndex]); } }
private XmlElement GetDefinition() { XmlNodeList definitions = m_definitions["DBFilesClient"].GetElementsByTagName(m_CurrentDbcFileName); if (definitions.Count == 0) { definitions = m_definitions["DBFilesClient"].GetElementsByTagName(Path.GetFileName(m_dbcFile)); } if (definitions.Count == 0) { var msg = String.Format(CultureInfo.InvariantCulture, "{0} missing definition!", m_CurrentDbcFileName); ShowErrorMessageBox(msg); return null; } else if (definitions.Count == 1) { return ((XmlElement)definitions[0]); } else { m_selector = new DefinitionSelect(); m_selector.SetDefinitions(definitions); var result = m_selector.ShowDialog(this); if (result != DialogResult.OK || m_selector.DefinitionIndex == -1) return null; return ((XmlElement)definitions[m_selector.DefinitionIndex]); } }
private Table GetDefinition() { var definitions = m_definitions.Tables.Where(t => t.Name == m_dbcName); if (!definitions.Any()) { definitions = m_definitions.Tables.Where(t => t.Name == Path.GetFileName(m_dbcFile)); } if (!definitions.Any()) { return null; } else if (definitions.Count() == 1) { return definitions.First(); } else { m_selector = new DefinitionSelect(); m_selector.SetDefinitions(definitions); var result = m_selector.ShowDialog(); if (result != DialogResult.OK || m_selector.DefinitionIndex == -1) return null; return definitions.ElementAt(m_selector.DefinitionIndex); } }