Beispiel #1
0
 /// <summary>
 /// 새로고침	, 이 부분은 조금 고민해봐야 함
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ButtonRefresh_Click(object sender, EventArgs e)
 {
     ListViewFileList.BeginUpdate();
     ListViewFileList.Items.Clear();
     ApplyAllFiles(MainForm.pTextPath.Text, SearchFile);
     ListViewFileList.EndUpdate();
 }
Beispiel #2
0
        private void SearchFile(string searchPath)
        {
            if (File.Exists(searchPath))
            {
                try
                {
                    FileInfo item = new FileInfo(searchPath);

                    ListViewFileList.BeginUpdate();
                    if (item.Attributes == FileAttributes.System)
                    {
                        ListViewFileList.EndUpdate();
                        return;
                    }
                    if (IsExist(item))
                    {
                        string fileType      = GetFileType(Extension.CheckExtensionType(item.Extension.Substring(1, item.Extension.Length - 1)));
                        string fileName      = GetPureFileName(item.Name);
                        string fileSize      = item.Length.ToString();
                        string directoryName = item.DirectoryName;
                        string accessTime    = item.LastAccessTime.ToString();

                        fileSize = (Double.Parse(fileSize) / 1024.0).ToString("0.#");
                        ListViewItem tmp = new ListViewItem(new String[] { fileType, fileName, directoryName, accessTime, fileSize });
                        this.ListViewFileList.Items.Add(tmp);
                    }
                }
                catch (UnauthorizedAccessException e)
                {
                    MessageBox.Show(e.Message);
                }
            }
            ListViewFileList.EndUpdate();
        }
Beispiel #3
0
 /// <summary>
 /// 폼 닫히는 경우 업데이트 종료
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Search_FormClosed(object sender, FormClosedEventArgs e)
 {
     ListViewFileList.EndUpdate();
 }