Ejemplo n.º 1
0
        public async Task <ItemGlyph> GetThumbImageFromPDF(MediaModel argMediaModel)
        {
            ItemGlyph returnItemGlyph = argMediaModel.ModelItemGlyph;

            IMediaModel newMediaModel = UtilCreateNewMediaObject(argMediaModel, "~imagepdf", ".jpg");

            // TODO Having an issue where Gramps XML content type is not always correct
            if (argMediaModel.MediaStorageFile.FInfo.Extension != ".pdf")
            {
                _commonNotifications.DataLogEntryAdd($"??? {argMediaModel.Id} Inconsistant File Extension ({argMediaModel.MediaStorageFile.FInfo.Extension}) and MIME type ({argMediaModel.FileMimeType}/{argMediaModel.FileMimeSubType})");
                return(argMediaModel.ModelItemGlyph);
            }

            IMediaModel pdfimage;

            // Check if new pdf image file already exists
            IMediaModel fileExists = DV.MediaDV.GetModelFromHLinkKey(newMediaModel.HLinkKey);

            if ((!fileExists.Valid) && (argMediaModel.IsMediaStorageFileValid))
            {
                // check if we can get an image for the first page of the PDF
                pdfimage = await _iocPlatformSpecific.GenerateThumbImageFromPDF(DataStore.Instance.AD.CurrentDataFolder.Value, argMediaModel, newMediaModel);

                returnItemGlyph = UtilSaveNewMediaObject(returnItemGlyph, pdfimage, IconFont.FilePdf);
            }
            else
            {
                ErrorInfo t = UtilGetPostGlyphErrorInfo("File not found when trying to create image from PDF file", argMediaModel);

                _commonNotifications.NotifyError(t);
            }

            return(returnItemGlyph);
        }
Ejemplo n.º 2
0
        public async Task <ItemGlyph> GetThumbImageFromVideo(MediaModel argMediaModel)
        {
            ItemGlyph returnItemGlyph = argMediaModel.ModelItemGlyph;

            IMediaModel newMediaModel = UtilCreateNewMediaObject(argMediaModel, "~imagevideo", ".jpg");

            IMediaModel videoImage;

            // Check if new image file already exists
            IMediaModel fileExists = DV.MediaDV.GetModelFromHLinkKey(newMediaModel.HLinkKey);

            if ((!fileExists.Valid) && argMediaModel.IsMediaStorageFileValid)
            {
                // check if we can get an image for the video
                videoImage = await _iocPlatformSpecific.GenerateThumbImageFromVideo(DataStore.Instance.AD.CurrentDataFolder.Value, argMediaModel, newMediaModel);

                returnItemGlyph = UtilSaveNewMediaObject(returnItemGlyph, videoImage, IconFont.FileArchive);
            }
            else
            {
                ErrorInfo t = UtilGetPostGlyphErrorInfo("File not found when trying to create image from video file", argMediaModel);

                _commonNotifications.NotifyError(t);
            }

            return(returnItemGlyph);
        }
Ejemplo n.º 3
0
        private ItemGlyph GetImage(int argIndex)
        {
            FirstHLinkHomeImage = new ItemGlyph();

            switch (this[argIndex].HLinkGlyphItem.ImageType)
            {
            case CommonEnums.HLinkGlyphType.Image:
            {
                FirstHLinkHomeImage = this[argIndex].HLinkGlyphItem;

                break;
            }

            case CommonEnums.HLinkGlyphType.Media:
            {
                FirstHLinkHomeImage           = this[argIndex].HLinkGlyphItem;
                FirstHLinkHomeImage.ImageType = CommonEnums.HLinkGlyphType.Image;

                break;
            }

            case CommonEnums.HLinkGlyphType.Symbol:
                break;

            case CommonEnums.HLinkGlyphType.Unknown:
                break;

            default:
                break;
            }

            return(FirstHLinkHomeImage);
        }
