///<summary>Обновление приложения, а также добавление у клиента</summary> public ServiceResult UpdateApp(string app_name) { AppVersion ActialVers = Discription.GetAppVersion(app_name); IDictionary <FileOfVersion, byte[]> fileContents = Src_content.FindFileOfVersionsWithData(ActialVers); ServiceResult service = new ServiceResult(Dst_content.Save(ActialVers, fileContents)); Dst_meta.SaveApplication(ActialVers); return(service); }
///<summary>Добавление приложения нового приложения</summary> public ServiceResult AddAplicationNew(string rootPath, string appName, VersionNumber appVerNumber) { IApplicationVersionBuilder application = new AppBuilder(rootPath, appName, appVerNumber); AppVersion srcV = application.Build(); IDictionary <FileOfVersion, byte[]> fileContents = application.FindFileOfVersionsWithData(); ServiceResult service = new ServiceResult(Dst_content.Save(srcV, fileContents)); Dst_meta.SaveApplication(srcV); return(service); }
///<summary>Добавление приложения</summary> public ServiceResult AddAplication(string appName, IApplicationVersionBuilder application) { AppVersion srcV = application.Build(); AppVersion Version = Src_meta.FindLast(appName); AppVersion newVersion = new AppVersion(srcV.VersionName, new VersionNumber(srcV.VersionNumber.Number, Version.VersionNumber.VersionBuildNumber + 1), srcV.Files); if (Version.VersionNumber < newVersion.VersionNumber) { IDictionary <FileOfVersion, byte[]> fileContents = application.FindFileOfVersionsWithData(); ServiceResult service = new ServiceResult(Dst_content.Save(newVersion, fileContents)); Dst_meta.SaveApplication(newVersion); return(service); } else { ServiceResult service = new ServiceResult(false); return(service); } }