Exemplo n.º 1
0
        /// <summary>
        /// Updates the gui status labels and the progress bar.
        /// </summary>
        /// <param name="file">The track file info.</param>
        private void UpdateStatus(TrackFileInfo file)
        {
            fileCountNow++;
            fileSizeNow += file.Size;

            progressBar.Value = (int)fileSizeNow;

            labelStatus0.Text = file.FileName;
            labelStatus1.Text = String.Format(CultureInfo.CurrentCulture, "Files: {0} / {1}", fileCountNow, fileCountTotal);
        }
Exemplo n.º 2
0
        private void FillList(DirectoryInfo dir)
        {
            DirectoryInfo dil = new DirectoryInfo(FileSystem.LocalTrackFolder);

            if (!dir.Exists)
            {
                return;
            }

            if (!dil.Exists)
            {
                return;
            }

            FileInfo[] fi_remote = dir.GetFiles();                      // there is a version that supports wildcards,
            FileInfo[] fi_local  = dil.GetFiles();                      // but it does not work correctly

            TrackFileList.Clear();

            foreach (FileInfo fi in fi_remote)
            {
                if (TrackDataManager.CanOpenFile(fi.FullName))
                {
                    TrackFileInfo info = new TrackFileInfo();

                    info.FileName       = fi.Name;
                    info.FullNameRemote = fi.FullName;
                    info.FullNameLocal  = dil.FullName + Path.DirectorySeparatorChar + fi.Name;
                    info.ExistLocal     = false;
                    info.Size           = fi.Length;

                    TrackFileList.Add(info);
                }
            }

            foreach (FileInfo fi in fi_local)
            {
                if (TrackDataManager.CanOpenFile(fi.FullName))
                {
                    foreach (TrackFileInfo info in TrackFileList)
                    {
                        if (info.FileName == fi.Name)
                        {
                            info.ExistLocal = true;
                            break;
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            List <TrackFileInfo> list = new List <TrackFileInfo>();

            foreach (DataGridViewRow row in dataGridView.Rows)
            {
                if ((bool)row.Cells[0].Value == true)                           // checkBox
                {
                    TrackFileInfo tfi = row.Tag as TrackFileInfo;
                    list.Add(tfi);
                }
            }

            CopyForm cf = new CopyForm(list);

            cf.ShowDialog();
        }