Ejemplo n.º 4
0
        public ItemGlyph GetThumbImageFromZip(MediaModel argMediaModel)
        {
            try
            {
                ItemGlyph returnItemGlyph = argMediaModel.ModelItemGlyph;

                IMediaModel newMediaModel = UtilCreateNewMediaObject(argMediaModel, "~zipimage", ".jpg");

                // TODO Having an issue where Gramps XML content type is not always correct
                if (argMediaModel.MediaStorageFile.FInfo.Extension != ".zip")
                {
                    _commonNotifications.DataLogEntryAdd($"??? {argMediaModel.Id} Inconsistant File Extension ({argMediaModel.MediaStorageFile.FInfo.Extension}) and MIME type ({argMediaModel.FileMimeType}/{argMediaModel.FileMimeSubType})");
                    return(argMediaModel.ModelItemGlyph);
                }

                IMediaModel zipimage;

                // Check if new zip image file already exists
                IMediaModel fileExists = DV.MediaDV.GetModelFromHLinkKey(newMediaModel.HLinkKey);

                if ((!fileExists.Valid) && (argMediaModel.IsMediaStorageFileValid))
                {
                    // check if we can get an image for the first page of the PDF

                    zipimage = StoreFile.ExtractZipFileFirstImage(DataStore.Instance.AD.CurrentDataFolder.Value, argMediaModel, newMediaModel);

                    returnItemGlyph = UtilSaveNewMediaObject(returnItemGlyph, zipimage, IconFont.FileArchive);
                }
                else
                {
                    ErrorInfo t = UtilGetPostGlyphErrorInfo("File not found when trying to create image from PDF file", argMediaModel);

                    _commonNotifications.NotifyError(t);
                }

                return(returnItemGlyph);
            }
            catch (System.Exception ex)
            {
                ErrorInfo t = new ErrorInfo("Directory not found when trying to create image from PDF file")
                {
                    { "Original ID", argMediaModel.Id },
                    { "Original File", argMediaModel.MediaStorageFilePath },
                    { "Clipped Id", argMediaModel.Id },
                    { "New path", "pdfimage" }
                };

                App.Current.Services.GetService <IErrorNotifications>().NotifyException("PDF to Image", ex, t);

                return(new ItemGlyph());
            }
        }
Ejemplo n.º 5
0
        public void SetCitationImages()
        {
            foreach (CitationModel argModel in DataStore.Instance.DS.CitationData.Values)
            {
                if (argModel is null)
                {
                    throw new ArgumentNullException(nameof(argModel));
                }

                //if (argModel.ModelItemGlyph.ImageType == CommonEnums.HLinkGlyphType.Image)
                //{
                //}

                ItemGlyph hlink = argModel.ModelItemGlyph;

                if (argModel.Id == "C0772")
                {
                }

                // Try media reference collection first
                ItemGlyph t = argModel.GMediaRefCollection.FirstHLinkHomeImage;
                if ((!hlink.ValidImage) && (t.ValidImage))
                {
                    hlink = t;
                }

                // Check Source for Image
                t = argModel.GSourceRef.DeRef.ModelItemGlyph;
                if ((!hlink.ValidImage) && (t.ValidImage))
                {
                    hlink = t;
                }

                // Handle the link if we can
                if (hlink.Valid)
                {
                    argModel.ModelItemGlyph.ImageType         = hlink.ImageType;
                    argModel.ModelItemGlyph.ImageHLink        = hlink.ImageHLink;
                    argModel.ModelItemGlyph.ImageSymbol       = hlink.ImageSymbol;
                    argModel.ModelItemGlyph.ImageSymbolColour = hlink.ImageSymbolColour;
                }
                else
                {
                    ErrorInfo NotifyError = new ErrorInfo("HLink Invalid")
                    {
                        { "Citation Model Image", argModel.Id }
                    };

                    _commonNotifications.NotifyError(NotifyError);
                }
            }
        }
