Exemplo n.º 1
0
        public FileBinder(string location, string filter, ComboBox comboBox)
        {
            CompositeFactory factory = new CompositeFactory(location, filter, false, true);

            comboBox.DataSource    = null;
            comboBox.DisplayMember = "Name";
            comboBox.DataSource    = factory.List;
        }
Exemplo n.º 2
0
        public CompositeBinder(string location, string filter, ComboBox comboBox)
        {
            if (!Directory.Exists(location))
            {
                return;
            }

            CompositeFactory factory = new CompositeFactory(location, filter);

            comboBox.DataSource    = null;
            comboBox.DisplayMember = "Name";
            comboBox.DataSource    = factory.List;
        }
Exemplo n.º 3
0
        public FolderBinder(string location, bool include_parent, DataGridView dataGridView)
        {
            if (!Directory.Exists(location))
            {
                return;
            }

            CompositeFactory factory = new CompositeFactory(location, "", true, false);

            if (!include_parent)
            {
                factory.List.Remove(factory.List.Find(item => item.Name == ".."));
            }

            dataGridView.DataSource = null;
            dataGridView.DataSource = factory.List;
        }
Exemplo n.º 4
0
        public FolderBinder(string location, bool include_parent, DataGridViewComboBoxColumn column)
        {
            if (!Directory.Exists(location))
            {
                return;
            }

            CompositeFactory factory = new CompositeFactory(location, "", true, false);

            if (!include_parent)
            {
                factory.List.Remove(factory.List.Find(item => item.Name == ".."));
            }

            column.DataSource    = null;
            column.DisplayMember = "Name";
            column.ValueMember   = "Name";
            column.DataSource    = factory.List;
        }
Exemplo n.º 5
0
        public CompositeBinder(string location, string filter, DataGridView dataGridView)
        {
            if (!Directory.Exists(location))
            {
                return;
            }

            CompositeFactory factory = new CompositeFactory(location, filter);

            dataGridView.DataSource = null;
            dataGridView.DataSource = factory.List;

            foreach (DataGridViewColumn column in dataGridView.Columns)
            {
                column.Visible = false;
            }

            dataGridView.Columns[1].Visible = true;
            dataGridView.Columns[1].Width   = 28;
            dataGridView.Columns[2].Visible = true;
            dataGridView.Columns[2].Width   = 300;
        }