Skip to content

Commit

Permalink
Update to Catel 6 & enable nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
GeertvanHorrik committed Oct 13, 2022
1 parent c55bda0 commit 4d484e3
Show file tree
Hide file tree
Showing 62 changed files with 604 additions and 891 deletions.
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mode: ContinuousDeployment
assembly-versioning-scheme: MajorMinorPatch
next-version: 4.0.0
next-version: 5.0.0
6 changes: 0 additions & 6 deletions src/Orc.CsvTextEditor.Example/App.config

This file was deleted.

14 changes: 1 addition & 13 deletions src/Orc.CsvTextEditor.Example/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="App.xaml.cs" company="WildGums">
// Copyright (c) 2008 - 2018 WildGums. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------


namespace Orc.CsvTextEditor.Example
namespace Orc.CsvTextEditor.Example
{
using System.Globalization;
using System.Windows;
Expand All @@ -19,16 +12,12 @@ namespace Orc.CsvTextEditor.Example
/// </summary>
public partial class App : Application
{
#region Constructors
public App()
{
#if DEBUG
LogManager.AddDebugListener();
#endif
}
#endregion

#region Methods
protected override void OnStartup(StartupEventArgs e)
{
var languageService = ServiceLocator.Default.ResolveType<ILanguageService>();
Expand All @@ -43,6 +32,5 @@ protected override void OnStartup(StartupEventArgs e)

base.OnStartup(e);
}
#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<RootNamespace>Orc.CsvTextEditor.Example</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<SonarQubeExclude>true</SonarQubeExclude>
<Nullable>annotations</Nullable>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -21,8 +22,7 @@
</PackageReference>
<PackageReference Include="LoadAssembliesOnStartup.Fody" Version="4.6.0" PrivateAssets="all" />
<PackageReference Include="ModuleInit.Fody" Version="2.1.1" PrivateAssets="all" />
<PackageReference Include="Orchestra.Core" Version="6.8.1" />
<PackageReference Include="System.Security.Permissions" Version="6.0.0" />
<PackageReference Include="Orchestra.Core" Version="7.0.0-alpha0051" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 2 additions & 9 deletions src/Orc.CsvTextEditor.Example/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="WildGums">
// Copyright (c) 2008 - 2017 WildGums. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------


using System.Reflection;
using System.Reflection;
using System.Runtime.InteropServices;

// All other assembly info is defined in SharedAssembly.cs
Expand All @@ -18,4 +11,4 @@
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]
[assembly: ComVisible(false)]
3 changes: 3 additions & 0 deletions src/Orc.CsvTextEditor.Example/Themes/Generic.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">

</ResourceDictionary>
19 changes: 3 additions & 16 deletions src/Orc.CsvTextEditor.Example/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MainViewModel.cs" company="WildGums">
// Copyright (c) 2008 - 2019 WildGums. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------


namespace Orc.CsvTextEditor.ViewModels
namespace Orc.CsvTextEditor.ViewModels
{
using System;
using Catel;
Expand All @@ -18,10 +11,10 @@ public class MainViewModel : ViewModelBase
{
private readonly IServiceLocator _serviceLocator;

#region Constructors
public MainViewModel(IServiceLocator serviceLocator)//, ICsvTextEditorInstance csvTextEditorInstance)
{
Argument.IsNotNull(() => serviceLocator);
ArgumentNullException.ThrowIfNull(serviceLocator);

_serviceLocator = serviceLocator;

EditorInstanceType = typeof(CsvTextEditorInstance);
Expand All @@ -30,19 +23,13 @@ public MainViewModel(IServiceLocator serviceLocator)//, ICsvTextEditorInstance c
FindAndReplace = new Command(OnFindAndReplace);
}

#endregion

#region Properties
public Command FindAndReplace { get; }
public Type EditorInstanceType { get; private set; }
#endregion

#region Methods
private void OnFindAndReplace()
{
//var csvTextEditorInstance = _serviceLocator.TryResolveType<ICsvTextEditorInstance>(Scope);
//csvTextEditorInstance?.ShowTool<FindReplaceTool>();
}
#endregion
}
}
11 changes: 1 addition & 10 deletions src/Orc.CsvTextEditor.Example/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MainWindow.xaml.cs" company="WildGums">
// Copyright (c) 2008 - 2018 WildGums. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------


namespace Orc.CsvTextEditor.Views
namespace Orc.CsvTextEditor.Views
{
public partial class MainWindow
{
#region Constructors
public MainWindow()
{
InitializeComponent();
}
#endregion
}
}
22 changes: 0 additions & 22 deletions src/Orc.CsvTextEditor.Tests/DummyFacts.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="GlobalInitialization.approvaltests.cs" company="WildGums">
// Copyright (c) 2008 - 2017 WildGums. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------


using ApprovalTests.Reporters;
using ApprovalTests.Reporters;

#if DEBUG
[assembly: UseReporter(typeof(BeyondCompareReporter))]
Expand Down
1 change: 1 addition & 0 deletions src/Orc.CsvTextEditor.Tests/Orc.CsvTextEditor.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<PackageTags></PackageTags>
<SonarQubeExclude>true</SonarQubeExclude>
<UseWpf>true</UseWpf>
<Nullable>annotations</Nullable>
</PropertyGroup>

<ItemGroup>
Expand Down
52 changes: 26 additions & 26 deletions src/Orc.CsvTextEditor.Tests/Orc.CsvTextEditor.approved.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class CsvColumnCompletionData : ICSharpCode.AvalonEdit.CodeCompletion.ICo
public CsvColumnCompletionData(string text) { }
public object Content { get; }
public object Description { get; }
public System.Windows.Media.ImageSource Image { get; }
public System.Windows.Media.ImageSource? Image { get; }
public double Priority { get; }
public string Text { get; }
public void Complete(ICSharpCode.AvalonEdit.Editing.TextArea textArea, ICSharpCode.AvalonEdit.Document.ISegment completionSegment, System.EventArgs insertionRequestEventArgs) { }
Expand All @@ -38,9 +38,9 @@ public class CsvTextEditorControl : System.Windows.Controls.Control
public static readonly System.Windows.DependencyProperty EditorInstanceTypeProperty;
public static readonly System.Windows.DependencyProperty TextProperty;
public CsvTextEditorControl() { }
public Orc.CsvTextEditor.ICsvTextEditorInstance CsvTextEditorInstance { get; set; }
public System.Type EditorInstanceType { get; set; }
public string Text { get; set; }
public Orc.CsvTextEditor.ICsvTextEditorInstance? CsvTextEditorInstance { get; set; }
public System.Type? EditorInstanceType { get; set; }
public string? Text { get; set; }
public static System.Windows.Input.RoutedCommand AddColumn { get; }
public static System.Windows.Input.RoutedCommand AddLine { get; }
public static System.Windows.Input.RoutedCommand Copy { get; }
Expand Down Expand Up @@ -80,10 +80,10 @@ public CsvTextEditorInstance(ICSharpCode.AvalonEdit.TextEditor textEditor, Catel
public string SelectionText { get; }
public Orc.Controls.Tools.IControlToolManager ToolManager { get; }
public System.Collections.Generic.IEnumerable<Orc.Controls.IControlTool> Tools { get; }
public event System.EventHandler<Orc.CsvTextEditor.CaretTextLocationChangedEventArgs> CaretTextLocationChanged;
public event System.EventHandler<System.EventArgs> EditorAttached;
public event System.EventHandler<System.EventArgs> EditorDetached;
public event System.EventHandler<System.EventArgs> TextChanged;
public event System.EventHandler<Orc.CsvTextEditor.CaretTextLocationChangedEventArgs>? CaretTextLocationChanged;
public event System.EventHandler<System.EventArgs>? EditorAttached;
public event System.EventHandler<System.EventArgs>? EditorDetached;
public event System.EventHandler<System.EventArgs>? TextChanged;
public void AttachEditor(object editor) { }
public void Copy() { }
public void Cut() { }
Expand Down Expand Up @@ -132,7 +132,7 @@ protected override void OnAssociatedObjectUnloaded() { }
}
public class FindReplaceService : Orc.Controls.Services.IFindReplaceService
{
public FindReplaceService(ICSharpCode.AvalonEdit.TextEditor textEditor, Orc.CsvTextEditor.ICsvTextEditorInstance csvTextEditorInstance = null) { }
public FindReplaceService(ICSharpCode.AvalonEdit.TextEditor textEditor, Orc.CsvTextEditor.ICsvTextEditorInstance csvTextEditorInstance) { }
public bool FindNext(string textToFind, Orc.Controls.FindReplaceSettings settings) { }
public string GetInitialFindText() { }
public bool Replace(string textToFind, string textToReplace, Orc.Controls.FindReplaceSettings settings) { }
Expand All @@ -141,7 +141,7 @@ public void ReplaceAll(string textToFind, string textToReplace, Orc.Controls.Fin
public class FindReplaceTool : Orc.Controls.FindReplaceTool<Orc.CsvTextEditor.FindReplaceService>
{
public FindReplaceTool(Catel.Services.IUIVisualizerService uiVisualizerService, Catel.IoC.ITypeFactory typeFactory, Catel.IoC.IServiceLocator serviceLocator) { }
protected override Orc.CsvTextEditor.FindReplaceService CreateFindReplaceService(object target) { }
protected override Orc.CsvTextEditor.FindReplaceService? CreateFindReplaceService(object target) { }
}
public class FirstLineAlwaysBoldTransformer : ICSharpCode.AvalonEdit.Rendering.DocumentColorizingTransformer
{
Expand All @@ -156,8 +156,8 @@ protected override void ColorizeLine(ICSharpCode.AvalonEdit.Document.DocumentLin
public class HighlightAllOccurencesOfSelectedWordTransformer : ICSharpCode.AvalonEdit.Rendering.DocumentColorizingTransformer
{
public HighlightAllOccurencesOfSelectedWordTransformer() { }
public string SelectedWord { set; }
public ICSharpCode.AvalonEdit.Editing.Selection Selection { set; }
public string? SelectedWord { set; }
public ICSharpCode.AvalonEdit.Editing.Selection? Selection { set; }
protected override void ColorizeLine(ICSharpCode.AvalonEdit.Document.DocumentLine line) { }
}
public interface ICsvTextEditorInitializer
Expand All @@ -179,10 +179,10 @@ public interface ICsvTextEditorInstance : System.IDisposable
string SelectionText { get; }
Orc.Controls.Tools.IControlToolManager ToolManager { get; }
System.Collections.Generic.IEnumerable<Orc.Controls.IControlTool> Tools { get; }
event System.EventHandler<Orc.CsvTextEditor.CaretTextLocationChangedEventArgs> CaretTextLocationChanged;
event System.EventHandler<System.EventArgs> EditorAttached;
event System.EventHandler<System.EventArgs> EditorDetached;
event System.EventHandler<System.EventArgs> TextChanged;
event System.EventHandler<Orc.CsvTextEditor.CaretTextLocationChangedEventArgs>? CaretTextLocationChanged;
event System.EventHandler<System.EventArgs>? EditorAttached;
event System.EventHandler<System.EventArgs>? EditorDetached;
event System.EventHandler<System.EventArgs>? TextChanged;
void AttachEditor(object editor);
void Copy();
void Cut();
Expand Down Expand Up @@ -213,9 +213,9 @@ void ExecuteOperation<TOperation>()
}
public static class ICsvTextEditorInstanceExtensions
{
public static Orc.Controls.IControlTool GetToolByName(this Orc.CsvTextEditor.ICsvTextEditorInstance csvTextEditorInstance, string toolName) { }
public static void ShowTool(this Orc.CsvTextEditor.ICsvTextEditorInstance csvTextEditorInstance, string toolName, object parameter = null) { }
public static void ShowTool<T>(this Orc.CsvTextEditor.ICsvTextEditorInstance csvTextEditorInstance, object parameter = null)
public static Orc.Controls.IControlTool? GetToolByName(this Orc.CsvTextEditor.ICsvTextEditorInstance csvTextEditorInstance, string toolName) { }
public static void ShowTool(this Orc.CsvTextEditor.ICsvTextEditorInstance csvTextEditorInstance, string toolName, object? parameter = null) { }
public static void ShowTool<T>(this Orc.CsvTextEditor.ICsvTextEditorInstance csvTextEditorInstance, object? parameter = null)
where T : class, Orc.Controls.IControlTool { }
}
public static class KeyGestureExtensions
Expand All @@ -231,9 +231,9 @@ public Line() { }
}
public class Location
{
public Location() { }
public Orc.CsvTextEditor.Column Column { get; set; }
public Orc.CsvTextEditor.Line Line { get; set; }
public Location(Orc.CsvTextEditor.Column column, Orc.CsvTextEditor.Line line) { }
public Orc.CsvTextEditor.Column Column { get; }
public Orc.CsvTextEditor.Line Line { get; }
public int Offset { get; set; }
}
public static class LocationExtensions
Expand All @@ -245,16 +245,16 @@ public class ReplaceCommandBindingBehavior : Catel.Windows.Interactivity.Behavio
public static readonly System.Windows.DependencyProperty CommandProperty;
public static readonly System.Windows.DependencyProperty ReplacementCommandProperty;
public ReplaceCommandBindingBehavior() { }
public System.Windows.Input.ICommand Command { get; set; }
public System.Windows.Input.RoutedCommand ReplacementCommand { get; set; }
public System.Windows.Input.ICommand? Command { get; set; }
public System.Windows.Input.RoutedCommand? ReplacementCommand { get; set; }
}
public class ReplaceKeyInputBindingBehavior : Catel.Windows.Interactivity.BehaviorBase<ICSharpCode.AvalonEdit.TextEditor>
{
public static readonly System.Windows.DependencyProperty CommandProperty;
public static readonly System.Windows.DependencyProperty GestureProperty;
public ReplaceKeyInputBindingBehavior() { }
public System.Windows.Input.ICommand Command { get; set; }
public System.Windows.Input.KeyGesture Gesture { get; set; }
public System.Windows.Input.ICommand? Command { get; set; }
public System.Windows.Input.KeyGesture? Gesture { get; set; }
protected override void OnAssociatedObjectLoaded() { }
}
public static class StringExtensions
Expand Down
11 changes: 2 additions & 9 deletions src/Orc.CsvTextEditor.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="WildGums">
// Copyright (c) 2008 - 2017 WildGums. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------


using System.Reflection;
using System.Reflection;
using System.Runtime.InteropServices;

// All other assembly info is defined in SharedAssembly.cs
Expand All @@ -18,4 +11,4 @@
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]
[assembly: ComVisible(false)]
9 changes: 1 addition & 8 deletions src/Orc.CsvTextEditor.Tests/PublicApiFacts.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="PublicApiFacts.cs" company="WildGums">
// Copyright (c) 2008 - 2017 WildGums. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------


namespace Orc.CsvTextEditor.Tests
namespace Orc.CsvTextEditor.Tests
{
using System.IO;
using System.Reflection;
Expand Down
4 changes: 2 additions & 2 deletions src/Orc.CsvTextEditor.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29920.165
# Visual Studio Version 17
VisualStudioVersion = 17.4.33006.217
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A8A1A4EE-E04A-43AB-90C9-41E7B82EE1E5}"
EndProject
Expand Down
Loading

0 comments on commit 4d484e3

Please sign in to comment.