Beispiel #1
0
        private void SelectFont()
        {
            var fontDialog = new FontDialog();

            if (!string.IsNullOrEmpty(Options.FontFamily))
            {
                fontDialog.Chooser.SelectedFontFamily = new FontFamily(Options.FontFamily);
            }
            if (Options.FontSize > 0)
            {
                fontDialog.Chooser.SelectedFontSize = Options.FontSize;
            }

            // ReSharper disable PossibleNullReferenceException
            if (!string.IsNullOrEmpty(Options.FontStretch))
            {
                fontDialog.Chooser.SelectedFontStretch = (FontStretch)_fontStretchConverter.ConvertFrom(Options.FontStretch);
            }
            if (!string.IsNullOrEmpty(Options.FontStyle))
            {
                fontDialog.Chooser.SelectedFontStyle = (FontStyle)_fontStyleConverter.ConvertFrom(Options.FontStyle);
            }
            if (!string.IsNullOrEmpty(Options.FontWeight))
            {
                fontDialog.Chooser.SelectedFontWeight = (FontWeight)_fontWeightConverter.ConvertFrom(Options.FontWeight);
            }
            // ReSharper restore PossibleNullReferenceException

            var result = fontDialog.ShowDialog();

            if (result.GetValueOrDefault())
            {
                Options.FontFamily  = fontDialog.Chooser.SelectedFontFamily.ToString();
                Options.FontSize    = fontDialog.Chooser.SelectedFontSize;
                Options.FontStyle   = fontDialog.Chooser.SelectedFontStyle.ToString();
                Options.FontStretch = fontDialog.Chooser.SelectedFontStretch.ToString();
                Options.FontWeight  = fontDialog.Chooser.SelectedFontWeight.ToString();
                RaisePropertyChanged(() => Font);
            }
        }
Beispiel #2
0
        private SSSymbolViewModel BuildSymbolViewModel(XRNANucleotide symbol)
        {
            SSSymbolViewModel retValue = new SSSymbolViewModel(symbol.Sequence.RawData[symbol.Index], symbol.Index + 1,
                                                               new FontFamily(symbol.FontFace), (FontStyle)_fscvtr.ConvertFrom(symbol.FontStyle), (FontWeight)_fwcvtr.ConvertFrom(symbol.FontWeight), (Brush)_colorCvtr.ConvertFrom(symbol.Color),
                                                               symbol.FontSize, symbol.Center.X, symbol.Center.Y);

            retValue.Visible = !symbol.Hidden;
            return(retValue);
        }