コード例 #1
0
        public static FontServiceReference.FavoriteFont ConvertTo(this FavoriteFont favoriteFont)
        {
            FontServiceReference.FavoriteFont fontServiceReference = new FontServiceReference.FavoriteFont();

            fontServiceReference.Comment = favoriteFont.Comment;

            fontServiceReference.IsFavorite = favoriteFont.IsFavorite;

            fontServiceReference.FontName = favoriteFont.FontName;

            return(fontServiceReference);
        }
コード例 #2
0
        public static FavoriteFont ConvertBack(this FontServiceReference.FavoriteFont favoriteFont)
        {
            FavoriteFont fontServiceReference = new FavoriteFont();

            fontServiceReference.Comment = favoriteFont.Comment;

            fontServiceReference.IsFavorite = favoriteFont.IsFavorite;

            fontServiceReference.FontName = favoriteFont.FontName;

            fontServiceReference.FontInfo = Fonts.SystemFontFamilies.FirstOrDefault(x => x.Source == fontServiceReference.FontName);

            return(fontServiceReference);
        }