Beispiel #1
0
        private static void SetupFont(ref xFlowDocument flowDoc)
        {
            var font = Settings.Default.ChatFont;

            flowDoc._FD.FontFamily = new FontFamily(font.Name);
            flowDoc._FD.FontWeight = font.Bold ? FontWeights.Bold : FontWeights.Regular;
            flowDoc._FD.FontStyle  = font.Italic ? FontStyles.Italic : FontStyles.Normal;
            flowDoc._FD.FontSize   = font.Size;
        }
Beispiel #2
0
        /// <summary>
        /// </summary>
        public static void AddTabByName(string xKey, string xValue, string xRegularExpression)
        {
            xKey = Regex.Replace(xKey, "[^a-zA-Z]", string.Empty);
            var tabItem = new TabItem {
                Header = xKey
            };
            var flowDoc = new xFlowDocument();

            foreach (var code in xValue.Split(','))
            {
                flowDoc.Codes.Items.Add(code);
            }

            flowDoc.RegEx.Text = xRegularExpression;
            Binding binding = BindingHelper.ZoomBinding(Settings.Default, "Zoom");

            flowDoc._FDR.SetBinding(FlowDocumentReader.ZoomProperty, binding);
            tabItem.Content = flowDoc;
            PluginViewModel.Instance.Tabs.Add(tabItem);
            ThemeHelper.SetupFont(ref flowDoc);
            ThemeHelper.SetupColor(ref flowDoc);
        }
Beispiel #3
0
 private static void SetupColor(ref xFlowDocument flowDoc)
 {
     flowDoc._FD.Background = new SolidColorBrush(Settings.Default.ChatBackgroundColor);
 }