diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/HighlightingOptions.xaml b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/HighlightingOptions.xaml
index 5018617eec..4e70799ca9 100644
--- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/HighlightingOptions.xaml
+++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/HighlightingOptions.xaml
@@ -36,7 +36,7 @@
Click="ResetButtonClick" Padding="8,0" Height="21" Margin="0,4"
Content="Reset" />
-
+
diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/HighlightingOptions.xaml.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/HighlightingOptions.xaml.cs
index 8f14e0a363..ce94bed520 100644
--- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/HighlightingOptions.xaml.cs
+++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/HighlightingOptions.xaml.cs
@@ -55,6 +55,7 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options
&& name.EndsWith(".xshd", StringComparison.OrdinalIgnoreCase)
&& !name.EndsWith("XmlDoc.xshd", StringComparison.OrdinalIgnoreCase)
let def = LoadBuiltinXshd(name)
+ where def.Elements.OfType().Any(c => c.ExampleText != null)
orderby def.Name
select def
).ToList();
@@ -63,35 +64,30 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options
customizationList = CustomizedHighlightingColor.LoadColors();
languageComboBox.Items.Clear();
- languageComboBox.Items.Add(new XshdSyntaxDefinition { Name = "All languages" });
+ //languageComboBox.Items.Add(new XshdSyntaxDefinition { Name = "All languages" });
foreach (XshdSyntaxDefinition def in allSyntaxDefinitions)
languageComboBox.Items.Add(def);
- languageComboBox.SelectedIndex = 0;
+ if (allSyntaxDefinitions.Count > 0)
+ languageComboBox.SelectedIndex = 0;
}
void LanguageComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
listBox.Items.Clear();
- if (languageComboBox.SelectedIndex == 0) {
- var namedColors =
- from def in allSyntaxDefinitions
- from color in def.Elements.OfType()
- where color.ExampleText != null
- group new { DefinitionName = def.Name, Color = color } by color.Name into g
- orderby g.Key
- select g.First();
-
- foreach (var namedColor in namedColors) {
- var def = HighlightingManager.Instance.GetDefinition(namedColor.DefinitionName);
- IHighlightingItem item = new NamedColorHighlightingItem(def, namedColor.Color);
- item = new CustomizedHighlightingItem(customizationList, item, null);
- listBox.Items.Add(item);
- item.PropertyChanged += item_PropertyChanged;
+ XshdSyntaxDefinition xshd = (XshdSyntaxDefinition)languageComboBox.SelectedItem;
+ if (xshd != null) {
+ IHighlightingDefinition def = HighlightingManager.Instance.GetDefinition(xshd.Name);
+ foreach (XshdColor namedColor in xshd.Elements.OfType()) {
+ if (namedColor.ExampleText != null) {
+ IHighlightingItem item = new NamedColorHighlightingItem(def, namedColor);
+ item = new CustomizedHighlightingItem(customizationList, item, xshd.Name);
+ listBox.Items.Add(item);
+ item.PropertyChanged += item_PropertyChanged;
+ }
}
- } else {
- throw new NotImplementedException();
+ if (listBox.Items.Count > 0)
+ listBox.SelectedIndex = 0;
}
- listBox.SelectedIndex = 0;
}
void item_PropertyChanged(object sender, PropertyChangedEventArgs e)
@@ -107,7 +103,9 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options
void ResetButtonClick(object sender, RoutedEventArgs e)
{
- ((IHighlightingItem)resetButton.DataContext).Reset();
+ IHighlightingItem item = resetButton.DataContext as IHighlightingItem;
+ if (item != null)
+ item.Reset();
}
void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/UndoStack.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/UndoStack.cs
index 80fe70aff4..ac4ff7ab59 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/UndoStack.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/UndoStack.cs
@@ -27,7 +27,6 @@ namespace ICSharpCode.AvalonEdit.Document
internal const int StatePlaybackModifyDocument = 2;
/// state is used for checking that noone but the UndoStack performs changes
/// during Undo events
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1085:DoNotInitializeUnnecessarily")]
internal int state = StateListen;
Deque undostack = new Deque();
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/CSharp-Mode.xshd b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/CSharp-Mode.xshd
index 1ae089ae5c..c01c049aea 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/CSharp-Mode.xshd
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/CSharp-Mode.xshd
@@ -1,9 +1,29 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -18,7 +38,7 @@
-
+
\#
@@ -82,31 +102,9 @@
-
- ?
- ,
- .
- ;
- (
- )
- [
- ]
- {
- }
- +
- -
- /
- %
- *
- <
- >
- ^
- =
- ~
- !
- |
- &
-
+
+ [?,.;()\[\]{}+\-/%*<>^+~!|&]+
+
this
@@ -125,30 +123,28 @@
-
+
else
if
switch
case
default
-
-
-
do
for
foreach
in
while
+ lock
-
+
break
continue
goto
return
-
+
yield
partial
global
@@ -169,24 +165,24 @@
dynamic
-
+
try
throw
catch
finally
-
+
checked
unchecked
-
+
fixed
unsafe
-
+
bool
byte
char
@@ -204,31 +200,28 @@
ulong
-
+
class
interface
delegate
object
string
-
-
-
void
-
+
explicit
implicit
operator
-
+
params
ref
out
-
+
abstract
const
event
@@ -241,43 +234,39 @@
volatile
-
+
public
protected
private
internal
-
+
namespace
using
-
- lock
-
-
-
+
get
set
add
remove
-
+
null
value
-
+
\b
[\d\w_]+ # an identifier
(?=\s*\() # followed by (
-
+
\b0[xX][0-9a-fA-F]+ # hex number
| \b
( \d+(\.[0-9]+)? #number with optional floating point
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Patch-Mode.xshd b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Patch-Mode.xshd
index 19ff0e8cf0..c8e1c3cfdb 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Patch-Mode.xshd
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Patch-Mode.xshd
@@ -1,28 +1,34 @@
+
+
+
+
+
+
-
+
Index:\s
-
+
==
-
+
---
-
+
\+\+\+
- @
+ @@
-
+
-
-
+
\+
-
+
\s
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/VBNET-Mode.xshd b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/VBNET-Mode.xshd
index cc7b03d646..0ba2179e3b 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/VBNET-Mode.xshd
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/VBNET-Mode.xshd
@@ -5,13 +5,13 @@
-
+
-
+
-
+
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/XML-Mode.xshd b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/XML-Mode.xshd
index 032def7740..f77b72d8ed 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/XML-Mode.xshd
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/XML-Mode.xshd
@@ -1,13 +1,13 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -22,7 +22,7 @@
<!DOCTYPE
>
-
+
<\?
\?>
@@ -30,13 +30,15 @@
<
>
+
"
- "
+ "|(?=<)
'
- '
+ '|(?=<)
[\d\w_\-\.]+(?=(\s*=))
=
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj
index bc23277f07..ba90555f3f 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj
@@ -19,7 +19,7 @@
False
File
False
- -Microsoft.Design#CA1020;-Microsoft.Design#CA1033;-Microsoft.Performance#CA1810
+ -Microsoft.Design#CA1020;-Microsoft.Design#CA1033;-Microsoft.Performance#CA1805;-Microsoft.Performance#CA1810
..\..\..\..\bin\
..\..\..\..\bin\ICSharpCode.AvalonEdit.xml
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Indentation/CSharp/DocumentAccessor.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Indentation/CSharp/DocumentAccessor.cs
index b75524530f..c40bf02f4c 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Indentation/CSharp/DocumentAccessor.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Indentation/CSharp/DocumentAccessor.cs
@@ -20,13 +20,13 @@ namespace ICSharpCode.AvalonEdit.Indentation.CSharp
{
/// Gets if the current line is read only (because it is not in the
/// selected text region)
- bool ReadOnly { get; }
+ bool IsReadOnly { get; }
/// Gets the number of the current line.
int LineNumber { get; }
/// Gets/Sets the text of the current line.
string Text { get; set; }
/// Advances to the next line.
- bool Next();
+ bool MoveNext();
}
#region TextDocumentAccessor
@@ -68,7 +68,7 @@ namespace ICSharpCode.AvalonEdit.Indentation.CSharp
DocumentLine line;
///
- public bool ReadOnly {
+ public bool IsReadOnly {
get {
return num < minLine;
}
@@ -94,7 +94,7 @@ namespace ICSharpCode.AvalonEdit.Indentation.CSharp
}
///
- public bool Next()
+ public bool MoveNext()
{
if (lineDirty) {
doc.Replace(line, text);
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Indentation/CSharp/IndentationReformatter.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Indentation/CSharp/IndentationReformatter.cs
index 3f1415c8f2..b9cd5fbc75 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Indentation/CSharp/IndentationReformatter.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Indentation/CSharp/IndentationReformatter.cs
@@ -121,7 +121,7 @@ namespace ICSharpCode.AvalonEdit.Indentation.CSharp
{
Init();
- while (doc.Next()) {
+ while (doc.MoveNext()) {
Step(doc, set);
}
}
@@ -389,7 +389,7 @@ namespace ICSharpCode.AvalonEdit.Indentation.CSharp
oldBlock.OneLineBlock = block.OneLineBlock - 1;
}
- if (doc.ReadOnly) {
+ if (doc.IsReadOnly) {
// We can't change the current line, but we should accept the existing
// indentation if possible (=if the current statement is not a multiline
// statement).
diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/PixelSnapHelpers.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/PixelSnapHelpers.cs
index 986e770fbb..279c74b3a9 100644
--- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/PixelSnapHelpers.cs
+++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/PixelSnapHelpers.cs
@@ -34,18 +34,18 @@ namespace ICSharpCode.AvalonEdit.Utils
}
///
- /// Aligns val on the next middle of a pixel.
+ /// Aligns on the next middle of a pixel.
///
- /// The value that should be aligned
+ /// The value that should be aligned
/// The size of one pixel
- public static double PixelAlign(double val, double pixelSize)
+ public static double PixelAlign(double value, double pixelSize)
{
// 0 -> 0.5
// 0.1 -> 0.5
// 0.5 -> 0.5
// 0.9 -> 0.5
// 1 -> 1.5
- return pixelSize * (Math.Round((val / pixelSize) + 0.5) - 0.5);
+ return pixelSize * (Math.Round((value / pixelSize) + 0.5) - 0.5);
}
///
@@ -61,11 +61,11 @@ namespace ICSharpCode.AvalonEdit.Utils
}
///
- /// Rounds val to whole number of pixels.
+ /// Rounds to whole number of pixels.
///
- public static Point Round(Point val, Size pixelSize)
+ public static Point Round(Point point, Size pixelSize)
{
- return new Point(Round(val.X, pixelSize.Width), Round(val.Y, pixelSize.Height));
+ return new Point(Round(point.X, pixelSize.Width), Round(point.Y, pixelSize.Height));
}
///
@@ -78,19 +78,19 @@ namespace ICSharpCode.AvalonEdit.Utils
}
///
- /// Rounds val to a whole number of pixels.
+ /// Rounds to a whole number of pixels.
///
- public static double Round(double val, double pixelSize)
+ public static double Round(double value, double pixelSize)
{
- return pixelSize * Math.Round(val / pixelSize);
+ return pixelSize * Math.Round(value / pixelSize);
}
///
- /// Rounds val to an whole odd number of pixels.
+ /// Rounds to an whole odd number of pixels.
///
- public static double RoundToOdd(double val, double pixelSize)
+ public static double RoundToOdd(double value, double pixelSize)
{
- return Round(val - pixelSize, pixelSize * 2) + pixelSize;
+ return Round(value - pixelSize, pixelSize * 2) + pixelSize;
}
}
}
diff --git a/src/Main/Base/Project/Src/Gui/Components/ColorPicker.xaml b/src/Main/Base/Project/Src/Gui/Components/ColorPicker.xaml
index aebeb90c33..f213f648d2 100644
--- a/src/Main/Base/Project/Src/Gui/Components/ColorPicker.xaml
+++ b/src/Main/Base/Project/Src/Gui/Components/ColorPicker.xaml
@@ -1,15 +1,21 @@
-
-