Ejemplo n.º 6
0
        public override void SetGlyph()
        {
            foreach (HLinkPlaceModel argHLink in this)
            {
                ItemGlyph t = DV.PlaceDV.GetGlyph(argHLink.HLinkKey);

                argHLink.HLinkGlyphItem.ImageType         = t.ImageType;
                argHLink.HLinkGlyphItem.ImageHLink        = t.ImageHLink;
                argHLink.HLinkGlyphItem.ImageSymbol       = t.ImageSymbol;
                argHLink.HLinkGlyphItem.ImageSymbolColour = t.ImageSymbolColour;
            }

            base.SetGlyph();
        }
Ejemplo n.º 7
0
        //public override CardGroup GetCardGroup()
        //{
        //    CardGroup t = base.GetCardGroup();

        // t.Title = Title;

        //    return t;
        //}

        public override void SetGlyph()
        {
            // Back Reference Citation HLinks
            foreach (HLinkCitationModel argHLink in this)
            {
                ItemGlyph t = DV.CitationDV.GetGlyph(argHLink.HLinkKey);

                argHLink.HLinkGlyphItem.ImageType         = t.ImageType;
                argHLink.HLinkGlyphItem.ImageHLink        = t.ImageHLink;
                argHLink.HLinkGlyphItem.ImageSymbol       = t.ImageSymbol;
                argHLink.HLinkGlyphItem.ImageSymbolColour = t.ImageSymbolColour;
            }

            base.SetGlyph();
        }
        public override void SetGlyph()
        {
            foreach (HLinkPersonRefModel argHLink in this)
            {
                // TODO check this
                ItemGlyph t = DV.PersonDV.GetGlyph(argHLink.HLinkKey);

                argHLink.HLinkGlyphItem.ImageType         = t.ImageType;
                argHLink.HLinkGlyphItem.ImageHLink        = t.ImageHLink;
                argHLink.HLinkGlyphItem.ImageSymbol       = t.ImageSymbol;
                argHLink.HLinkGlyphItem.ImageSymbolColour = t.ImageSymbolColour;
            }

            base.SetGlyph();
        }
Ejemplo n.º 9
0
        /// <summary>
        /// <para> Sets the first image. </para>
        /// <para>
        /// Set the first or last image link. Chooses the first or last image in the collection
        /// <br/> depending on the user settings.
        /// </para>
        /// </summary>
        public void SetFirstImage()
        {
            FirstHLinkHomeImage = new ItemGlyph();

            if (Count > 0)
            {
                if (CommonLocalSettings.UseFirstImageFlag)
                {
                    FirstHLinkHomeImage = GetImage(0);
                }
                else
                {
                    FirstHLinkHomeImage = GetImage(Count - 1);
                }
            }
        }
Ejemplo n.º 10
0
        public static void SetFamilyImages()
        {
            foreach (FamilyModel argModel in DataStore.Instance.DS.FamilyData.Values)
            {
                if (argModel.Id == "F0144")
                {
                }

                ItemGlyph hlink = argModel.ModelItemGlyph;

                // check media
                ItemGlyph t = argModel.GMediaRefCollection.FirstHLinkHomeImage;
                if (!hlink.ValidImage & t.ValidImage)
                {
                    hlink = t;
                }

                t = argModel.GCitationRefCollection.FirstHLinkHomeImage;
                if (!hlink.ValidImage & t.ValidImage)
                {
                    hlink = t;
                }

                t = argModel.GEventRefCollection.FirstHLinkHomeImage;
                if (!hlink.ValidImage & t.ValidImage)
                {
                    hlink = t;
                }

                t = argModel.GNoteRefCollection.FirstHLinkHomeImage;
                if (!hlink.ValidImage & t.ValidImage)
                {
                    hlink = t;
                }

                // Set the image if available
                if (hlink.Valid)
                {
                    argModel.ModelItemGlyph.ImageType         = hlink.ImageType;
                    argModel.ModelItemGlyph.ImageHLink        = hlink.ImageHLink;
                    argModel.ModelItemGlyph.ImageSymbol       = hlink.ImageSymbol;
                    argModel.ModelItemGlyph.ImageSymbolColour = hlink.ImageSymbolColour;
                }

                //var tt = (argModel.ModelItemGlyph.Symbol == Constants.IconFamilies);
            }
        }
Ejemplo n.º 11
0
        // People last as they pretty much depend on everything else
        public static void SetPersonImages()
        {
            foreach (PersonModel argModel in DataStore.Instance.DS.PersonData.Values)
            {
                if (argModel.Id == "I0704")
                {
                }

                if (argModel is null)
                {
                    throw new ArgumentNullException(nameof(argModel));
                }

                ItemGlyph hlink = argModel.ModelItemGlyph;

                // check media
                ItemGlyph t = argModel.GMediaRefCollection.FirstHLinkHomeImage;
                if (!hlink.ValidImage & t.ValidImage)
                {
                    hlink = t;
                }

                // Check Citation for Images
                t = argModel.GCitationRefCollection.FirstHLinkHomeImage;
                if (!hlink.ValidImage & t.ValidImage)
                {
                    hlink = t;
                }

                // Check Events for Images
                t = argModel.GEventRefCollection.FirstHLinkHomeImage;
                if (!hlink.ValidImage & t.ValidImage)
                {
                    hlink = t;
                }

                // Action any Link
                if (hlink.Valid)
                {
                    argModel.ModelItemGlyph.ImageType         = hlink.ImageType;
                    argModel.ModelItemGlyph.ImageHLink        = hlink.ImageHLink;
                    argModel.ModelItemGlyph.ImageSymbol       = hlink.ImageSymbol;
                    argModel.ModelItemGlyph.ImageSymbolColour = hlink.ImageSymbolColour;
                }
            }
        }
Ejemplo n.º 12
0
        public override void SetGlyph()
        {
            foreach (HLinkTagModel argHLink in this)
            {
                ItemGlyph modelGylph = DV.TagDV.GetGlyph(argHLink.HLinkKey);

                argHLink.HLinkGlyphItem.ImageType         = modelGylph.ImageType;
                argHLink.HLinkGlyphItem.ImageHLink        = modelGylph.ImageHLink;
                argHLink.HLinkGlyphItem.ImageSymbol       = modelGylph.ImageSymbol;
                argHLink.HLinkGlyphItem.ImageSymbolColour = modelGylph.ImageSymbolColour;

                // Tags are special in that the colour of the icon is the colour of the tag
                argHLink.HLinkGlyphItem.SymbolColour = modelGylph.SymbolColour;
            }

            base.SetGlyph();
        }
Ejemplo n.º 13
0
        private ItemGlyph UtilSaveNewMediaObject(ItemGlyph argNewGlyph, IMediaModel argNewMediaModel, string argDefaultSymbol)
        {
            try
            {
                // Save new MediaObject
                if (argNewMediaModel.Valid)
                {
                    argNewMediaModel.ModelItemGlyph.ImageType = CommonEnums.HLinkGlyphType.Image;
                    argNewMediaModel.IsInternalMediaFile      = true; // Do not show in media list as it is internal
                    argNewMediaModel.MediaStorageFile         = new FileInfoEx(argUseCurrentDataFolder: true, argFileName: argNewMediaModel.OriginalFilePath);

                    addLater.Add(argNewMediaModel);

                    argNewGlyph.ImageType  = CommonEnums.HLinkGlyphType.Image;
                    argNewGlyph.ImageHLink = argNewMediaModel.HLinkKey;

                    return(argNewGlyph);
                }

                // Else

                argNewGlyph.ImageType   = CommonEnums.HLinkGlyphType.Symbol;
                argNewGlyph.ImageSymbol = argDefaultSymbol;

                return(argNewGlyph);
            }
            catch (System.Exception ex)
            {
                ErrorInfo t = new ErrorInfo("Directory not found when trying to create image from PDF file")
                {
                    { "Original ID", argNewMediaModel.Id },
                    { "Original File", argNewMediaModel.MediaStorageFilePath },
                    { "Clipped Id", argNewMediaModel.Id },
                    { "New path", "pdfimage" }
                };

                App.Current.Services.GetService <IErrorNotifications>().NotifyException("PDF to Image", ex, t);

                return(new ItemGlyph());
            }
        }
