Esempio n. 1
0
        private void grdDirs_SelectionChanged(object sender, EventArgs e)
        {
            if (grdDirs.SelectedRows.Count > 0)
            {
                if (DirBindingSource.Current != null)
                {
                    var dir = (mko.FileSys.IDir)DirBindingSource.Current;

                    var ix     = dir.Name.LastIndexOf("Reisen");
                    var subDir = dir.Name.Substring(ix);

                    var dirs = svcClient.GetSubDirs(subDir);

                    //DirBindingSource.DataSource = dirs.SubDirs;
                    //DirBindingSource.ResetBindings(false);
                    FilesBindingSource.DataSource = dirs.Files.Select(r => new Decos.FileDeco(r));
                    FilesBindingSource.ResetBindings(false);
                }
                else
                {
                    var dirs = svcClient.GetSubDirs("Reisen");

                    DirBindingSource.DataSource   = dirs.SubDirs.Select(r => new Decos.DirDeco(r));
                    FilesBindingSource.DataSource = dirs.Files.Select(r => new Decos.FileDeco(r));
                }
            }
        }
Esempio n. 2
0
        private void grdDirs_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                var dir = (mko.FileSys.IDir)DirBindingSource.Current;

                var ix     = dir.Name.LastIndexOf("Reisen");
                var subDir = dir.Name.Substring(ix);

                var dirs = svcClient.GetSubDirs(subDir);

                DirBindingSource.DataSource = dirs.SubDirs.Select(r => new Decos.DirDeco(r));
                DirBindingSource.ResetBindings(false);

                FilesBindingSource.DataSource = dirs.Files.Select(r => new Decos.FileDeco(r));
                FilesBindingSource.ResetBindings(false);
            }
        }