Beispiel #1
0
        public MessageFontInfo GetFontInfo()
        {
            var fd     = new FontDialog();
            var result = fd.ShowDialog();

            fd.ShowEffects = false;
            if (result != DialogResult.OK)
            {
                return(null);
            }
            var tdc = new TextDecorationCollection();

            if (fd.Font.Underline)
            {
                tdc.Add(TextDecorations.Underline);
            }
            if (fd.Font.Strikeout)
            {
                tdc.Add(TextDecorations.Strikethrough);
            }
            var fontInfo = new MessageFontInfo(fd.Font.Name, fd.Font.Size * 96.0 / 72.0)
            {
                FontWeight = fd.Font.Bold ? FontWeights.Bold : FontWeights.Regular,
                FontStyle  = fd.Font.Italic ? FontStyles.Italic : FontStyles.Normal,
            };

            return(fontInfo);
        }
Beispiel #2
0
 public ChatTextMessage(Message message) : this(message.ID, message.UtcTime, message.Name, message.Room, message.Content)
 {
     ColorInfo = message.ColorInfo;
     FontInfo  = message.FontInfo;
 }