Ejemplo n.º 14
0
        public static void SetEventImages()
        {
            foreach (EventModel argModel in DataStore.Instance.DS.EventData.Values)
            {
                if (argModel.Id == "E0203")
                {
                }

                if (argModel is null)
                {
                    throw new ArgumentNullException(nameof(argModel));
                }

                // Setup home images
                ItemGlyph hlink = argModel.ModelItemGlyph;

                // check media
                ItemGlyph t = argModel.GMediaRefCollection.FirstHLinkHomeImage;
                if (!hlink.ValidImage & t.ValidImage)
                {
                    hlink = t;
                }

                // Check Citation for Images
                t = argModel.GCitationRefCollection.FirstHLinkHomeImage;
                if (!hlink.ValidImage & t.ValidImage)
                {
                    hlink = t;
                }

                // Handle the link if we can
                if (hlink.Valid)
                {
                    argModel.ModelItemGlyph.ImageType         = hlink.ImageType;
                    argModel.ModelItemGlyph.ImageHLink        = hlink.ImageHLink;
                    argModel.ModelItemGlyph.ImageSymbol       = hlink.ImageSymbol;
                    argModel.ModelItemGlyph.ImageSymbolColour = hlink.ImageSymbolColour;
                }
            }
        }
Ejemplo n.º 15
0
        public void SetAddressImages()
        {
            foreach (AddressModel argModel in DataStore.Instance.DS.AddressData.Values)
            {
                if (argModel is null)
                {
                    throw new ArgumentNullException(nameof(argModel));
                }

                ItemGlyph hlink = argModel.ModelItemGlyph;

                // Try citation reference collection first
                ItemGlyph t = argModel.GCitationRefCollection.FirstHLinkHomeImage;
                if ((!hlink.ValidImage) && t.ValidImage)
                {
                    hlink = t;
                }

                // Handle the link if we can
                if (hlink.Valid)
                {
                    argModel.ModelItemGlyph.ImageType         = hlink.ImageType;
                    argModel.ModelItemGlyph.ImageHLink        = hlink.ImageHLink;
                    argModel.ModelItemGlyph.ImageSymbol       = hlink.ImageSymbol;
                    argModel.ModelItemGlyph.ImageSymbolColour = hlink.ImageSymbolColour;
                }
                else
                {
                    ErrorInfo NotifyError = new ErrorInfo("HLink Invalid")
                    {
                        { "Address Model Image", argModel.Id }
                    };

                    _commonNotifications.NotifyError(NotifyError);
                }
            }
        }
Ejemplo n.º 16
0
        public static void SetSourceImages()
        {
            foreach (SourceModel argModel in DataStore.Instance.DS.SourceData.Values)
            {
                if (argModel.Id == "S0010")
                {
                }

                if (argModel.ModelItemGlyph.SymbolColour != CommonRoutines.ResourceColourGet("CardBackGroundSource"))
                {
                }

                if (argModel is null)
                {
                    throw new ArgumentNullException(nameof(argModel));
                }

                ItemGlyph hlink = argModel.ModelItemGlyph;

                // Get default image if available
                ItemGlyph t = argModel.GMediaRefCollection.FirstHLinkHomeImage;
                if (!hlink.ValidImage && t.ValidImage)
                {
                    hlink = t;
                }

                // Set default
                if (hlink.Valid)
                {
                    argModel.ModelItemGlyph.ImageType         = hlink.ImageType;
                    argModel.ModelItemGlyph.ImageHLink        = hlink.ImageHLink;
                    argModel.ModelItemGlyph.ImageSymbol       = hlink.ImageSymbol;
                    argModel.ModelItemGlyph.ImageSymbolColour = hlink.ImageSymbolColour;
                }
            }
        }
