42 changed files with 436 additions and 408 deletions
@ -0,0 +1,92 @@
@@ -0,0 +1,92 @@
|
||||
<gui:OptionPanel x:Class="ICSharpCode.SharpDevelop.Editor.CodeCompletion.CodeCompletionOptionPanel" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:core="http://icsharpcode.net/sharpdevelop/core" |
||||
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui" |
||||
xmlns:sd="clr-namespace:ICSharpCode.SharpDevelop" |
||||
xmlns:widgets="clr-namespace:ICSharpCode.SharpDevelop.Widgets;assembly=ICSharpCode.SharpDevelop.Widgets"> |
||||
<widgets:StackPanelWithSpacing SpaceBetweenItems="5"> |
||||
<GroupBox |
||||
Margin="5"> |
||||
<GroupBox.Header> |
||||
<CheckBox |
||||
VerticalAlignment="Center" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.TextEditor.General.CodeCompletionCheckBox}" |
||||
IsChecked="{core:OptionBinding sd:CodeCompletionOptions.EnableCodeCompletion}" |
||||
x:Name="checkEnableCodeCompletion" /> |
||||
</GroupBox.Header> |
||||
|
||||
<widgets:StackPanelWithSpacing SpaceBetweenItems="10" IsEnabled="{Binding IsChecked, ElementName=checkEnableCodeCompletion}"> |
||||
<TextBlock |
||||
Text="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.LanguageDependend}" |
||||
TextWrapping="Wrap"/> |
||||
|
||||
<CheckBox |
||||
IsChecked="{core:OptionBinding sd:CodeCompletionOptions.CompleteWhenTyping}" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.CompleteWhenTyping}"/> |
||||
|
||||
<CheckBox |
||||
IsChecked="{core:OptionBinding sd:CodeCompletionOptions.CommitOnTabEnterOnly}" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.CommitOnTabEnterOnly}"/> |
||||
|
||||
<TextBlock |
||||
Text="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.CommitOnCharacters}" |
||||
TextWrapping="Wrap"/> |
||||
|
||||
<TextBox |
||||
Text="{core:OptionBinding sd:CodeCompletionOptions.CompletionCharList}"/> |
||||
|
||||
<CheckBox Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.UseDataUsageCache}" |
||||
x:Name="checkUseDataUsageCache" |
||||
IsChecked="{core:OptionBinding sd:CodeCompletionOptions.DataUsageCacheEnabled}"/> |
||||
|
||||
<widgets:StackPanelWithSpacing SpaceBetweenItems="4" Margin="30,0,0,0" |
||||
Orientation="Horizontal" IsEnabled="{Binding IsChecked, ElementName=checkUseDataUsageCache}"> |
||||
|
||||
<Label Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.SaveItemCountBeforeNumber}"/> |
||||
|
||||
<widgets:NumericUpDown MinWidth="50" |
||||
Minimum="50" Maximum="10000" SmallChange="50" |
||||
Value="{core:OptionBinding sd:CodeCompletionOptions.DataUsageCacheItemCount}"/> |
||||
|
||||
<Label Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.SaveItemCountAfterNumber}"/> |
||||
|
||||
<Button |
||||
Style="{x:Static core:GlobalStyles.ButtonStyle}" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.ClearCache}" |
||||
Click="Button_Click"/> |
||||
|
||||
</widgets:StackPanelWithSpacing> |
||||
</widgets:StackPanelWithSpacing> |
||||
</GroupBox> |
||||
|
||||
<GroupBox Header="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.TooltipLabel}" Margin="5"> |
||||
<widgets:StackPanelWithSpacing SpaceBetweenItems="10"> |
||||
<CheckBox |
||||
Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.UseTooltips}" |
||||
x:Name="checkUseTooltips" |
||||
IsChecked="{core:OptionBinding sd:CodeCompletionOptions.TooltipsEnabled}" /> |
||||
|
||||
<CheckBox |
||||
Margin="30,0,0,0" |
||||
IsChecked="{core:OptionBinding sd:CodeCompletionOptions.TooltipsOnlyWhenDebugging}" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.UseDebugTooltipsOnly}" |
||||
IsEnabled="{Binding IsChecked, ElementName=checkUseTooltips}" /> |
||||
|
||||
<CheckBox |
||||
VerticalAlignment="Center" |
||||
x:Name="checkUseInsight" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.UseInsight}" |
||||
IsChecked="{core:OptionBinding sd:CodeCompletionOptions.InsightEnabled}" /> |
||||
|
||||
<StackPanel Grid.Row="9" Orientation="Horizontal" Margin="0,10"> |
||||
<TextBlock Text="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.TooltipLinkTarget}" Margin="0,2,5,0" /> |
||||
|
||||
<ComboBox |
||||
sd:EnumBinding.EnumType="{x:Type sd:TooltipLinkTarget}" |
||||
SelectedValue="{core:OptionBinding sd:CodeCompletionOptions.TooltipLinkTarget}" /> |
||||
</StackPanel> |
||||
</widgets:StackPanelWithSpacing> |
||||
</GroupBox> |
||||
</widgets:StackPanelWithSpacing> |
||||
</gui:OptionPanel> |
@ -0,0 +1,41 @@
@@ -0,0 +1,41 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Windows; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Editor.CodeCompletion |
||||
{ |
||||
/// <summary>
|
||||
/// Interaction logic for CodeCompletionOptionPanel.xaml
|
||||
/// </summary>
|
||||
public partial class CodeCompletionOptionPanel : OptionPanel |
||||
{ |
||||
public CodeCompletionOptionPanel() |
||||
{ |
||||
InitializeComponent(); |
||||
this.DataContext = this; |
||||
} |
||||
|
||||
void Button_Click(object sender, RoutedEventArgs e) |
||||
{ |
||||
CodeCompletionDataUsageCache.ResetCache(); |
||||
} |
||||
} |
||||
} |
@ -1,110 +0,0 @@
@@ -1,110 +0,0 @@
|
||||
<gui:OptionPanel x:Class="ICSharpCode.SharpDevelop.Editor.CodeCompletion.CodeCompletionPanel" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:core="http://icsharpcode.net/sharpdevelop/core" |
||||
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui" |
||||
xmlns:sd="clr-namespace:ICSharpCode.SharpDevelop" |
||||
xmlns:widgets="clr-namespace:ICSharpCode.SharpDevelop.Widgets;assembly=ICSharpCode.SharpDevelop.Widgets"> |
||||
<Grid> |
||||
<Grid.RowDefinitions> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
</Grid.RowDefinitions> |
||||
|
||||
<TextBlock |
||||
Margin="0,0,0,5" |
||||
Text="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.MainOption}" |
||||
TextWrapping="Wrap" |
||||
VerticalAlignment="Center"/> |
||||
|
||||
<CheckBox Grid.Row="1" VerticalAlignment="Center" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.TextEditor.General.CodeCompletionCheckBox}" |
||||
IsChecked="{Binding EnableCodeCompletion}"> |
||||
</CheckBox> |
||||
|
||||
<GroupBox Grid.Row="2" Margin="0,8,0,0" |
||||
Header="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.DetailSettings}" |
||||
IsEnabled="{Binding EnableCodeCompletion}"> |
||||
|
||||
<Grid> |
||||
<Grid.RowDefinitions> |
||||
<RowDefinition Height="25"></RowDefinition> |
||||
<RowDefinition Height="25"></RowDefinition> |
||||
<RowDefinition Height="25"></RowDefinition> |
||||
<RowDefinition Height="25"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="25"></RowDefinition> |
||||
<RowDefinition Height="25"></RowDefinition> |
||||
<RowDefinition Height="25"></RowDefinition> |
||||
|
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
</Grid.RowDefinitions> |
||||
|
||||
<CheckBox Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.UseDataUsageCache}" |
||||
IsChecked="{Binding UseDataUsageCache}"> |
||||
</CheckBox> |
||||
|
||||
<widgets:StackPanelWithSpacing Grid.Row="1" SpaceBetweenItems="4" Margin="30,0,0,0" |
||||
Orientation="Horizontal" IsEnabled="{Binding UseDataUsageCache}"> |
||||
|
||||
<Label Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.SaveItemCountBeforeNumber}"></Label> |
||||
|
||||
<widgets:NumericUpDown MinWidth="50" |
||||
Minimum="50" Maximum="10000" SmallChange="50" IsEnabled="{Binding UseDataUsageCache}" |
||||
Value="{Binding DataUsageCacheItemCount}"> |
||||
</widgets:NumericUpDown> |
||||
|
||||
<Label Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.SaveItemCountAfterNumber}"></Label> |
||||
|
||||
<Button Style="{x:Static core:GlobalStyles.ButtonStyle}" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.ClearCache}" |
||||
Click="Button_Click"> |
||||
</Button> |
||||
|
||||
</widgets:StackPanelWithSpacing> |
||||
|
||||
<CheckBox Grid.Row="2" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.UseTooltips}" |
||||
IsChecked="{Binding UseTooltips}"> |
||||
</CheckBox> |
||||
|
||||
|
||||
<CheckBox x:Name="useDebugTooltipsOnly" Grid.Row="3" Margin="30,0,0,0" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.UseDebugTooltipsOnly}" |
||||
IsEnabled="{Binding UseTooltips}"> |
||||
</CheckBox> |
||||
|
||||
<TextBlock Grid.Row="4" Margin="0,3,0,13" |
||||
Text="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.LanguageDependend}" |
||||
TextWrapping="Wrap"> |
||||
</TextBlock> |
||||
|
||||
<CheckBox x:Name="completeWhenTyping" Grid.Row="5" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.CompleteWhenTyping}"> |
||||
</CheckBox> |
||||
|
||||
<CheckBox x:Name="useKeywordCompletionCheckBox" Grid.Row="6" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.UseKeywordCompletion}"> |
||||
</CheckBox> |
||||
|
||||
<CheckBox Grid.Row="7" VerticalAlignment="Center" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.UseInsight}" |
||||
IsChecked="{Binding UseInsight}" > |
||||
</CheckBox> |
||||
|
||||
<CheckBox x:Name="refreshInsightOnComma" Grid.Row="8" Margin="30,0,0,0" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.RefreshInsightOnComma}" |
||||
IsEnabled="{Binding UseInsight}"> |
||||
</CheckBox> |
||||
|
||||
<StackPanel Grid.Row="9" Orientation="Horizontal" Margin="0,10"> |
||||
<TextBlock Text="{core:Localize Dialog.Options.IDEOptions.CodeCompletion.TooltipLinkTarget}" Margin="0,2,2,0" /> |
||||
<ComboBox sd:EnumBinding.EnumType="{x:Type sd:TooltipLinkTarget}" |
||||
SelectedValue="{core:OptionBinding sd:CodeCompletionOptions.TooltipLinkTarget}" /> |
||||
</StackPanel> |
||||
</Grid> |
||||
</GroupBox> |
||||
</Grid> |
||||
</gui:OptionPanel> |
@ -1,122 +0,0 @@
@@ -1,122 +0,0 @@
|
||||
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Windows; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Editor.CodeCompletion |
||||
{ |
||||
/// <summary>
|
||||
/// Interaction logic for CodeCompletionPanelXaml.xaml
|
||||
/// </summary>
|
||||
public partial class CodeCompletionPanel : OptionPanel |
||||
{ |
||||
public CodeCompletionPanel() |
||||
{ |
||||
InitializeComponent(); |
||||
this.DataContext = this; |
||||
} |
||||
|
||||
#region overrides
|
||||
|
||||
public override void LoadOptions() |
||||
{ |
||||
base.LoadOptions(); |
||||
this.EnableCodeCompletion = CodeCompletionOptions.EnableCodeCompletion; |
||||
this.UseDataUsageCache = CodeCompletionOptions.DataUsageCacheEnabled; |
||||
DataUsageCacheItemCount = CodeCompletionOptions.DataUsageCacheItemCount; |
||||
UseTooltips = CodeCompletionOptions.TooltipsEnabled; |
||||
useDebugTooltipsOnly.IsChecked = CodeCompletionOptions.TooltipsOnlyWhenDebugging; |
||||
completeWhenTyping.IsChecked = CodeCompletionOptions.CompleteWhenTyping; |
||||
useKeywordCompletionCheckBox.IsChecked = CodeCompletionOptions.KeywordCompletionEnabled; |
||||
UseInsight = CodeCompletionOptions.InsightEnabled; |
||||
refreshInsightOnComma.IsChecked = CodeCompletionOptions.InsightRefreshOnComma; |
||||
} |
||||
|
||||
|
||||
public override bool SaveOptions() |
||||
{ |
||||
CodeCompletionOptions.EnableCodeCompletion = this.EnableCodeCompletion; |
||||
CodeCompletionOptions.DataUsageCacheEnabled = this.UseDataUsageCache; |
||||
CodeCompletionOptions.DataUsageCacheItemCount = DataUsageCacheItemCount; |
||||
CodeCompletionOptions.TooltipsEnabled = UseTooltips; |
||||
CodeCompletionOptions.TooltipsOnlyWhenDebugging = (bool)useDebugTooltipsOnly.IsChecked; |
||||
CodeCompletionOptions.CompleteWhenTyping = (bool)completeWhenTyping.IsChecked; |
||||
CodeCompletionOptions.KeywordCompletionEnabled = (bool)useKeywordCompletionCheckBox.IsChecked; |
||||
CodeCompletionOptions.InsightEnabled = UseInsight; |
||||
CodeCompletionOptions.InsightRefreshOnComma = (bool)refreshInsightOnComma.IsChecked; |
||||
return base.SaveOptions(); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
private bool enableCodeCompletion; |
||||
|
||||
public bool EnableCodeCompletion { |
||||
get { return enableCodeCompletion; } |
||||
set { enableCodeCompletion = value; |
||||
base.RaisePropertyChanged(() => EnableCodeCompletion);} |
||||
} |
||||
|
||||
|
||||
private bool useDataUsageCache; |
||||
|
||||
public bool UseDataUsageCache { |
||||
get { return useDataUsageCache; } |
||||
set { useDataUsageCache = value; |
||||
base.RaisePropertyChanged(() => UseDataUsageCache);} |
||||
} |
||||
|
||||
private int dataUsageCacheItemCount; |
||||
|
||||
public int DataUsageCacheItemCount { |
||||
get { return dataUsageCacheItemCount; } |
||||
set { dataUsageCacheItemCount = value; |
||||
base.RaisePropertyChanged(() => DataUsageCacheItemCount);} |
||||
} |
||||
|
||||
|
||||
private bool useTooltips; |
||||
|
||||
public bool UseTooltips { |
||||
get { return useTooltips; } |
||||
set { useTooltips = value; |
||||
base.RaisePropertyChanged(() => UseTooltips);} |
||||
} |
||||
|
||||
private bool useInsight; |
||||
|
||||
public bool UseInsight { |
||||
get { return useInsight; } |
||||
set { useInsight = value; |
||||
base.RaisePropertyChanged(() => UseInsight);} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
void Button_Click(object sender, RoutedEventArgs e) |
||||
{ |
||||
CodeCompletionDataUsageCache.ResetCache(); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue