Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5866 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61pull/1/head
6 changed files with 92 additions and 1 deletions
@ -0,0 +1,10 @@ |
|||||||
|
<UserControl x:Class="MSHelpSystem.Controls.SearchPadControl" |
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||||
|
xmlns:core="http://icsharpcode.net/sharpdevelop/core" |
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
||||||
|
<StackPanel> |
||||||
|
<TextBlock Text="{core:Localize AddIns.HelpViewer.SearchLookForLabel}" Margin="5,2,5,1" /> |
||||||
|
<TextBox IsEnabled="False" Name="searchWord" Margin="5,1,5,5" Padding="2" SelectionChanged="SearchWordSelectionChanged" PreviewKeyUp="SearchWordPreviewKeyUp" /> |
||||||
|
<Button IsEnabled="False" Name="doSearch" Content="{core:Localize AddIns.HelpViewer.SearchDoSearchButton}" Margin="5" Width="80" Padding="1" HorizontalAlignment="Left" Click="DoSearchClicked" /> |
||||||
|
</StackPanel> |
||||||
|
</UserControl> |
@ -0,0 +1,42 @@ |
|||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Text; |
||||||
|
using System.Windows; |
||||||
|
using System.Windows.Controls; |
||||||
|
using System.Windows.Data; |
||||||
|
using System.Windows.Documents; |
||||||
|
using System.Windows.Input; |
||||||
|
using System.Windows.Media; |
||||||
|
using MSHelpSystem.Core; |
||||||
|
|
||||||
|
namespace MSHelpSystem.Controls |
||||||
|
{ |
||||||
|
public partial class SearchPadControl : UserControl |
||||||
|
{ |
||||||
|
public SearchPadControl() |
||||||
|
{ |
||||||
|
InitializeComponent(); |
||||||
|
searchWord.IsEnabled = Help3Environment.IsHelp3ProtocolRegistered; |
||||||
|
} |
||||||
|
|
||||||
|
void SearchWordSelectionChanged(object sender, RoutedEventArgs e) |
||||||
|
{ |
||||||
|
doSearch.IsEnabled = (Help3Environment.IsHelp3ProtocolRegistered && !string.IsNullOrEmpty(searchWord.Text)); |
||||||
|
} |
||||||
|
|
||||||
|
void SearchWordPreviewKeyUp(object sender, KeyEventArgs e) |
||||||
|
{ |
||||||
|
if (e.Key == Key.Return || e.Key == Key.Enter) |
||||||
|
DoSearchClicked(null, null); |
||||||
|
} |
||||||
|
|
||||||
|
void DoSearchClicked(object sender, RoutedEventArgs e) |
||||||
|
{ |
||||||
|
string search = (string)searchWord.Text; |
||||||
|
if (string.IsNullOrEmpty(search)) { |
||||||
|
throw new ArgumentNullException("search"); |
||||||
|
} |
||||||
|
DisplayHelp.Search(search); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue