public PackageBuilder(PackageBody body, PackageContentType contentType) { body.ContentType = contentType; _content = PackageContent.PackageContent.Create(contentType); Errors = new List<PackageErrorInfo>(); _body = body; }
public PackageBuilder(PackageBody body, PackageContentType contentType) { body.ContentType = contentType; _content = PackageContent.PackageContent.Create(contentType); Errors = new List <PackageErrorInfo>(); _body = body; }
private void LoadPackageBody(string filePath) { string contentDirectoryPath = GetContentPath(); PackageContentType contentType = PackageContent.PackageContent.GetContentType(filePath); if (contentType == PackageContentType.Wrong) { throw new Exception("Неверный тип файла"); } _content = PackageContent.PackageContent.Create(contentType); _context.Log.AddLogInformation("Создали экземпляр PackageContent"); _content.LoadBody(contentDirectoryPath, filePath); InternalLoadPackageBody(); }
private void LoadPackageContent(string filePath) { string contentDirectoryPath = GetContentPath(); PackageContentType contentType = PackageContent.PackageContent.GetContentType(filePath); if (contentType == PackageContentType.Wrong) { throw new Exception("Неверный тип файла"); } _content = PackageContent.PackageContent.Create(contentType); _context.Log.AddLogInformation("Создали экземпляр PackageContent"); _content.OnProgress += _context.Log.SendProgress; _content.OnQueryCancel += _context.Log.GetPendingCancel; _context.Log.CurrentProgress = 0; _context.Log.ProgressTotalCost = 100; _content.Load(contentDirectoryPath, filePath); CheckPendingCancel(); _context.Log.AddLogInformation("Загрузили контент из '" + filePath + "', тип контента " + contentType); }