コード例 #1
0
        private async void DoIt()
        {
            //string fileName = @"c:\testing\phoneprefix.txt";
            //JObject result = await IPFS.AddAsync(fileName);
            //Console.WriteLine(result["Hash"]);
            //JObject result = await IPFS.FilesLs("/policy_chain/one");

            this.m_Directories = await DirectoryCollection.Build();

            this.NotifyPropertyChanged("Directories");
        }
コード例 #2
0
        public static async Task <DirectoryCollection> Build()
        {
            DirectoryCollection directoryCollection = new DirectoryCollection();
            JObject             result = await IPFS.FilesLs("/");

            JArray entries = (JArray)result["Entries"];

            foreach (JObject jObject in entries)
            {
                string    subDirectoryName = jObject["Name"].ToString();
                Directory subDirectory     = new Directory(subDirectoryName, "/" + subDirectoryName);
                directoryCollection.Add(subDirectory);
                await AddChildrenRecursive(subDirectory);
            }
            return(directoryCollection);
        }