/// <summary> /// Show the browser using the provided multiple search patterns. /// </summary> /// <param name="startDirectory">The directory which will be shown at the start.</param> /// /// <param name="SearchPattern">The search patterns. Example: *.mp3 / *.txt</param> /// <param name="returnMessage">The MonoBehaviour which will receive the selected file path.</param> /// <param name="selectMode">Browse for Files or Directories.</param> /// <param name="CanCancel">Can the user close the window?</param> public void Show(string startDirectory, string[] SearchPattern, MonoBehaviour returnMessage, FileSelectMode selectMode = FileSelectMode.File, bool CanCancel = true) { rt = returnMessage; mode = selectMode; canCancel = CanCancel; searchPattern = SearchPattern; if (selectMode == FileSelectMode.File && windowName == "") { windowName = "File Browser - Select File"; redLabel = "Select a file."; } else { if (windowName == "") { windowName = "File Browser - Select Folder"; } if (redLabel == "") { redLabel = "Select a folder."; } } if (startDirectory != "") { if (DirectoryExsists(startDirectory)) { currentDir = startDirectory; } else { currentDir = DefaultDirectory; } UpdateList(currentDir, SearchPattern); } else { UpdateList(DefaultDirectory, SearchPattern); } show = true; }
/// <summary> /// Show the browser window using the provided search pattern. /// </summary> /// <param name="startDirectory">The directory which will be shown at the start.</param> /// /// <param name="SearchPattern">You can search only one extension at a time. Example: *.mp3 or *.txt</param> /// <param name="returnMessage">The MonoBehaviour which will receive the selected file path.</param> /// <param name="selectMode">Browse for Files or Directories.</param> /// <param name="CanCancel">Can the user close the window?</param> public void Show(string startDirectory, string SearchPattern, MonoBehaviour returnMessage, FileSelectMode selectMode = FileSelectMode.File, bool CanCancel = true) { string[] search = new string[0]; if (SearchPattern != "") { search = new string[1] { SearchPattern }; } Show(startDirectory, search, returnMessage, selectMode, CanCancel); }
/// <summary> /// Show the browser window. /// </summary> /// <param name="startDirectory">The directory which will be shown at the start.</param> /// <param name="returnMessage">The MonoBehaviour which will receive the selected file path.</param> /// <param name="selectMode">Browse for Files or Directories.</param> /// <param name="CanCancel">Can the user close the window?</param> public void Show(string startDirectory, MonoBehaviour returnMessage, FileSelectMode selectMode = FileSelectMode.File, bool CanCancel = true) { Show(startDirectory, "", returnMessage, selectMode, CanCancel); }
/// <summary> /// Show the browser using the provided multiple search patterns. /// </summary> /// <param name="startDirectory">The directory which will be shown at the start.</param> /// /// <param name="SearchPattern">The search patterns. Example: *.mp3 / *.txt</param> /// <param name="returnMessage">The MonoBehaviour which will receive the selected file path.</param> /// <param name="selectMode">Browse for Files or Directories.</param> /// <param name="CanCancel">Can the user close the window?</param> public void Show(string startDirectory, string[] SearchPattern, MonoBehaviour returnMessage, FileSelectMode selectMode = FileSelectMode.File, bool CanCancel = true) { rt = returnMessage; mode = selectMode; canCancel = CanCancel; searchPattern = SearchPattern; if (selectMode == FileSelectMode.File && windowName == "") { windowName = "File Browser - Select File"; redLabel = "Select a file."; } else { if (windowName == "") windowName = "File Browser - Select Folder"; if (redLabel == "") redLabel = "Select a folder."; } if (startDirectory != "") { if (DirectoryExsists(startDirectory)) currentDir = startDirectory; else currentDir = DefaultDirectory; UpdateList(currentDir, SearchPattern); } else { UpdateList(DefaultDirectory, SearchPattern); } show = true; }
public FileChosenEventArgs(string FilePath, FileSelectMode ModeChosen) { this.FilePath = FilePath; OriginalMode = ModeChosen; }