Пример #1
0
        private static void SortLift(string outputPath, LexEntryRepository lexEntryRepository, ViewTemplate template)
        {
            using (var exporter = new LiftWriter(outputPath, LiftWriter.ByteOrderStyle.NoBOM))
            {
                IWritingSystemDefinition firstWs      = template.HeadwordWritingSystems[0];
                ResultSet <LexEntry>     recordTokens =
                    lexEntryRepository.GetAllEntriesSortedByHeadword(firstWs);
                int index = 0;
                foreach (RecordToken <LexEntry> token in recordTokens)
                {
                    int homographNumber = 0;
                    if ((bool)token["HasHomograph"])
                    {
                        homographNumber = (int)token["HomographNumber"];
                    }
                    LexEntry lexEntry = token.RealObject;
                    EmbeddedXmlCollection sortedAnnotation = new EmbeddedXmlCollection();
                    sortedAnnotation.Values.Add("<annotation name='sorted-index' value='" + (++index) + "'/>");

                    lexEntry.Properties.Add(new KeyValuePair <string, IPalasoDataObjectProperty>("SortedIndex", sortedAnnotation));

                    exporter.Add(lexEntry, homographNumber);
                }

                exporter.End();
            }
        }
Пример #2
0
 private void WriteEmbeddedXmlCollection(EmbeddedXmlCollection collection)
 {
     foreach (string rawXml in collection.Values)
     {
         Writer.WriteRaw(rawXml);
     }
 }
Пример #3
0
		private void WriteEmbeddedXmlCollection(EmbeddedXmlCollection collection)
		{
			foreach (string rawXml in collection.Values)
			{
				Writer.WriteRaw(rawXml);
			}
		}