private async Task <DM.Bibliography> CreateBibliographyAsync(DE.Style style, DE.Format format, List <DM.ContentItem> contentItems)
        {
            ExpandoObject         request     = new ExpandoObject();
            List <PM.ContentItem> requestList = new List <PM.ContentItem>();

            requestList.AddRange(contentItems.Select((x, i) => PF.CiteProcFactory.Build(i.ToString(), x)));
            requestList = _overrideManager.PreProcessBibliography(style, requestList);
            requestList.ForEach(x => request.TryAdd(x.ID, x));
            using (StringAsTempFile file = new StringAsTempFile(GetContents(), CancellationToken.None))
            {
                string result = await NodeServices.InvokeAsync <string>(file.FileName,
                                                                        GetLibrary(),
                                                                        PL.Locale.GetLocale(),
                                                                        PD.Definition.GetDefinition(style),
                                                                        PF.CiteProcFactory.Build(format),
                                                                        JObject.Parse(request.ToSerializedJSON()));

                PM.Bibliography bibliography = JsonConvert.DeserializeObject <PM.Bibliography>(result);
                bibliography.ProcessExceptions();
                bibliography = _overrideManager.PostProcessBibliography(style, bibliography);
                DM.Bibliography response = PF.CiteProcFactory.Build(bibliography);
                return(response);
            }
        }
示例#2
0
        private async Task <DM.Citation> CreateCitationAsync(DE.Style style, DE.Format format, DM.ContentItem contentItem)
        {
            ExpandoObject         request     = new ExpandoObject();
            List <PM.ContentItem> requestList = new List <PM.ContentItem>();

            requestList.Add(PF.CiteProcFactory.Build("0", contentItem));
            requestList = _overrideManager.PreProcessCitation(style, requestList);
            requestList.ForEach(x => request.TryAdd(x.ID, x));
            using (StringAsTempFile file = new StringAsTempFile(GetContents(), CancellationToken.None))
            {
                string result = await NodeServices.InvokeAsync <string>(file.FileName,
                                                                        GetLibrary(),
                                                                        PL.Locale.GetLocale(),
                                                                        PD.Definition.GetDefinition(style),
                                                                        PF.CiteProcFactory.Build(format),
                                                                        JObject.Parse(request.ToSerializedJSON()));

                PM.Citation citation = JsonConvert.DeserializeObject <PM.Citation>(result);
                citation.ProcessExceptions();
                citation = _overrideManager.PostProcessCitation(style, citation);
                DM.Citation response = PF.CiteProcFactory.Build(citation);
                return(response);
            }
        }
示例#3
0
 public DM.Citation CreateCitationAudioRecording(DE.Style style, DE.Format format, DM.AudioRecording audioRecording)
 {
     return(_citationProcessor.CreateCitationAudioRecording(style, format, RuleManagerAudioRecording.Validate(audioRecording)));
 }
示例#4
0
 public DM.Citation CreateCitationGraphic(DE.Style style, DE.Format format, DM.Graphic graphic)
 {
     return(CreateCitationAsync(style, format, graphic).Result);
 }
示例#5
0
 public DM.Citation CreateCitationWebpage(DE.Style style, DE.Format format, DM.Webpage webpage)
 {
     return(CreateCitationAsync(style, format, webpage).Result);
 }
示例#6
0
 public DM.Citation CreateCitationMagazine(DE.Style style, DE.Format format, DM.Magazine magazine)
 {
     return(CreateCitationAsync(style, format, magazine).Result);
 }
示例#7
0
 public DM.Citation CreateCitationChapter(DE.Style style, DE.Format format, DM.Chapter chapter)
 {
     return(CreateCitationAsync(style, format, chapter).Result);
 }
示例#8
0
 public DM.Citation CreateCitationReport(DE.Style style, DE.Format format, DM.Report report)
 {
     return(CreateCitationAsync(style, format, report).Result);
 }
 public DM.Bibliography CreateBibliography(DE.Style style, DE.Format format, List <DM.ContentItem> contentItems)
 {
     return(CreateBibliographyAsync(style, format, contentItems).Result);
 }
示例#10
0
 public DM.Citation CreateCitationInterview(DE.Style style, DE.Format format, DM.Interview interview)
 {
     return(_citationProcessor.CreateCitationInterview(style, format, RuleManagerInterview.Validate(interview)));
 }
示例#11
0
 public DM.Citation CreateCitationPresentation(DE.Style style, DE.Format format, DM.Presentation presentation)
 {
     return(_citationProcessor.CreateCitationPresentation(style, format, RuleManagerPresentation.Validate(presentation)));
 }
