예제 #1
0
 public PackageBuilder(PackageBody body, PackageContentType contentType)
 {
     body.ContentType = contentType;
     _content = PackageContent.PackageContent.Create(contentType);
     Errors = new List<PackageErrorInfo>();
     _body = body;
 }
예제 #2
0
 public PackageBuilder(PackageBody body, PackageContentType contentType)
 {
     body.ContentType = contentType;
     _content         = PackageContent.PackageContent.Create(contentType);
     Errors           = new List <PackageErrorInfo>();
     _body            = body;
 }
예제 #3
0
파일: Package.cs 프로젝트: vgrinin/gin
        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();
        }
예제 #4
0
파일: Package.cs 프로젝트: vgrinin/gin
        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);
        }
예제 #5
0
파일: Package.cs 프로젝트: vgrinin/gin
        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);
        }
예제 #6
0
파일: Package.cs 프로젝트: vgrinin/gin
 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();
 }