protected Image DrawSquareCover(IExportItem exportItem) { var subject = exportItem.Subject; var(graphics, image) = FillHalfAndDrawImage(exportItem.Cover, 1000, 1000); var realtyType = BeautifyString(subject.RealtyType.Name); var operation = BeautifyString(subject.Operation.Name); DrawString(subject.Code, graphics, new PointF(20, 20), VeryLargeFont, AccentBrush); DrawOperationAndRealtyType(graphics, realtyType, operation, 110, 450, 460); if (Logo != null) { graphics.DrawImage(Logo, 40, 540, 260, 85); } DrawString(GetAgentName(subject.Agent), graphics, new PointF(35, 720), MediumFont, DefaultBrush); DrawString("риэлтор", graphics, new PointF(35, 820), VerySmallFont, AccentBrush); var(phone1, phone2) = GetAgentPhones(subject.Agent); DrawString(phone1, graphics, new PointF(35, 885), SmallFont, DefaultBrush); DrawString(phone2, graphics, new PointF(35, 930), SmallFont, DefaultBrush); return(image); }
Assembly TryReflectionOnlyLoad(IExportItem file) { try { return Assembly.ReflectionOnlyLoadFrom(file.FullPath); } catch{ return null; } }
protected virtual void HandleImages(IExportItem exportItem) { if (ImageHandler == null) { return; } exportItem.Cover = ImageHandler.HandleMainPhoto(exportItem); exportItem.Photos = ImageHandler.HandlePhotos(exportItem); }
static IExportItem CreateAssemblyRef(IExportItem item) { try { return new AssemblyReferenceExportItem(item); } catch (Exception) { return null; } }
public AssemblyReferenceExportItem(IExportItem item) { _wrapped = item; AssemblyName = AssemblyName.GetAssemblyName(item.FullPath); }
internal protected abstract Task <PublishedItem> ExportAsync(IExportItem exportItem);
protected override Task <PublishedItem> ExportAsync(IExportItem exportItem) { Debug.WriteLine("ExportAsync"); return(new Task <PublishedItem>(() => new PublishedItem())); }