Esempio n. 1
0
        // 檔案清單改變時的事件
        private void listBox_file_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox_file.SelectedIndex < 0)
            {
                return;
            }
            SyncDir  dir  = listBoxItems_SyncDir[listBox_dir.SelectedIndex];
            SyncFile file = dir.FileList[listBox_file.SelectedIndex];

            textBox_fullPath.Text = file.File.FullName;
            label_FileList.Text   = String.Format("{0} ({1}/{2})", listLabelMap[label_FileList], listBox_file.SelectedIndex + 1, listBox_file.Items.Count);
        }
Esempio n. 2
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        #endregion


        #region 清單改變時的事件
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////

        // 資料夾清單改變時的事件
        private void listBox_dir_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox_dir.SelectedIndex < 0)
            {
                return;
            }
            SyncDir dir = listBoxItems_SyncDir[listBox_dir.SelectedIndex];

            listBox_file.Items.Clear();
            listBox_file.Items.AddRange(dir.FileList.ToArray());
            textBox_fullPath.Text = dir.Directory.FullName;
            label_DirList.Text    = String.Format("{0} ({1}/{2})", listLabelMap[label_DirList], listBox_dir.SelectedIndex + 1, listBox_dir.Items.Count);
            label_FileList.Text   = String.Format("{0} ({1})", listLabelMap[label_FileList], listBox_file.Items.Count);
        }