public bool OpenFile(string requestedFilePath = "")
        {
            //Test case to check the broken marking is working.
            //return UnityEngine.Random.Range(0, 40) > 35 ? false : true;

            try
            {
                requestedFilePath = requestedFilePath.Length > 0 ? requestedFilePath : fullFilePath;
                OpenPathHelper.Open(requestedFilePath);
            }
            catch (Exception e)
            {
                Debug.LogError("Failed to open file path [" + fullFilePath + "]" + "\n" + e.Message);
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
 public void Display(string results, string convertedPath)
 {
     SetVisibility(true);
     ResultText.text = "<b>[The Operation Completed]</b>\n" + results + "\n" + "<i>(Better error reporting will come later)</i>";
     OpenConverted.onClick.RemoveAllListeners();
     OpenConverted.onClick.AddListener(() =>
     {
         try
         {
             OpenPathHelper.Open(convertedPath);
         }
         catch (System.Exception e)
         {
             Debug.LogError("Unable to open path " + convertedPath + "\n\t" + e.Message);
         }
         SetVisibility(false);
     });
 }