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); } }
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); } }
public DM.Citation CreateCitationAudioRecording(DE.Style style, DE.Format format, DM.AudioRecording audioRecording) { return(_citationProcessor.CreateCitationAudioRecording(style, format, RuleManagerAudioRecording.Validate(audioRecording))); }
public DM.Citation CreateCitationGraphic(DE.Style style, DE.Format format, DM.Graphic graphic) { return(CreateCitationAsync(style, format, graphic).Result); }
public DM.Citation CreateCitationWebpage(DE.Style style, DE.Format format, DM.Webpage webpage) { return(CreateCitationAsync(style, format, webpage).Result); }
public DM.Citation CreateCitationMagazine(DE.Style style, DE.Format format, DM.Magazine magazine) { return(CreateCitationAsync(style, format, magazine).Result); }
public DM.Citation CreateCitationChapter(DE.Style style, DE.Format format, DM.Chapter chapter) { return(CreateCitationAsync(style, format, chapter).Result); }
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); }
public DM.Citation CreateCitationInterview(DE.Style style, DE.Format format, DM.Interview interview) { return(_citationProcessor.CreateCitationInterview(style, format, RuleManagerInterview.Validate(interview))); }
public DM.Citation CreateCitationPresentation(DE.Style style, DE.Format format, DM.Presentation presentation) { return(_citationProcessor.CreateCitationPresentation(style, format, RuleManagerPresentation.Validate(presentation))); }
public DM.Citation CreateCitationPersonalCommunication(DE.Style style, DE.Format format, DM.PersonalCommunication personalCommunication) { return(_citationProcessor.CreateCitationPersonalCommunication(style, format, RuleManagerPersonalCommunication.Validate(personalCommunication))); }
public DM.Citation CreateCitationBroadcast(DE.Style style, DE.Format format, DM.Broadcast broadcast) { return(_citationProcessor.CreateCitationBroadcast(style, format, RuleManagerBroadcast.Validate(broadcast))); }
public DM.Citation CreateCitationVideoRecording(DE.Style style, DE.Format format, DM.VideoRecording videoRecording) { return(_citationProcessor.CreateCitationVideoRecording(style, format, RuleManagerVideoRecording.Validate(videoRecording))); }
public DM.Citation CreateCitationLegislation(DE.Style style, DE.Format format, DM.Legislation legislation) { return(CreateCitationAsync(style, format, legislation).Result); }
public DM.Citation CreateCitationVideoRecording(DE.Style style, DE.Format format, DM.VideoRecording videoRecording) { return(CreateCitationAsync(style, format, videoRecording).Result); }
public DM.Citation CreateCitationLegalCase(DE.Style style, DE.Format format, DM.LegalCase legalCase) { return(CreateCitationAsync(style, format, legalCase).Result); }
public DM.Citation CreateCitationBroadcast(DE.Style style, DE.Format format, DM.Broadcast broadcast) { return(CreateCitationAsync(style, format, broadcast).Result); }
public DM.Citation CreateCitationConferencePaper(DE.Style style, DE.Format format, DM.ConferencePaper conferencePaper) { return(CreateCitationAsync(style, format, conferencePaper).Result); }
public DM.Citation CreateCitationPersonalCommunication(DE.Style style, DE.Format format, DM.PersonalCommunication personalCommunication) { return(CreateCitationAsync(style, format, personalCommunication).Result); }
public DM.Citation CreateCitationBook(DE.Style style, DE.Format format, DM.Book book) { return(CreateCitationAsync(style, format, book).Result); }
public DM.Citation CreateCitationInterview(DE.Style style, DE.Format format, DM.Interview interview) { return(CreateCitationAsync(style, format, interview).Result); }
public DM.Citation CreateCitationJournal(DE.Style style, DE.Format format, DM.Journal journal) { return(CreateCitationAsync(style, format, journal).Result); }
public DM.Citation CreateCitationPresentation(DE.Style style, DE.Format format, DM.Presentation presentation) { return(CreateCitationAsync(style, format, presentation).Result); }
public DM.Citation CreateCitationNewspaper(DE.Style style, DE.Format format, DM.Newspaper newspaper) { return(CreateCitationAsync(style, format, newspaper).Result); }
public DM.Citation CreateCitationMap(DE.Style style, DE.Format format, DM.Map map) { return(CreateCitationAsync(style, format, map).Result); }
public DM.Citation CreateCitationEncyclopedia(DE.Style style, DE.Format format, DM.Encyclopedia encyclopedia) { return(CreateCitationAsync(style, format, encyclopedia).Result); }
public DM.Citation CreateCitationBill(DE.Style style, DE.Format format, DM.Bill bill) { return(CreateCitationAsync(style, format, bill).Result); }
public DM.Citation CreateCitationAudioRecording(DE.Style style, DE.Format format, DM.AudioRecording audioRecording) { return(CreateCitationAsync(style, format, audioRecording).Result); }
public DM.Citation CreateCitationGraphic(DE.Style style, DE.Format format, DM.Graphic graphic) { return(_citationProcessor.CreateCitationGraphic(style, format, RuleManagerGraphic.Validate(graphic))); }