/// <summary> /// Gets the repository collection. /// </summary> /// <param name="xmlData"> /// The XML data. /// </param> /// <returns> /// HLink Repository Model Collection. /// </returns> private HLinkRepositoryModelCollection GetRepositoryCollection(XElement xmlData) { HLinkRepositoryModelCollection t = new HLinkRepositoryModelCollection(); var theERElement = from _ORElementEl in xmlData.Elements(ns + "reporef") select _ORElementEl; if (theERElement.Any()) { // load repository references foreach (XElement theLoadORElement in theERElement) { HLinkRepositoryModel t2 = new HLinkRepositoryModel { // "callno" Done "medium" Done; "noteref" Done HLinkKey = GetAttribute(theLoadORElement.Attribute("hlink")), GPriv = SetPrivateObject(GetAttribute(theLoadORElement.Attribute("priv"))), GCallNo = GetAttribute(theLoadORElement.Attribute("callno")), GMedium = GetAttribute(theLoadORElement.Attribute("medium")), GNoteRef = GetNoteCollection(theLoadORElement), }; t.Add(t2); } } // Return sorted by the default text t.Sort(T => T.DeRef.GetDefaultText); return(t); }
/// <summary> /// Organises the repository repository. /// </summary> private static async Task <bool> OrganiseRepositoryRepository() { await DataStore.CN.MajorStatusAdd("Organising Repository data").ConfigureAwait(false); foreach (RepositoryModel theRepositoryModel in DV.RepositoryDV.DataViewData) { HLinkRepositoryModel t = theRepositoryModel.HLink; // Back Reference Note HLinks foreach (HLinkNoteModel noteRef in theRepositoryModel.GNoteRefCollection) { DataStore.DS.NoteData[noteRef.HLinkKey].BackHLinkReferenceCollection.Add(new HLinkBackLink(t)); } // Back Reference Tag HLinks foreach (HLinkTagModel tagRef in theRepositoryModel.GTagRefCollection) { DataStore.DS.TagData[tagRef.HLinkKey].BackHLinkReferenceCollection.Add(new HLinkBackLink(t)); } } return(true); }
public HLinkBackLink SetBookMarkTarget(string argGTarget, string argGHlink) { switch (argGTarget) { case "person": { HLinkPersonModel p1 = new HLinkPersonModel { HLinkKey = argGHlink }; return(new HLinkBackLink(p1)); } case "family": { HLinkFamilyModel p1 = new HLinkFamilyModel { HLinkKey = argGHlink }; return(new HLinkBackLink(p1)); } case "event": { HLinkEventModel p1 = new HLinkEventModel { HLinkKey = argGHlink }; return(new HLinkBackLink(p1)); } case "source": { HLinkSourceModel p1 = new HLinkSourceModel { HLinkKey = argGHlink }; return(new HLinkBackLink(p1)); } case "citation": { HLinkCitationModel p1 = new HLinkCitationModel { HLinkKey = argGHlink }; return(new HLinkBackLink(p1)); } case "place": { HLinkPlaceModel p1 = new HLinkPlaceModel { HLinkKey = argGHlink }; return(new HLinkBackLink(p1)); } case "media": { HLinkMediaModel p1 = new HLinkMediaModel { HLinkKey = argGHlink }; return(new HLinkBackLink(p1)); } case "repository": { HLinkRepositoryModel p1 = new HLinkRepositoryModel { HLinkKey = argGHlink }; return(new HLinkBackLink(p1)); } case "note": { HLinkNoteModel p1 = new HLinkNoteModel { HLinkKey = argGHlink }; return(new HLinkBackLink(p1)); } } return(new HLinkBackLink()); }
public static HLinkBackLink SetBookMarkTarget(string argGTarget, HLinkKey argHLinkKey) { switch (argGTarget) { case "person": { HLinkPersonModel p1 = DV.PersonDV.GetModelFromHLinkKey(argHLinkKey).HLink; return(new HLinkBackLink(p1)); } case "family": { HLinkFamilyModel p1 = DV.FamilyDV.GetModelFromHLinkKey(argHLinkKey).HLink; return(new HLinkBackLink(p1)); } case "event": { HLinkEventModel p1 = DV.EventDV.GetModelFromHLinkKey(argHLinkKey).HLink; return(new HLinkBackLink(p1)); } case "source": { HLinkSourceModel p1 = DV.SourceDV.GetModelFromHLinkKey(argHLinkKey).HLink; return(new HLinkBackLink(p1)); } case "citation": { HLinkCitationModel p1 = DV.CitationDV.GetModelFromHLinkKey(argHLinkKey).HLink; return(new HLinkBackLink(p1)); } case "place": { HLinkPlaceModel p1 = DV.PlaceDV.GetModelFromHLinkKey(argHLinkKey).HLink; return(new HLinkBackLink(p1)); } case "media": { HLinkMediaModel p1 = DV.MediaDV.GetModelFromHLinkKey(argHLinkKey).HLink; return(new HLinkBackLink(p1)); } case "repository": { HLinkRepositoryModel p1 = DV.RepositoryDV.GetModelFromHLinkKey(argHLinkKey).HLink; return(new HLinkBackLink(p1)); } case "note": { HLinkNoteModel p1 = DV.NoteDV.GetModelFromHLinkKey(argHLinkKey).HLink; return(new HLinkBackLink(p1)); } } return(new HLinkBackLink()); }