예제 #1
0
 public static void AppendViewModel(this ItemText text, IRuleHandler handler, OutputSectionModelCollection viewModel)
 {
     if (text?.IsEmpty == false)
     {
         viewModel.Add(OutputSectionFactory.Create(TextHolderKind.Text,
                                                   new List <ItemTextNoted> {
             new ItemTextNoted(text)
         }));
     }
 }
예제 #2
0
        private static void AppendYmnis(List <Ymnos> ymnis, IRuleHandler handler,
                                        IRuleSerializerRoot serializer, OutputSectionModelCollection viewModel)
        {
            var(StihosText, ChoirText) = GetStringValues(handler, serializer);

            foreach (Ymnos ymnos in ymnis)
            {
                //добавляем стих и песнопение как отдельные объекты
                foreach (ItemText stihos in ymnos.Stihoi)
                {
                    viewModel.Add(OutputSectionFactory.Create(TextHolderKind.Stihos, StihosText,
                                                              new List <ItemTextNoted> {
                        new ItemTextNoted(stihos)
                    }));
                }

                viewModel.Add(OutputSectionFactory.Create(TextHolderKind.Choir, ChoirText,
                                                          new List <ItemTextNoted> {
                    new ItemTextNoted(ymnos.Text)
                }));
            }
        }
예제 #3
0
        public static void AppendViewModel(this Prosomoion prosomoion, int typiconVersionId,
                                           IRuleSerializerRoot serializer, OutputSectionModelCollection viewModel, int?ihos = null)
        {
            ItemText ihosItemText       = null;
            ItemText prosomoionItemText = null;

            if (ihos != null)
            {
                //текст "Глас"
                ihosItemText = serializer.GetCommonRuleItemTextValue(typiconVersionId, CommonRuleConstants.IhosText);
                ihosItemText.ReplaceForEach("[ihos]", ihos.Value);
            }
            else
            {
                ihosItemText = new ItemText();
            }

            //самоподобен?
            if (prosomoion?.Self == true)
            {
                prosomoionItemText = serializer.GetCommonRuleItemTextValue(typiconVersionId, CommonRuleConstants.SelfText);
            }
            //если подобен
            else if (prosomoion?.IsEmpty == false)
            {
                prosomoionItemText = serializer.GetCommonRuleItemTextValue(typiconVersionId, CommonRuleConstants.ProsomoionText);
                prosomoionItemText.ReplaceForEach("[name]", prosomoion);
            }
            else
            {
                prosomoionItemText = new ItemText();
            }

            //соединяем воедино
            ihosItemText.Merge(prosomoionItemText);

            viewModel.Add(OutputSectionFactory.Create(TextHolderKind.Text,
                                                      new List <ItemTextNoted> {
                new ItemTextNoted(ihosItemText)
            }));
        }