Ejemplo n.º 1
0
        /// <summary>
        /// Load directory structure as file tree
        /// </summary>
        /// <param name="Path"></param>
        public static void LoadFileTree(String Path)
        {
            //ExStart:LoadFileTree
            // Create/initialize image handler
            ViewerImageHandler imageHandler = new ViewerImageHandler(Utilities.GetConfigurations());

            // Load file tree list for custom path
            var options = new FileListOptions(Path);

            // Load file tree list for ViewerConfig.StoragePath
            FileListContainer container = imageHandler.GetFileList(options);

            foreach (var node in container.Files)
            {
                if (node.IsDirectory)
                {
                    Console.WriteLine("Guid: {0} | Name: {1} | LastModificationDate: {2}",
                                      node.Guid,
                                      node.Name,
                                      node.LastModificationDate);
                }
                else
                {
                    Console.WriteLine("Guid: {0} | Name: {1} | Document type: {2} | File type: {3} | Extension: {4} | Size: {5} | LastModificationDate: {6}",
                                      node.Guid,
                                      node.Name,
                                      node.DocumentType,
                                      node.FileType,
                                      node.Extension,
                                      node.Size,
                                      node.LastModificationDate);
                }
            }

            //ExEnd:LoadFioleTree
        }