Nanook.QueenBee.EditorForm.getBestFullFilename C# (CSharp) Method

getBestFullFilename() private method

private getBestFullFilename ( string fullFilename ) : string
fullFilename string
return string
        private string getBestFullFilename(string fullFilename)
        {
            if (fullFilename == null)
                return string.Empty;
            else if (fullFilename.Trim().Length == 0)
                return string.Empty;

            FileInfo fi;
            string pth = fullFilename;
            try
            {
                fi = new FileInfo(pth);
            }
            catch
            {
                return string.Empty;
            }
            if (!fi.Exists)
            {
                DirectoryInfo di = fi.Directory;
                while (!di.Exists)
                {
                    di = di.Parent;
                    if (di == null)
                        break;
                }
                if (di != null)
                    pth = di.FullName;
                else
                    pth = string.Empty;

                pth = Path.Combine(pth, fi.Name);
            }
            return pth;
        }
EditorForm