public DocumentModificationResult AddDocumentPageBitmap(OrderedBitmap bitmap) { if (_documentPages.ContainsKey((int)bitmap.Order)) { return(DocumentModificationResult.Failure(new AddedBitmapForPageTwice((int)bitmap.Order))); } return(ReplaceDocumentPageBitmap(bitmap)); }
public DocumentModificationResult ReplaceDocumentPageBitmap(OrderedBitmap bitmap) { if (!TemplateDefinition.DefinedPages.ContainsKey((int)bitmap.Order)) { return(DocumentModificationResult.Failure(new AddedBitmapForNonexistentPage((int)bitmap.Order))); } if (_documentPages.ContainsKey((int)bitmap.Order)) { _documentPages[(int)bitmap.Order] = bitmap; } else { _documentPages.Add((int)bitmap.Order, bitmap); } return(DocumentModificationResult.Success()); }