private TModel CreateNewAttachment() { SubjectAttachmentsViewModelBase viewModel = viewModelGetter(); var model = MainContainer.Instance.Resolve <TModel>(); model.RootSubjectId = RootSubjectIdentifier.Identify(viewModel.CurrentNotesOwner); model.RootSubjectType = viewModel.CurrentNotesOwner.TypeOfSubject; model.HostType = viewModel.CurrentNotesOwner.TypeOfSubject.ToAttachmentHostType(); model.HostId = model.RootSubjectId; return(model); }
protected override AttachmentPanelDecoratorBase_NonGeneric CreateAttachmentDecorator(string filePath) { byte[] fileData = File.ReadAllBytes(filePath); var photoModel = new PhotoAttachmentModel { добавить сохранение фул блоба и сжатие превью PreviewDataBlob = ImageScaler.ScaleToPreview(fileData), TypeOfAttachment = AttachmentType.Photo, RootSubjectType = subject?.TypeOfSubject ?? SubjectType.None, RootSubjectId = subject == null ? "" : RootSubjectIdentifier.Identify(subject) }; return(new PhotoPanelDecorator(PhotoAttachmentViewModel.CreateEditable(photoModel))); }