private void LoadBlobs() { try { DirectoryInfo directory; if (!string.IsNullOrEmpty(CurrentWorkingDirectory)) { directory = new DirectoryInfo(CurrentWorkingDirectory); } else { directory = new DirectoryInfo("assets"); } if (directory == null || !directory.Exists) { //Try within same program folder directory = new DirectoryInfo(Directory.GetCurrentDirectory()); } FileInfo[] floorFiles = directory.GetFiles("f_*.blo"); FloorBlobs = BlobLoader.GetBlobsFrom(floorFiles); FileInfo[] objectFiles = directory.GetFiles("o_*.blo"); ObjectBlobs = BlobLoader.GetBlobsFrom(objectFiles); } catch (System.Exception e) { MessageBox.Show(e.Message, "MainController", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LoadWorkingDir(string dir) { var directory = new DirectoryInfo(dir); FileInfo[] floorFiles = directory.GetFiles("f_*.blo"); FloorBlobs = BlobLoader.GetBlobsFrom(floorFiles); FileInfo[] objectFiles = directory.GetFiles("o_*.blo"); ObjectBlobs = BlobLoader.GetBlobsFrom(objectFiles); mainForm.ReloadBlobImages(); mapViewController.SetSelectedTileDelegate(() => selectedBlobImage); //mapViewController.SetBlobImages(() => blobImages); }