FromParsingName() публичный статический Метод

Returns a known folder given its shell path, such as C:\users\public\documents or ::{645FF040-5081-101B-9F08-00AA002F954E} for the Recycle Bin.
public static FromParsingName ( string parsingName ) : IKnownFolder
parsingName string The path for the requested known folder; either a physical path or a virtual path.
Результат IKnownFolder
Пример #1
0
        /*
         * /// <summary>
         * /// Returns a URI representation of the <see cref="ShellItem"/>.
         * /// </summary>
         * public Uri ToUri() {
         *      return this.ParsingName.StartsWith("::") ? new Uri("shell:///" + this.ParsingName) : new Uri(this.FileSystemPath);
         *      StringBuilder path = new StringBuilder("shell:///");
         *
         *      if (this.ParsingName.StartsWith("::")) {
         *              path.Append(this.ParsingName);
         *              return new Uri(path.ToString());
         *      }
         *      return new Uri(this.FileSystemPath);
         * }
         */

        private void Initialize(Uri uri)
        {
            if (uri.Scheme == "file")
            {
                ComInterface = CreateItemFromParsingName(uri.LocalPath);
            }
            else if (uri.Scheme == "shell")
            {
                //InitializeFromShellUri(uri);
                //TO_DO: add shell folders handling here
                //KnownFolderManager manager = new KnownFolderManager();
                string path = uri.GetComponents(UriComponents.Path, UriFormat.Unescaped);
                string knownFolder;
                string restOfPath;
                int    separatorIndex = path.IndexOf('/');

                if (separatorIndex != -1)
                {
                    knownFolder = path.Substring(0, separatorIndex);
                    restOfPath  = path.Substring(separatorIndex + 1);
                }
                else
                {
                    knownFolder = path;
                    restOfPath  = string.Empty;
                }

                try {
                    IKnownFolder knownFolderI = KnownFolderHelper.FromParsingName(knownFolder);
                    if (knownFolderI != null)
                    {
                        ComInterface = (knownFolderI as ShellItem).ComInterface;
                    }
                    else if (knownFolder.StartsWith(KnownFolders.Libraries.ParsingName))
                    {
                        var lib = ShellLibrary.Load(Path.GetFileNameWithoutExtension(knownFolder), true);

                        if (lib != null)
                        {
                            ComInterface = lib.ComInterface;
                        }
                    }
                }
                catch {
                }

                if (restOfPath != string.Empty)
                {
                    ComInterface = this[restOfPath.Replace('/', '\\')].ComInterface;
                }
            }
            else
            {
                throw new InvalidOperationException("Invalid URI scheme");
            }
        }
 /// <summary>
 /// Returns a known folder given its shell path, such as <c>C:\users\public\documents</c> or
 /// <c>::{645FF040-5081-101B-9F08-00AA002F954E}</c> for the Recycle Bin.
 /// </summary>
 /// <param name="path">The path for the requested known folder; either a physical path or a virtual path.</param>
 /// <returns>A known folder representing the specified name.</returns>
 public static IKnownFolder FromPath(string path)
 {
     return(KnownFolderHelper.FromParsingName(path));
 }