Beispiel #1
0
 /// <summary>
 /// Найти таблицы в колонтитулах
 /// </summary>
 private IResultAppCollection <IStamp> FindStamps(ConvertingSettingsApp convertingSettings) =>
 _document.Sections.ToEnumerable().
 SelectMany(section => section.Footers.ToEnumerable()).
 SelectMany(SearchInRange.GetTablesFromFooter).
 ToList().
 Map(GetTableStampTypes).
 ResultValueBad(tableStamp => tableStamp.Concat(GetTableStampTypes(_document.Tables.ToEnumerable()).Value
                                                ?? Enumerable.Empty <TableStampType>()).
                ToList()).
 ResultValueOkBind(tableStamp => GetStampsInOrder(tableStamp, convertingSettings)).
 ToResultCollection();
Beispiel #2
0
 /// <summary>
 /// Найти штампы в модели
 /// </summary>
 public IEnumerable <IStamp> FindStamps(int modelIndex, ConvertingSettingsApp convertingSettings) =>
 GetModelElements(new List <ElementMicrostationType>()
 {
     ElementMicrostationType.CellElement
 }).
 Where(element => StampFieldMain.IsStampName(element.AsCellElement.Name)).
 Select((element, stampIndex) =>
        new CellElementMicrostation(element.AsCellElement, ToOwnerMicrostation()).
        Map(cellMicrostation => new StampFullMicrostation(cellMicrostation,
                                                          new StampSettings(new StampIdentifier(modelIndex, stampIndex),
                                                                            convertingSettings.PersonId,
                                                                            convertingSettings.PdfNamingType,
                                                                            convertingSettings.UseDefaultSignature),
                                                          ApplicationMicrostation.MicrostationResources.SignaturesSearching))).
 Cast <IStamp>();
Beispiel #3
0
 /// <summary>
 /// Поучить штампы в порядке их сортировки
 /// </summary>
 private IResultAppCollection <IStamp> GetStampsInOrder(IList <TableStampType> tablesStamp, ConvertingSettingsApp convertingSettings) =>
 StampCreating.GetMainStamp(tablesStamp[0].StampType, tablesStamp[0].TableWord,
                            StampCreating.GetStampSettingsWord(0, convertingSettings, PaperSize, OrientationType),
                            ApplicationOffice.ResourcesWord.SignaturesSearching, Tables).
 Map(mainStamp => new ResultAppCollection <IStamp>(new List <IStamp>()
 {
     mainStamp
 }).
     ConcatResult(GetShortStamps(tablesStamp.Where(tableStamp => tableStamp.StampType == StampType.Shortened).
                                 Select(tableStamp => tableStamp.TableWord),
                                 mainStamp, convertingSettings)));
Beispiel #4
0
 /// <summary>
 /// Список штампов
 /// </summary>
 public IStampContainer GetStampContainer(ConvertingSettingsApp convertingSettings) =>
 _stampContainer ??= new StampContainer(FindStamps(convertingSettings), StampContainerType.United);
Beispiel #5
0
 /// <summary>
 /// Получить сокращенные штампы
 /// </summary>
 private IResultAppCollection <IStamp> GetShortStamps(IEnumerable <ITableElementWord> tablesStamp, IStamp fullStamp, ConvertingSettingsApp convertingSettings) =>
 StampCreating.GetShortStamps(fullStamp, tablesStamp,
                              StampCreating.GetStampSettingsWord(1, convertingSettings, PaperSize, OrientationType),
                              ApplicationOffice.ResourcesWord.SignaturesSearching);
Beispiel #6
0
 /// <summary>
 /// Найти штампы во всех моделях и листах
 /// </summary>
 private static IResultAppCollection <IStamp> FindStamps(IEnumerable <IModelMicrostation> modelsMicrostation,
                                                         ConvertingSettingsApp convertingSettings) =>
 modelsMicrostation.SelectMany((model, modelIndex) => model.FindStamps(modelIndex, convertingSettings)).
 Map(stamps => new ResultAppCollection <IStamp>(stamps, new ErrorApplication(ErrorApplicationType.StampNotFound, "Штампы не найдены")));
Beispiel #7
0
 /// <summary>
 /// Контейнер штампов
 /// </summary>
 public IStampContainer GetStampContainer(ConvertingSettingsApp convertingSettings) =>
 _stampContainer ??= new StampContainer(FindStamps(ModelsMicrostation, convertingSettings), StampContainerType.United);