/// <summary>
 /// Конвертировать ячейку Microstation в Jpeg
 /// </summary>
 private ISignatureFileData ToJpegByte(IElementMicrostation cellSignature, ISignatureLibrary signatureLibraryBase) =>
 GetSignatureFileSavePath(signatureLibraryBase).
 Void(filePath => cellSignature.DrawToEmfFile(GetSignatureFileSavePath(signatureLibraryBase),
                                              ProjectSignatureSettings.JpegPixelSize.Width,
                                              ProjectSignatureSettings.JpegPixelSize.Height)).
 Map(filePathEmf => new SignatureFileData(signatureLibraryBase.PersonId, signatureLibraryBase.PersonInformation,
                                          JpegConverter.ToJpegFromEmf(filePathEmf), false).
     Void(_ => _fileSystemOperations.DeleteFile(filePathEmf))).
 Void(_ => cellSignature.Remove());
 /// <summary>
 /// Найти и изменить вложенный в штамп элемент.Только для внешних операций типа Scale, Move
 /// </summary>
 public void FindAndChangeSubElement(IElementMicrostation elementMicrostation)
 {
     _cellElement.ResetElementEnumeration();
     while (_cellElement.MoveToNextElement())
     {
         var elementCurrent = _cellElement.CopyCurrentElement();
         if (elementCurrent.ID64 == elementMicrostation?.Id)
         {
             _cellElement.ReplaceCurrentElement(SubElementsPair[elementMicrostation]);
             elementMicrostation.SetElement((Element)elementCurrent);
             break;
         }
     }
 }
 /// <summary>
 /// Функция вставки подписей из библиотеки
 /// </summary>
 protected Func <ISignatureLibraryApp, IResultAppValue <IStampFieldMicrostation> > InsertSignatureFunc
     (IElementMicrostation previousElement, IElementMicrostation nextElement, StampFieldType stampFieldType) =>
 signatureLibrary =>
 _insertSignatureByFields(signatureLibrary.PersonId, previousElement.AsTextElementMicrostation, nextElement.AsTextElementMicrostation).
 ResultValueOk(signature => new StampFieldMicrostation(signature, stampFieldType));
Пример #4
0
 public StampFieldMicrostation(IElementMicrostation elementStamp, StampFieldType stampFieldType)
     : base(stampFieldType)
 {
     ElementStamp = elementStamp ?? throw new ArgumentNullException(nameof(elementStamp));
 }