Пример #1
0
        public void DisplayDialogList()
        {
            DialogListForm mDialogListForm = null;
            try
            {
                ArrayList list = new ArrayList();

                CheckDialogSaveFolder();
                DirectoryInfo dialogDirInfo = new DirectoryInfo(string.Format(WeDoCommon.ConstDef.MSGR_DATA_DLOG_DIR, ConfigHelper.Id));
                DirectoryInfo[] dirArray = dialogDirInfo.GetDirectories(); //월별폴더 검색

                foreach (DirectoryInfo tempDir in dirArray)
                {
                    DirectoryInfo[] subDirArray = tempDir.GetDirectories();    //일별폴더 검색
                    foreach (DirectoryInfo subDir in subDirArray)
                    {
                        FileInfo[] fileArray = subDir.GetFiles("*.dlg");
                        foreach (FileInfo tempFile in fileArray)
                        {
                            list.Add(tempFile);
                        }
                    }

                }

                if (list.Count == 0)
                {
                    MessageBox.Show("저장된 대화기록이 없습니다.", "알림", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    DialogListForm frm = new DialogListForm(list);
                    
                    mDialogListForm.Show();
                }
            }
            catch (Exception exception)
            {
                Logger.error(exception.ToString());
            }
        }
Пример #2
0
        public void DisplayDialogList()
        {
            DialogListForm mDialogListForm = null;

            try
            {
                ArrayList list = new ArrayList();

                CheckDialogSaveFolder();
                DirectoryInfo   dialogDirInfo = new DirectoryInfo(string.Format(WeDoCommon.ConstDef.MSGR_DATA_DLOG_DIR, ConfigHelper.Id));
                DirectoryInfo[] dirArray      = dialogDirInfo.GetDirectories(); //월별폴더 검색

                foreach (DirectoryInfo tempDir in dirArray)
                {
                    DirectoryInfo[] subDirArray = tempDir.GetDirectories();    //일별폴더 검색
                    foreach (DirectoryInfo subDir in subDirArray)
                    {
                        FileInfo[] fileArray = subDir.GetFiles("*.dlg");
                        foreach (FileInfo tempFile in fileArray)
                        {
                            list.Add(tempFile);
                        }
                    }
                }

                if (list.Count == 0)
                {
                    MessageBox.Show("저장된 대화기록이 없습니다.", "알림", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    DialogListForm frm = new DialogListForm(list);

                    mDialogListForm.Show();
                }
            }
            catch (Exception exception)
            {
                Logger.error(exception.ToString());
            }
        }
Пример #3
0
        private void MakeDialogueboxList()
        {
            try
            {
                ArrayList list = new ArrayList();

                if (!dialogdi.Exists)
                {
                    DialogFileCheck();
                }
                else
                {
                    DirectoryInfo[] diarray = dialogdi.GetDirectories(); //월별폴더 검색

                    foreach (DirectoryInfo tempdi in diarray)
                    {
                        DirectoryInfo[] diarray1 = tempdi.GetDirectories();    //일별폴더 검색
                        foreach (DirectoryInfo tempdi1 in diarray1)
                        {
                            FileInfo[] fiarray = tempdi1.GetFiles("*.dlg");
                            foreach (FileInfo tempfi in fiarray)
                            {
                                list.Add(tempfi);
                            }
                        }

                    }
                }

                if (list.Count == 0)
                {
                    MessageBox.Show("저장된 대화기록이 없습니다.", "알림", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    if (mDialogListForm != null)
                    {
                        mDialogListForm.Close();
                    }
                    mDialogListForm = new DialogListForm();

                    mDialogListForm.listView.SelectedIndexChanged += new EventHandler(DialoglistView_Click);
                    mDialogListForm.btn_del.MouseClick += new MouseEventHandler(btn_del_Click_forDialog);
                    
                    foreach (object obj in list)
                    {
                        FileInfo tempfi = (FileInfo)obj;
                        string fname = tempfi.Name;
                        string[] temparray = fname.Split('!');
                        ListViewItem item = mDialogListForm.listView.Items.Add(tempfi.Directory.Name + " " + temparray[0]);
                        string[] array = temparray[1].Split('.');//파일 확장자명 제거
                        //string tempname = getName(array[0]);
                        item.SubItems.Add(array[0]);
                        item.Tag = tempfi;
                    }
                    mDialogListForm.Show();
                }
            }
            catch (Exception exception)
            {
                logWrite(exception.ToString());
            }
        }