public string GetFile() { var currentFile = string.Empty; if (!System.IO.Directory.Exists(Folder)) { Console.WriteLine("不存在文件夹:" + Folder); return(currentFile); } var files = DialogClass.GetSpecialFiles(Folder, Filter); if (files.Count == 0) { Console.WriteLine(string.Format("文件夹:{0}下不存在{1}的文件", Folder, Filter)); return(currentFile); } foreach (var item in files) { var info = new FileInfo(item); var name = info.Name.Replace("(", "(").Replace(")", ")"); if (Regex.IsMatch(name, RegexString)) { currentFile = item; break; } } return(currentFile); }
private void SetDialog(IDialog iDialog, DialogClass dialogClass) { if (iDialog != null && dialogClass != null) { iDialog.SetDialogUI(dialogClass); } }
public void SpawnDialogBasedOnPrefabObj(GameObject dialogObj, DialogClass dialogClass) { if (dialogObj != null) { IDialog iDialog = InstantiateDialog(dialogObj); SetDialog(iDialog, dialogClass); } }
public void SpawnDialogBasedOnDialogType(DialogTypeEnum.DialogType type, DialogClass dialogClass) { GameObject dialogObj = GetSpecificDialogBasedOnType(type); if (dialogObj != null) { IDialog iDialog = InstantiateDialog(dialogObj); SetDialog(iDialog, dialogClass); } }
public void CreateDialog() { //xml numDialog++; _dialog = new XElement("dialog"); _dialog.Add(new XAttribute("name", answer.Text)); //json dialogJSON = new DialogClass(); dialogJSON.Name = answer.Text; dialogsListJSON.Add(dialogJSON); }
private void ExportExcelbutton_Click(object sender, EventArgs e) { var saveFile = DialogClass.SaveFile("2003Excel文件|*.xls", "请选择保存文件路径"); if (string.IsNullOrEmpty(saveFile)) { return; } var modelFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Excels", System.Configuration.ConfigurationManager.AppSettings["Statistic"]); try { ExcelParameterManager.ExportExcel(modelFile, saveFile, this.dataGridView1); } catch (Exception ex) { MessageBox.Show("发生错误:" + ex.Message); return; } MessageBox.Show("成果导出!"); }
public void SetDialogUI(DialogClass dialogClass) { _dialogClass = dialogClass; if (_txtTitle != null) { _txtTitle.text = dialogClass.title; } if (_txtMessage != null) { _txtMessage.text = dialogClass.message; } if (_positiveButton != null && _positiveButton.GetComponentInChildren <Text>() != null) { _positiveButton.GetComponentInChildren <Text>().text = dialogClass.positiveButtonText; } if (_negativeButton != null && _negativeButton.GetComponentInChildren <Text>() != null) { _negativeButton.GetComponentInChildren <Text>().text = dialogClass.negativeButtonText; } }
private void button4_Click(object sender, EventArgs e) { this.SaveBox.Text = DialogClass.SelectFolder(); }
private void button2_Click(object sender, EventArgs e) { this.SaveFileBox.Text = DialogClass.SaveFile("MBD文件|*.mdb", "合成mdb文件"); }
private void button1_Click(object sender, EventArgs e) { this.SourcesBox.Text = DialogClass.SelectFolder(this.SourcesBox.Text); }
public void Program() { //路径核对 if (!CheckFolder()) { Dispose(); return; } var resultComplete = new ResultComplete(_folder) { Children = XmlManager.Get("/Folders/Folder", "Name", XmlEnum.DataTree) }; //数据完整性 resultComplete.Check(); //核对质检数据文件夹下面的文件夹是否存在 _messages.AddRange(resultComplete.Messages); _folderTool.AddRange(resultComplete.ExistPath.Select(e => new FileFolder() { Folder = e, FileNames = XmlManager.GetChildren(string.Format("/Folders/Folder[@Name='{0}']", new DirectoryInfo(e).Name), "Name", XmlEnum.DataTree), //ReportPath=ReportPath, CityName = _cityName, Code = _cityCode })); foreach (var tool in _folderTool) { tool.Check();//核对每个文件夹下面的文件是否存在 是否能够打开 } var path = System.IO.Path.Combine(_folder, DataBase); if (System.IO.Directory.Exists(path)) { var mdbfiles = DialogClass.GetSpecialFiles(path, "*.mdb");//获取空间数据的mdb文件 if (mdbfiles.Count == 0) { _messages.Add("空间数据库文件夹下未找到相关*.mdb文件"); } else { var currentMdbFile = string.Empty; foreach (var item in mdbfiles) { var info = new FileInfo(item); if (Regex.IsMatch(info.Name, @"^[\u4e00-\u9fa5]+\(\d{6}\)农村存量建设用地调查成功空间数据库.mdb$")) { currentMdbFile = item; break; } } if (string.IsNullOrEmpty(currentMdbFile)) { _messages.Add(string.Format("未找到空间数据库文件")); } else { TableHeart.Program(currentMdbFile, IDS); var gisheart = new ArcGISHeart() { MDBFilePath = currentMdbFile, FeatureClassNames = XmlClass.GetRequireTables() }; gisheart.Program(); } } } else { _messages.Add("不存在文件夹路径" + path + ",故无法进行空间数据库核查"); } Dispose(); }
private void FolderButton_Click(object sender, EventArgs e) { this.folderText.Text = DialogClass.SelectFolder(); }
public void NextQuestion() { if (dialog == null || index_question == dialog.Questions.Length-1 || index_question == -1) { dialog = NextDialog(); index_question = 0; } else { index_question++; } ShowToForm(dialog.Questions[index_question]); }
private void JumpTo(string goal) { for (int i = 0; i < dialogs.Dialogs.Length; i++) { if (dialogs.Dialogs[i].Name == goal) { index_dialog = i; dialog = dialogs.Dialogs[i]; } } }
public void AddDialog() { List<DialogClass> dialoglist; if (dialogs.Dialogs != null) { dialoglist = dialogs.Dialogs.ToList<DialogClass>(); } else { dialoglist = new List<DialogClass>(); } DialogClass dio = new DialogClass(); dio.Name = textBox.Text; dialoglist.Add(dio); dialogs.Dialogs = dialoglist.ToArray(); }
public void ShowQuestion(DialogClass dialog) { string[] toList; if (dialog.Questions != null) { toList = new string[dialog.Questions.Length]; for (int i = 0; i < toList.Length; i++) { toList[i] = dialog.Questions[i].Question; } ShowToListBox(toList); } else { ShowToListBox(null); } State_Question(); }