AccessProviderSample.AccessDBProvider.IsValidPath C# (CSharp) Method

IsValidPath() protected method

Test to see if the specified path is syntactically valid.
protected IsValidPath ( string path ) : bool
path string The path to validate.
return bool
        protected override bool IsValidPath(string path)
        {
            bool result = true;

            // check if the path is null or empty
            if (String.IsNullOrEmpty(path))
            {
                result = false;
            }

            // convert all separators in the path to a uniform one
            path = NormalizePath(path);

            // split the path into individual chunks
            string[] pathChunks = path.Split(pathSeparator.ToCharArray());

            foreach (string pathChunk in pathChunks)
            {
                if (pathChunk.Length == 0)
                {
                    result = false;
                }
            }
            return result;
        }