/// <summary>
        /// Gets the note collection.
        /// </summary>
        /// <param name="xmlData">
        /// The XML data.
        /// </param>
        /// <returns>
        /// </returns>
        private HLinkNoteModelCollection GetNoteCollection(XElement xmlData)
        {
            HLinkNoteModelCollection t = new HLinkNoteModelCollection();

            // Load NoteRefs
            var localNoteElement =
                from ElementEl in xmlData.Elements(ns + "noteref")
                select ElementEl;

            if (localNoteElement.Any())
            {
                // load note references
                foreach (XElement loadNoteElement in localNoteElement)
                {
                    HLinkNoteModel noteHLink = new HLinkNoteModel
                    {
                        // object details
                        HLinkKey = GetAttribute(loadNoteElement.Attribute("hlink")),
                    };

                    // save the object
                    t.Add(noteHLink);
                }
            }

            // Return sorted by the default text
            t.SortAndSetFirst();

            return(t);
        }
        /// <summary>
        /// Gets or sets the citation object.
        /// </summary>
        /// <value>
        /// The citation object.
        /// </value>
        public override void HandleViewDataLoadEvent()
        {
            // Handle HLinkKeys
            HLinkCitationModel HLinkCitation = CommonRoutines.GetHLinkParameter <HLinkCitationModel>(BaseParamsHLink);

            CitationObject = HLinkCitation.DeRef;

            if (CitationObject != null)
            {
                BaseModelBase = CitationObject;
                BaseTitleIcon = Constants.IconCitation;

                BaseDetail.Add(new CardListLineCollection("Citation Detail")
                {
                    new CardListLine("Page:", CitationObject.GPage),
                    new CardListLine("Confidence:", CitationObject.GConfidence.ToString())
                });

                // Get date card
                BaseDetail.Add(CitationObject.GDateContent.AsHLink("Event Date"));

                BaseDetail.Add(DV.CitationDV.GetModelInfoFormatted(CitationObject));

                // If event note, display it while showing the full list further below.
                HighlightedNote = CitationObject.GNoteRefCollection.GetFirstOfType(Constants.NoteTypeCitation);

                NotesWithoutHighlight = CitationObject.GNoteRefCollection.GetCollectionWithoutOne(HighlightedNote);

                CitationObject.GSourceRef.DisplayAs = CommonEnums.DisplayFormat.LargeCard;
                BaseDetail.Add(CitationObject.GSourceRef);
            }
        }
        /// <summary>
        /// Gets the note collection.
        /// </summary>
        /// <param name="xmlData">
        /// The XML data.
        /// </param>
        /// <returns>
        /// </returns>
        private HLinkNoteModelCollection GetNoteCollection(XElement xmlData)
        {
            HLinkNoteModelCollection t = new HLinkNoteModelCollection
            {
                Title = "Note Collection"
            };

            // Load NoteRefs
            var localNoteElement =
                from ElementEl in xmlData.Elements(ns + "noteref")
                select ElementEl;

            if (localNoteElement.Any())
            {
                // load note references
                foreach (XElement loadNoteElement in localNoteElement)
                {
                    HLinkNoteModel noteHLink = new HLinkNoteModel
                    {
                        HLinkKey = GetHLinkKey(loadNoteElement),
                    };

                    t.Add(noteHLink);
                }
            }

            // Return sorted by the default text t.SortAndSetFirst();

            return(t);
        }
Exemple #4
0
        /// <summary>
        /// Populates the view ViewModel.
        /// </summary>
        public override void HandleViewDataLoadEvent()
        {
            HLinkObject = CommonRoutines.GetHLinkParameter <HLinkEventModel>(BaseParamsHLink);

            if (!(HLinkObject is null) && HLinkObject.Valid)
            {
                EventObject = HLinkObject.DeRef;

                if (!(EventObject is null) && EventObject.Valid)
                {
                    BaseModelBase = EventObject;
                    BaseTitleIcon = Constants.IconEvents;

                    // Get basic details
                    BaseDetail.Add(new CardListLineCollection("Event Detail")
                    {
                        new CardListLine("Type:", EventObject.GType),
                        new CardListLine("Role", HLinkObject.GRole),
                        new CardListLine("Years ago", EventObject.GDate.GetAge),
                        new CardListLine("Description", EventObject.GDescription),
                    });

                    // Get date card
                    BaseDetail.Add(EventObject.GDate.AsHLink("Event Date"));

                    BaseDetail.Add(EventObject.GPlace);

                    // Add Model details
                    BaseDetail.Add(DV.EventDV.GetModelInfoFormatted(EventObject));

                    // If event note, display it while showing the full list further below.
                    HighlightedNote = EventObject.GNoteRefCollection.GetFirstOfType(Constants.NoteTypeEvent);

                    NotesWithoutHighlight = EventObject.GNoteRefCollection.GetCollectionWithoutOne(HighlightedNote);
                }
            }
        }