Beispiel #1
0
        public DialogResult ShowDialog(IWin32Window parent, QuickSelectorData data, QuickSelectorOptions options)
        {
            // size and position
            if (!SuperPuTTY.Settings.QuickSelectorPosition.IsEmpty && SuperPuTTY.Settings.RestoreWindowLocation)
            {
                this.StartPosition = FormStartPosition.Manual;
                this.DesktopBounds = SuperPuTTY.Settings.QuickSelectorPosition;
            }

            // bind data
            this.Options       = options;
            this.DataView      = new DataView(data.ItemData);
            this.DataView.Sort = options.Sort;
            this.dataGridViewData.DataSource = this.DataView;

            // configure grid
            this.nameDataGridViewTextBoxColumn.Visible = this.Options.ShowNameColumn;
            this.pathDataGridViewTextBoxColumn.Visible = this.Options.ShowDetailColumn;
            if (this.Options.ShowDetailColumn && !this.Options.ShowNameColumn)
            {
                this.pathDataGridViewTextBoxColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            }

            // update title
            this.UpdateFilter();
            return(ShowDialog(parent));
        }
Beispiel #2
0
        public DialogResult ShowDialog(IWin32Window parent, QuickSelectorData data, QuickSelectorOptions options)
        {
            // bind data
            this.Options       = options;
            this.DataView      = new DataView(data.ItemData);
            this.DataView.Sort = options.Sort;
            this.dataGridViewData.DataSource = this.DataView;

            // configure grid
            this.nameDataGridViewTextBoxColumn.Visible   = this.Options.ShowNameColumn;
            this.detailDataGridViewTextBoxColumn.Visible = this.Options.ShowDetailColumn;
            if (this.Options.ShowDetailColumn && !this.Options.ShowNameColumn)
            {
                this.detailDataGridViewTextBoxColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            }

            // update title
            this.UpdateFilter();
            return(ShowDialog(parent));
        }