public static void AddChild(this CloudFolder cloudFolder, CloudItem cloudItem) { if (cloudFolder.Children == null) { cloudFolder.Children = new List<CloudItem>(); } cloudFolder.Children.Add(cloudItem); cloudItem.Parent = cloudFolder; }
public void AddItem(CloudItem cloudItem) { if(cloudItem is CloudFile) { var cloudFile = cloudItem as CloudFile; fingerprintMap[cloudFile.Fingerprint.ToLower()] = cloudFile; } pathMap[cloudItem.FullName().ToLower()] = cloudItem; }
public void UpdateProcessRecord(CloudItem item, ProcessTypes type, int progress) { ProcessRecord processRecord = null; lock (this) { if (map.ContainsKey(item)) { processRecord = map[item]; } else { processRecord = new ProcessRecord(); processRecord.Item = item; processRecord.Name = item.Name; processRecord.Path = item.FullDirectory(); processRecords.Add(processRecord); map[processRecord.Item] = processRecord; } processRecord.Type = type; processRecord.Progress = progress; } }