示例#12
0
 public DM.Citation CreateCitationPersonalCommunication(DE.Style style, DE.Format format, DM.PersonalCommunication personalCommunication)
 {
     return(_citationProcessor.CreateCitationPersonalCommunication(style, format, RuleManagerPersonalCommunication.Validate(personalCommunication)));
 }
示例#13
0
 public DM.Citation CreateCitationBroadcast(DE.Style style, DE.Format format, DM.Broadcast broadcast)
 {
     return(_citationProcessor.CreateCitationBroadcast(style, format, RuleManagerBroadcast.Validate(broadcast)));
 }
示例#14
0
 public DM.Citation CreateCitationVideoRecording(DE.Style style, DE.Format format, DM.VideoRecording videoRecording)
 {
     return(_citationProcessor.CreateCitationVideoRecording(style, format, RuleManagerVideoRecording.Validate(videoRecording)));
 }
示例#15
0
 public DM.Citation CreateCitationLegislation(DE.Style style, DE.Format format, DM.Legislation legislation)
 {
     return(CreateCitationAsync(style, format, legislation).Result);
 }
示例#16
0
 public DM.Citation CreateCitationVideoRecording(DE.Style style, DE.Format format, DM.VideoRecording videoRecording)
 {
     return(CreateCitationAsync(style, format, videoRecording).Result);
 }
示例#17
0
 public DM.Citation CreateCitationLegalCase(DE.Style style, DE.Format format, DM.LegalCase legalCase)
 {
     return(CreateCitationAsync(style, format, legalCase).Result);
 }
示例#18
0
 public DM.Citation CreateCitationBroadcast(DE.Style style, DE.Format format, DM.Broadcast broadcast)
 {
     return(CreateCitationAsync(style, format, broadcast).Result);
 }
示例#19
0
 public DM.Citation CreateCitationConferencePaper(DE.Style style, DE.Format format, DM.ConferencePaper conferencePaper)
 {
     return(CreateCitationAsync(style, format, conferencePaper).Result);
 }
示例#20
0
 public DM.Citation CreateCitationPersonalCommunication(DE.Style style, DE.Format format, DM.PersonalCommunication personalCommunication)
 {
     return(CreateCitationAsync(style, format, personalCommunication).Result);
 }
示例#21
0
 public DM.Citation CreateCitationBook(DE.Style style, DE.Format format, DM.Book book)
 {
     return(CreateCitationAsync(style, format, book).Result);
 }
示例#22
0
 public DM.Citation CreateCitationInterview(DE.Style style, DE.Format format, DM.Interview interview)
 {
     return(CreateCitationAsync(style, format, interview).Result);
 }
示例#23
0
 public DM.Citation CreateCitationJournal(DE.Style style, DE.Format format, DM.Journal journal)
 {
     return(CreateCitationAsync(style, format, journal).Result);
 }
示例#24
0
 public DM.Citation CreateCitationPresentation(DE.Style style, DE.Format format, DM.Presentation presentation)
 {
     return(CreateCitationAsync(style, format, presentation).Result);
 }
示例#25
0
 public DM.Citation CreateCitationNewspaper(DE.Style style, DE.Format format, DM.Newspaper newspaper)
 {
     return(CreateCitationAsync(style, format, newspaper).Result);
 }
示例#26
0
 public DM.Citation CreateCitationMap(DE.Style style, DE.Format format, DM.Map map)
 {
     return(CreateCitationAsync(style, format, map).Result);
 }
示例#27
0
 public DM.Citation CreateCitationEncyclopedia(DE.Style style, DE.Format format, DM.Encyclopedia encyclopedia)
 {
     return(CreateCitationAsync(style, format, encyclopedia).Result);
 }
示例#28
0
 public DM.Citation CreateCitationBill(DE.Style style, DE.Format format, DM.Bill bill)
 {
     return(CreateCitationAsync(style, format, bill).Result);
 }
示例#29
0
 public DM.Citation CreateCitationAudioRecording(DE.Style style, DE.Format format, DM.AudioRecording audioRecording)
 {
     return(CreateCitationAsync(style, format, audioRecording).Result);
 }
示例#30
0
 public DM.Citation CreateCitationGraphic(DE.Style style, DE.Format format, DM.Graphic graphic)
 {
     return(_citationProcessor.CreateCitationGraphic(style, format, RuleManagerGraphic.Validate(graphic)));
 }