Ejemplo n.º 1
0
        private AnalyzeResult AnalyzePath(string path)
        {
            AnalyzeResult result = new AnalyzeResult(path);

            if (File.Exists(path))
            {
                result.Exists           = true;
                result.IsFile           = true;
                result.ParentDicrectory = Path.GetDirectoryName(path);
                result.SimpleName       = Path.GetFileNameWithoutExtension(path);
                result.Extension        = Path.GetExtension(path);
            }
            else if (Directory.Exists(path))
            {
                result.Exists           = true;
                result.IsFile           = false;
                result.ParentDicrectory = Path.GetDirectoryName(path);
                result.SimpleName       = Path.GetFileNameWithoutExtension(path);
            }

            return(result);
        }