SetDefinitions() public method

public SetDefinitions ( IEnumerabledefinitions ) : void
definitions IEnumerable
return void
Esempio n. 1
0
        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));
            }
        }
Esempio n. 2
0
        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]);
            }
        }
Esempio n. 3
0
        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]);
            }
        }
Esempio n. 4
0
        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);
            }
        }