Esempio n. 1
0
        private void Send_Path(object sender, RoutedEventArgs e)
        {
            JSOInfoFolder  jSOInfoFolder = null;
            FileAttributes attr          = new FileAttributes();

            string inputPath = IntroducedPath.Text;

            ShowJSON(attr, inputPath, jSOInfoFolder);
        }
Esempio n. 2
0
 private void CheckPath(FileAttributes attr, string inputPath, JSOInfoFolder jSOInfoFolder, DirectoryInfo info)
 {
     if (attr.HasFlag(FileAttributes.Directory) &&
         info.Attributes.ToString() == FileAttributes.Directory.ToString() ||
         info.Attributes.ToString() == "ReadOnly, Directory")
     {
         jSOInfoFolder = new JSOInfoFolder(new DirectoryInfo(inputPath));
         string result = jSOInfoFolder.JsonToTree();
         OutputWindow.Text = result;
     }
 }
Esempio n. 3
0
 private void ShowJSON(FileAttributes attr, string inputPath, JSOInfoFolder jSOInfoFolder)
 {
     try
     {
         attr = File.GetAttributes(inputPath);
         DirectoryInfo info = new DirectoryInfo(inputPath);
         CheckPath(attr, inputPath, jSOInfoFolder, info);
     }
     catch
     {
         OutputWindow.Text = "Sorry, but you input incorrect path to directory";
     }
 }