Exemple #1
0
        public static FlowDocument Build(JaVi javi)
        {
            if (javi == null)
            {
                return(null);
            }

            //-------------start build ---------------------------
            FlowDocument document = new FlowDocument()
            {
                PagePadding = new Thickness(20)
            };

            //build document header
            document.Blocks.Add(BuildDocumentHeader(javi.Word, javi.Kana));
            //build Vi mean
            if (javi.Mean != null)
            {
                document.Blocks.Add(BuilderHelper.BuildWordMean(javi.Mean, true));
            }

            document.Blocks.Add(BuilderHelper.BuildWordKanji(javi.Word));

            //TODO verd division


            //return
            return(document);
        }
Exemple #2
0
        public static FlowDocument Build(ViJa vija)
        {
            if (vija == null)
            {
                return(null);
            }
            var mean = JsonConvert.DeserializeObject <WordMean[]>(vija.Mean);

            //-------------start build ---------------------------
            FlowDocument document = new FlowDocument()
            {
                PagePadding = new Thickness(20)
            };

            //build document header
            document.Blocks.Add(BuildDocumentHeader(vija.Word));
            //build Vi mean
            document.Blocks.Add(BuilderHelper.BuildWordMean(vija.Mean, true));
            return(document);
        }