Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 private void SetDialog(IDialog iDialog, DialogClass dialogClass)
 {
     if (iDialog != null && dialogClass != null)
     {
         iDialog.SetDialogUI(dialogClass);
     }
 }
Exemplo n.º 3
0
 public void SpawnDialogBasedOnPrefabObj(GameObject dialogObj, DialogClass dialogClass)
 {
     if (dialogObj != null)
     {
         IDialog iDialog = InstantiateDialog(dialogObj);
         SetDialog(iDialog, dialogClass);
     }
 }
Exemplo n.º 4
0
    public void SpawnDialogBasedOnDialogType(DialogTypeEnum.DialogType type, DialogClass dialogClass)
    {
        GameObject dialogObj = GetSpecificDialogBasedOnType(type);

        if (dialogObj != null)
        {
            IDialog iDialog = InstantiateDialog(dialogObj);
            SetDialog(iDialog, dialogClass);
        }
    }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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("成果导出!");
        }
Exemplo n.º 7
0
    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;
        }
    }
Exemplo n.º 8
0
 private void button4_Click(object sender, EventArgs e)
 {
     this.SaveBox.Text = DialogClass.SelectFolder();
 }
Exemplo n.º 9
0
 private void button2_Click(object sender, EventArgs e)
 {
     this.SaveFileBox.Text = DialogClass.SaveFile("MBD文件|*.mdb", "合成mdb文件");
 }
Exemplo n.º 10
0
 private void button1_Click(object sender, EventArgs e)
 {
     this.SourcesBox.Text = DialogClass.SelectFolder(this.SourcesBox.Text);
 }
Exemplo n.º 11
0
        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();
        }
Exemplo n.º 12
0
 private void FolderButton_Click(object sender, EventArgs e)
 {
     this.folderText.Text = DialogClass.SelectFolder();
 }
Exemplo n.º 13
0
 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]);
 }
Exemplo n.º 14
0
 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];
         }
     }
 }
Exemplo n.º 15
0
 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();
 }
Exemplo n.º 16
0
        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();
        }