public ImageMaster ImageData(int id) { ImageMaster image = _unitOfWork.Images.Get(id); if (image == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } return(image); }
public HttpResponseMessage Post(ImageMaster item) { _unitOfWork.Images.Add(item); _unitOfWork.Complete(); var response = Request.CreateResponse <ImageMaster>(HttpStatusCode.Created, item); string uri = Url.Link("DefaultApi", new { id = item.ImageId }); response.Headers.Location = new Uri(uri); return(response); }
public void DeleteImage(int id) { ImageMaster item = _unitOfWork.Images.Get(id); if (item == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } _unitOfWork.Images.Remove(item); _unitOfWork.Complete(); }
public void Put(ImageMaster image) { int id = image.ImageId; var query = _unitOfWork.Images.Find(s => s.ImageId == id); foreach (var item in query) { item.ImageName = image.ImageName; item.PhotographerName = image.PhotographerName; item.Price = image.Price; item.EmailId = image.EmailId; } _unitOfWork.Complete(); }
private static PspIsoInfo GetPspIsoInfo( ImageMaster.ImageRecord record ) { ImageMaster.ImageRecord myRecord = null; var myDict = new Dictionary<Sectors, long>(); MyFunc func = delegate( string path, Sectors sector ) { myRecord = record.GetItemPath( path ); if (myRecord != null) { myDict[sector] = myRecord.Location; } else { throw new FileNotFoundException( "couldn't find file in ISO", path ); } }; func( "PSP_GAME/ICON0.PNG", Sectors.PSP_GAME_ICON0_PNG ); func( "PSP_GAME/PARAM.SFO", Sectors.PSP_GAME_PARAM_SFO ); func( "PSP_GAME/PIC0.PNG", Sectors.PSP_GAME_PIC0_PNG ); func( "PSP_GAME/PIC1.PNG", Sectors.PSP_GAME_PIC1_PNG ); func( "PSP_GAME/SYSDIR/BOOT.BIN", Sectors.PSP_GAME_SYSDIR_BOOT_BIN ); func( "PSP_GAME/SYSDIR/EBOOT.BIN", Sectors.PSP_GAME_SYSDIR_EBOOT_BIN ); func( "PSP_GAME/SYSDIR/UPDATE/DATA.BIN", Sectors.PSP_GAME_SYSDIR_UPDATE_DATA_BIN ); func( "PSP_GAME/SYSDIR/UPDATE/EBOOT.BIN", Sectors.PSP_GAME_SYSDIR_UPDATE_EBOOT_BIN ); func( "PSP_GAME/SYSDIR/UPDATE/PARAM.SFO", Sectors.PSP_GAME_SYSDIR_UPDATE_PARAM_SFO ); func( "PSP_GAME/USRDIR/fftpack.bin", Sectors.PSP_GAME_USRDIR_fftpack_bin ); func( "PSP_GAME/USRDIR/movie/001_HolyStone.pmf", Sectors.PSP_GAME_USRDIR_movie_001_HolyStone_pmf ); func( "PSP_GAME/USRDIR/movie/002_Opening.pmf", Sectors.PSP_GAME_USRDIR_movie_002_Opening_pmf ); func( "PSP_GAME/USRDIR/movie/003_Abduction.pmf", Sectors.PSP_GAME_USRDIR_movie_003_Abduction_pmf ); func( "PSP_GAME/USRDIR/movie/004_Kusabue.pmf", Sectors.PSP_GAME_USRDIR_movie_004_Kusabue_pmf ); func( "PSP_GAME/USRDIR/movie/005_Get_away.pmf", Sectors.PSP_GAME_USRDIR_movie_005_Get_away_pmf ); func( "PSP_GAME/USRDIR/movie/006_Reassume_Dilita.pmf", Sectors.PSP_GAME_USRDIR_movie_006_Reassume_Dilita_pmf ); func( "PSP_GAME/USRDIR/movie/007_Dilita_Advice.pmf", Sectors.PSP_GAME_USRDIR_movie_007_Dilita_Advice_pmf ); func( "PSP_GAME/USRDIR/movie/008_Ovelia_and_Dilita.pmf", Sectors.PSP_GAME_USRDIR_movie_008_Ovelia_and_Dilita_pmf ); func( "PSP_GAME/USRDIR/movie/009_Dilita_Musing.pmf", Sectors.PSP_GAME_USRDIR_movie_009_Dilita_Musing_pmf ); func( "PSP_GAME/USRDIR/movie/010_Ending.pmf", Sectors.PSP_GAME_USRDIR_movie_010_Ending_pmf ); func( "PSP_GAME/USRDIR/movie/011_Russo.pmf", Sectors.PSP_GAME_USRDIR_movie_011_Russo_pmf ); func( "PSP_GAME/USRDIR/movie/012_Valuhurea.pmf", Sectors.PSP_GAME_USRDIR_movie_012_Valuhurea_pmf ); func( "PSP_GAME/USRDIR/movie/013_StaffRoll.pmf", Sectors.PSP_GAME_USRDIR_movie_013_StaffRoll_pmf ); func( "UMD_DATA.BIN", Sectors.UMD_DATA_BIN ); PspIsoInfo result = new PspIsoInfo(); result.fileToSectorMap = myDict; return result; }
private void ImageMasterFormatWriteUpdate(ImageMaster sender, FormatWriteUpdateEventArgs e) { UpdateBurn?.Invoke(e);//сказать делегату или и делай }
private void _imageMaster_FormatWriteUpdate(ImageMaster sender, FormatWriteUpdateEventArgs e) { UpdateBurn?.Invoke(e); }