private void OpenFolderRequested(object sender, RoutedEventArgs e)
        {
            WorkingFolderService.SelectWorkingFolder();
            string path = WorkingFolderService.WorkingFolderPath;

            if (path == null)
            {
                return;
            }
            if (!Directory.Exists(path + @"\TextMap\") || !Directory.Exists(path + @"\Excel\"))
            {
                new SelectionSuggestDialog().ShowAsync();
            }
            else
            {
                this.TextMapCollection         = DirectoryEx.GetFileExs(path + @"\TextMap\");
                this.ExcelConfigDataCollection = DirectoryEx.GetFileExs(path + @"\Excel\");
                if (this.ExcelConfigDataCollection.Count() == 0)
                {
                    new SelectionSuggestDialog().ShowAsync();
                }
                else
                {
                    //npcid
                    MapService.NPCMap = new Lazy <Dictionary <string, string> >(() =>
                                                                                Json.ToObject <JArray>(
                                                                                    this.ExcelConfigDataCollection
                                                                                    .First(f => f.FileName == "Npc").Read())
                                                                                .ToDictionary(t => t["Id"].ToString(), v => v["NameTextMapHash"].ToString()));
                }
            }
        }
Пример #2
0
 private void OpenFolderRequested(object sender, RoutedEventArgs e)
 {
     path = WorkingFolderService.SelectWorkingFolder();
     ExcelDataView.WorkingFolderPath = path;
     TextMapCollection = Directory.GetFiles(path + @"\TextMap\").Select(f => new FileEx(f));
 }