Exemplo n.º 1
0
        private void UpdateUIState()
        {
            bool bFormatSelected = true;

            ListView.SelectedListViewItemCollection lvsc = m_lvFormats.SelectedItems;

            if ((lvsc == null) || (lvsc.Count != 1))
            {
                bFormatSelected = false;
            }

            if (bFormatSelected)
            {
                m_fmtImp = lvsc[0].Tag as FormatImporter;
            }
            else
            {
                m_fmtImp = null;
            }

            if (m_fmtImp != null)
            {
                m_tbFile.Enabled = m_btnSelFile.Enabled = m_fmtImp.RequiresFile;
            }
            else
            {
                m_tbFile.Enabled = m_btnSelFile.Enabled = false;
            }

            m_btnOK.Enabled = bFormatSelected && ((m_tbFile.Text.Length != 0) ||
                                                  !m_fmtImp.RequiresFile);
        }
Exemplo n.º 2
0
        private bool DoImport()
        {
            UpdateUIState();
            if (m_fmtImp == null)
            {
                return(true);
            }

            m_fmtFinal = m_fmtImp;
            m_vFiles   = m_tbFile.Text.Split(new char[] { ';' },
                                             StringSplitOptions.RemoveEmptyEntries);

            return(true);
        }