Exemplo n.º 1
0
        // Prevent example from ending if CTL+C is pressed.


        public MainWindow()
        {
            InitializeComponent();
            keys    = new List <Key>();
            _colors = new List <string>();
            canOpenFindAndReplace = true;
            _colors.Add("White"); _colors.Add("Blue"); _colors.Add("Black"); _colors.Add("Brown"); _colors.Add("Red"); _colors.Add("Gold");
            _txtMainAreaWordMapped    = false;
            CurrentSelectedStartIndex = -1;
            txtBasicInfo.Text         = "Line 0 Char 0 Letters 0 Vowels a e i o u";
            SelectedElement           = new SelectedElement();
            BackgroundColorsMenuItem  = Window1.FindName("BackgroundColors") as MenuItem;
            ForeGroundColorsMenuItem  = Window1.FindName("ForegroundColors") as MenuItem;

            foreach (string color in _colors)
            {
                MenuItem menuItemBackground = new MenuItem()
                {
                    Header = color
                };
                menuItemBackground.Click += changeBackground;
                BackgroundColorsMenuItem.Items.Add(menuItemBackground);

                MenuItem menuItemForeground = new MenuItem()
                {
                    Header = color
                };
                menuItemForeground.Click += changeForeground;
                ForeGroundColorsMenuItem.Items.Add(menuItemForeground);
            }


            BackgroundColors.Items.Add(new MenuItem()
            {
                Header = "Color1"
            });
            initialStyleSettings();
        }
Exemplo n.º 2
0
        public SelectedText(string selectedText, string textInFindTextField, int indexOfText)
        {
            SelectedTextInTextField = selectedText;

            selected = new SelectedElement(textInFindTextField, indexOfText);
        }