Exemplo n.º 1
0
        private void tvFoundBooks_AfterSelect(object sender, TreeViewEventArgs e)
        {
            DocumentEngine engine = new DocumentEngine();
            string         path   = e.Node.Tag?.ToString() ?? "";

            Console.WriteLine("path = " + path);

            if (File.Exists(path))
            {
                var(dateCreated, dateLastAccessed, fileName, fileExtention, fileLength, hasError) = engine.GetFileProperites(e.Node.Tag.ToString());

                if (!hasError)
                {
                    txtFileName.Text     = fileName;
                    txtExtension.Text    = fileExtention;
                    dtCreated.Value      = dateCreated;
                    dtLastAccessed.Value = dateLastAccessed;
                    txtFilePath.Text     = e.Node.Tag.ToString();
                    txtFileSize.Text     = $"{Round(fileLength.ToMegabytes(), 2).ToString()}MB";
                }
            }
        }