Ejemplo n.º 1
0
 public void enableLink(SymLink link)
 {
     MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(
         delegate(object sender, System.Windows.Input.MouseButtonEventArgs args)
     {
         try
         {
             NavigateTo(link.filename, link.line, link.column);
         }
         catch { }
     });
     MouseEnter += new System.Windows.Input.MouseEventHandler(
         delegate(object sender, System.Windows.Input.MouseEventArgs args)
     {
         TextDecorations.Add(System.Windows.TextDecorations.Underline);
     });
     MouseLeave += new System.Windows.Input.MouseEventHandler(
         delegate(object sender, System.Windows.Input.MouseEventArgs args)
     {
         foreach (var td in System.Windows.TextDecorations.Underline)
         {
             TextDecorations.Remove(td);
         }
     });
 }
Ejemplo n.º 2
0
        public SpellingOptions(string text, IDialogElement element, IEnumerable <string> corrections = null, Action <object, PropertyChangedEventArgs> changedCallback = null)
            : base(text, element, changedCallback)
        {
            m_element = element;

            TextDecoration decoration = new TextDecoration(TextDecorationLocation.Underline, s_underline, 0, TextDecorationUnit.FontRecommended, TextDecorationUnit.FontRecommended);

            TextDecorations.Add(decoration);

            m_menu           = new ContextMenu();
            m_menu.Placement = PlacementMode.MousePoint;

            if (corrections != null)
            {
                DelegateCommand <string> replaceTextCmd = new DelegateCommand <string>(ReplaceText);
                foreach (string correction in corrections)
                {
                    m_menu.Items.Add(new MenuItem
                    {
                        Header           = correction,
                        Command          = replaceTextCmd,
                        CommandParameter = correction,
                    });
                }

                m_menu.Items.Add(new Separator());
            }

            m_menu.Items.Add(new MenuItem
            {
                Header  = $"Add \"{text}\" to dictionary",
                Command = new DelegateCommand(AddToDictionary)
            });
        }
Ejemplo n.º 3
0
            public UnderlineClassificationFormatDefinition()
            {
                DisplayName = "Gd Underline";

                var underline = new System.Windows.TextDecoration {
                    PenThicknessUnit = System.Windows.TextDecorationUnit.FontRecommended
                };

                if (TextDecorations == null)
                {
                    TextDecorations = new System.Windows.TextDecorationCollection();
                }

                TextDecorations.Add(underline);
            }
Ejemplo n.º 4
0
        public HyperlinkTextBlock()
        {
            Theme.Initialize();

            BRUSH_HOVER = ThemeColours.Background_Brush_Blue_VeryDark;
            BRUSH_LIGHT = ThemeColours.Background_Brush_Blue_VeryVeryVeryDark;

            TextDecorations.Add(System.Windows.TextDecorations.Underline);
            Cursor     = Cursors.Hand;
            Foreground = BRUSH_LIGHT;

            MouseEnter += HyperlinkTextBlock_MouseEnter;
            MouseLeave += HyperlinkTextBlock_MouseLeave;

            MouseLeftButtonDown += HyperlinkTextBlock_MouseLeftButtonDown;
            MouseLeftButtonUp   += HyperlinkTextBlock_MouseLeftButtonUp;
        }
Ejemplo n.º 5
0
 public void enableLink()
 {
     MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(
         delegate(object sender, System.Windows.Input.MouseButtonEventArgs args)
     {
         // Text = "clicked!";
     });
     MouseEnter += new System.Windows.Input.MouseEventHandler(
         delegate(object sender, System.Windows.Input.MouseEventArgs args)
     {
         TextDecorations.Add(System.Windows.TextDecorations.Underline);
     });
     MouseLeave += new System.Windows.Input.MouseEventHandler(
         delegate(object sender, System.Windows.Input.MouseEventArgs args)
     {
         foreach (var td in System.Windows.TextDecorations.Underline)
         {
             TextDecorations.Remove(td);
         }
     });
 }