Ejemplo n.º 17
0
        private void ShowSomething(ItemGlyph argItemGlyph)
        {
            try
            {
                if (!argItemGlyph.Valid)
                {
                    //DataStore.Instance.CN.NotifyError("Invalid HlinkMediaModel (" + HLinkMedia.HLinkKey + ") passed to MediaImage");
                    return;
                }

                //if (argItemGlyph == WorkHLMediaModel)
                //{
                //    return;
                //}

                // Save the HLink so can check for duplicate changes later
                WorkHLMediaModel = argItemGlyph;

                //if (argHHomeMedia.HLinkKey == "_e1823d5e765308999f4c16addb5")
                //{
                //}

                if (argItemGlyph.Valid)
                {
                    switch (argItemGlyph.ImageType)
                    {
                    case CommonEnums.HLinkGlyphType.Image:
                    {
                        ShowImage(argItemGlyph.ImageHLinkMediaModel.DeRef);
                        break;
                    }

                    case CommonEnums.HLinkGlyphType.Media:
                    {
                        if (FsctShowMedia)
                        {
                            ShowMedia(argItemGlyph.MediaHLinkMediaModel.DeRef);
                        }
                        else
                        {
                            ShowImage(argItemGlyph.ImageHLinkMediaModel.DeRef);
                        }
                        break;
                    }

                    case CommonEnums.HLinkGlyphType.Symbol:
                    {
                        if (FsctShowSymbols)
                        {
                            ShowSymbol(argItemGlyph);
                        }
                        break;
                    }

                    default:
                    {
                        break;
                    }
                    }
                }
            }
            catch (Exception ex)
            {
                App.Current.Services.GetService <IErrorNotifications>().NotifyException("HLinkVisualDisplay", ex);

                throw;
            }
        }
Ejemplo n.º 18
0
        private void HLinkVisualDisplay_BindingContextChanged(object sender, EventArgs e)
        {
            if (BindingContext == null)
            {
                return;
            }

            try
            {
                newItemGlyph = new ItemGlyph();

                switch (BindingContext.GetType().Name)
                {
                case nameof(IHLinkMediaModel):
                {
                    if ((BindingContext as IHLinkMediaModel).Valid)
                    {
                        newItemGlyph = (BindingContext as IHLinkMediaModel).DeRef.ModelItemGlyph;
                    }
                    break;
                }

                case nameof(HLinkMediaModel):
                {
                    if ((BindingContext as IHLinkMediaModel).Valid)
                    {
                        newItemGlyph = (BindingContext as IHLinkMediaModel).DeRef.ModelItemGlyph;
                    }
                    break;
                }

                case nameof(ItemGlyph):
                {
                    newItemGlyph = BindingContext as ItemGlyph;
                    break;
                }

                default:
                {
                    App.Current.Services.GetService <IErrorNotifications>().NotifyError(new ErrorInfo("HLinkVisualDisplay Binding Context is not a ItemGlyph but a" + BindingContext.GetType().ToString()));
                    return;
                }
                }

                // Don't display anything if the glyph is invalid
                if (!newItemGlyph.Valid)
                {
                    return;
                }

                if (newItemGlyph.ImageHLink.Value == "_c4c5aaa038602727de3~zipimage")
                {
                }

                ShowSomething(newItemGlyph);
            }
            catch (Exception ex)
            {
                App.Current.Services.GetService <IErrorNotifications>().NotifyException("HLinkVisualDisplay", ex);

                throw;
            }
        }
