public AsarExtractEvent(AsarFile file, double index, double total) { File = file; Index = index; Total = total; Progress = Math.Round(index / total * 100, 2); }
private void TokenIterator(JToken jToken) { JProperty jProperty = jToken as JProperty; foreach (JProperty prop in jProperty.Value.Children()) { int size = -1; int offset = -1; foreach (JProperty nextProp in prop.Value.Children()) { if (nextProp.Name == "files") { /* ENABLE FOR EMPTY FOLDERS (ONLY IF NEEDED) */ if (_emptyDir) { AsarFile afile = new AsarFile(prop.Path, "", size, offset); _filesToExtract.Add(afile); } TokenIterator(nextProp); } else { if (nextProp.Name == "size") { size = Int32.Parse(nextProp.Value.ToString()); } if (nextProp.Name == "offset") { offset = Int32.Parse(nextProp.Value.ToString()); } } } if (size > -1 && offset > -1) { AsarFile afile = new AsarFile(prop.Path, prop.Name, size, offset); _filesToExtract.Add(afile); } } }