Esempio n. 1
0
        public override object Clone()
        {
            JsonFolder file = new JsonFolder();

            CloneMembers(file);
            return(file);
        }
Esempio n. 2
0
        protected override IEnumerable <IFolder> GetFolders()
        {
            if (!IsFolderLoaded)
            {
                RunOnUIThread(() =>
                {
                    this.Folders.Clear();
                });

                var             jsonFolders = this.JasonFolder.Items.Where(item => item.IsFolder);
                IList <IFolder> tempItems   = new List <IFolder>();
                foreach (var item in jsonFolders)
                {
                    string          folderPath = Path.Combine(this.FullPath, item.Name);
                    Data.JsonFolder jsonFolder = JsonRootFolder.GetFolderFromCache(folderPath);
                    if (!jsonFolder.IsNull())
                    {
                        JsonFolder folder = new JsonFolder(jsonFolder, this);
                        tempItems.Add(folder);
                    }
                }

                IsFolderLoaded = AddItemsByChunk(SetFolderOrder(tempItems), this.Folders, this.Items);
            }
            return(this.Folders);
        }
Esempio n. 3
0
        protected override IEnumerable <IFolder> GetFolders()
        {
            JsonParser factory            = new JsonParser();
            IList <Data.JsonFolder> items = factory.GetJsonItems(JsonPath);

            JsonFolderCache.Clear();

            foreach (var item in items)
            {
                JsonFolderCache[item.Name] = item;
            }

            var allPaths = JsonFolderCache.Keys.OrderBy(item => item.Length);

            IList <string> rootList = new List <string>();

            foreach (var folderPath in allPaths)
            {
                if (!rootList.Any(o => CheckIsTopLevel(o, folderPath)))
                {
                    //find a top level path
                    rootList.Add(folderPath);
                }
            }

            IList <IFolder> tempItems = new List <IFolder>();

            foreach (var item in rootList)
            {
                if (JsonFolderCache.ContainsKey(item))
                {
                    Data.JsonFolder jsonFolder = JsonFolderCache[item];
                    JsonFolder      folder     = new JsonFolder(jsonFolder, this);
                    tempItems.Add(folder);
                }
            }

            IsFolderLoaded = AddItemsByChunk(tempItems, this.Folders, this.Items);
            return(this.Folders);
        }