Ejemplo n.º 19
0
        private void ShowSymbol(ItemGlyph argItemGlyph)
        {
            try
            {
                // create symbol control

                Image newImageControl = new Image
                {
                    Aspect          = Aspect.AspectFit,
                    BackgroundColor = Color.Transparent,
                    IsVisible       = true,
                    Margin          = 5,
                    Source          = new FontImageSource
                    {
                    },
                    VerticalOptions = LayoutOptions.FillAndExpand,
                };

                // Input valid so start work

                // Set symbol
                FontImageSource fontGlyph = new FontImageSource
                {
                    Glyph      = argItemGlyph.Symbol,
                    Color      = argItemGlyph.SymbolColour,
                    FontFamily = "FA-Solid"
                };

                if (fontGlyph.Glyph == null)
                {
                    ErrorInfo t = new ErrorInfo("HLinkVisualDisplay", "Null Glyph")
                    {
                        { "HLinkKey", argItemGlyph.ToString() }
                    };

                    App.Current.Services.GetService <IErrorNotifications>().NotifyError(t);
                }

                if (fontGlyph.Color == null)
                {
                    ErrorInfo t = new ErrorInfo("HLinkVisualDisplay", "Null Glyph Colour")
                    {
                        { "HLinkKey", argItemGlyph.ImageHLink.Value }
                    };

                    App.Current.Services.GetService <IErrorNotifications>().NotifyError(t);
                }

                newImageControl.Source = fontGlyph;

                HLinkVisualDisplayRoot.Children.Clear();
                HLinkVisualDisplayRoot.Children.Add(newImageControl);
            }
            catch (Exception ex)
            {
                ErrorInfo argDetail = new ErrorInfo
                {
                    { "Type", "Symbol" },
                    { "Media Model HLinkKey", argItemGlyph.ImageHLink.Value },
                    { "Media Model Symbol", argItemGlyph.Symbol },
                };

                App.Current.Services.GetService <IErrorNotifications>().NotifyException("HLinkVisualDisplay", ex, argExtraItems: argDetail);
                throw;
            }
        }
        public override void SetGlyph()
        {
            // Back Reference HLinks
            foreach (HLinkBackLink argHLink in this)
            {
                ItemGlyph t = new ItemGlyph();

                switch (argHLink.HLinkType)
                {
                case HLinkBackLinkEnum.HLinkAddressModel:
                {
                    t = DV.AddressDV.GetGlyph(argHLink.HLinkKey);
                    break;
                }

                case HLinkBackLinkEnum.HLinkCitationModel:
                {
                    t = DV.CitationDV.GetGlyph(argHLink.HLinkKey);
                    break;
                }

                case HLinkBackLinkEnum.HLinkEventModel:
                {
                    t = DV.EventDV.GetGlyph(argHLink.HLinkKey);
                    break;
                }

                case HLinkBackLinkEnum.HLinkFamilyModel:
                {
                    t = DV.FamilyDV.GetGlyph(argHLink.HLinkKey);
                    break;
                }

                case HLinkBackLinkEnum.HLinkMediaModel:
                {
                    t = DV.MediaDV.GetGlyph(argHLink.HLinkKey);
                    break;
                }

                case HLinkBackLinkEnum.HLinkNameMapModel:
                {
                    t = DV.NameMapDV.GetGlyph(argHLink.HLinkKey);
                    break;
                }

                case HLinkBackLinkEnum.HLinkNoteModel:
                {
                    t = DV.NoteDV.GetGlyph(argHLink.HLinkKey);
                    break;
                }

                case HLinkBackLinkEnum.HLinkPersonModel:
                {
                    t = DV.PersonDV.GetGlyph(argHLink.HLinkKey);
                    break;
                }

                case HLinkBackLinkEnum.HLinkPersonNameModel:
                {
                    t = DV.PersonNameDV.GetGlyph(argHLink.HLinkKey);
                    break;
                }

                case HLinkBackLinkEnum.HLinkPlaceModel:
                {
                    t = DV.PlaceDV.GetGlyph(argHLink.HLinkKey);
                    break;
                }

                case HLinkBackLinkEnum.HLinkRepositoryModel:
                {
                    t = DV.RepositoryDV.GetGlyph(argHLink.HLinkKey);
                    break;
                }

                case HLinkBackLinkEnum.HLinkSourceModel:
                {
                    t = DV.SourceDV.GetGlyph(argHLink.HLinkKey);
                    break;
                }

                case HLinkBackLinkEnum.HLinkTagModel:
                {
                    t = DV.TagDV.GetGlyph(argHLink.HLinkKey);
                    break;
                }

                case HLinkBackLinkEnum.Unknown:
                    break;

                default:

                    break;
                }

                argHLink.HLinkGlyphItem = t;
            }

            //// Set the first image link. Assumes main image is manually set to the first image in
            //// Gramps if we need it to be, e.g. Citations.
            SetFirstImage();

            base.Sort();
        }