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)));
 }