Skip to content

Commit

Permalink
NET8
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorBanai committed Nov 16, 2023
1 parent 00d2a7d commit 90a33ee
Show file tree
Hide file tree
Showing 25 changed files with 188 additions and 151 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ dotnet_diagnostic.SA1122.severity = suggestion
dotnet_diagnostic.SA1108.severity = silent
dotnet_diagnostic.SA1012.severity = error
dotnet_diagnostic.SA1500.severity = error
dotnet_diagnostic.SA1316.severity = error

[*.{cs,vb}]
dotnet_style_operator_placement_when_wrapping = beginning_of_line
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dotnet-core-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3.0.3
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.1.3
uses: microsoft/setup-msbuild@v1.3.1

# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
Expand Down
10 changes: 9 additions & 1 deletion Analogy.Example.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Analogy.LogViewer.Example", "Analogy.LogViewer.Example\Analogy.LogViewer.Example.csproj", "{69EF9461-D518-457B-A354-B8A4407F80FF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Analogy.LogViewer.Example.UnitTests", "Analogy.LogViewer.Example.UnitTests\Analogy.LogViewer.Example.UnitTests.csproj", "{1F0A036F-B1E0-4873-B87C-64B1E8FE8672}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Analogy.LogViewer.Example.UnitTests", "Analogy.LogViewer.Example.UnitTests\Analogy.LogViewer.Example.UnitTests.csproj", "{1F0A036F-B1E0-4873-B87C-64B1E8FE8672}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D4A0EAC0-DF24-43A5-9EA6-D4F61DAFC7F9}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Directory.Build.props = Directory.Build.props
.github\workflows\dotnet-core-desktop.yml = .github\workflows\dotnet-core-desktop.yml
nuget.config = nuget.config
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Analogy.LogViewer.Example.UnitTests/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public class UnitTest1
//{
//}
}
}
}
41 changes: 7 additions & 34 deletions Analogy.LogViewer.Example/Analogy.LogViewer.Example.csproj
Original file line number Diff line number Diff line change
@@ -1,55 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<TargetFrameworks>net7.0-windows;net6.0-windows;net48;net471</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<VersionPrefix>5.0.3</VersionPrefix>
<TargetFrameworks>net8.0-windows;net7.0-windows;net6.0-windows;net48;net471</TargetFrameworks>
<VersionPrefix>6.0.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>Lior Banai</Authors>
<Company>Analogy.LogViewer</Company>
<Product>Analogy.LogViewer.Example</Product>
<PackageId>Analogy.LogViewer.Example</PackageId>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Copyright>Lior Banai © 2020-2023</Copyright>
<Copyright>Lior Banai © 2020-2024</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Analogy-LogViewer/Analogy.LogViewer.Example</PackageProjectUrl>
<RepositoryUrl>https://github.com/Analogy-LogViewer/Analogy.LogViewer.Example</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageIcon>icon.png</PackageIcon>
<PackageIconUrl />
<Description>Example implementation of Analogy Log Viewer Data Provider</Description>
<PackageReleaseNotes>Example implementation of Analogy Log Viewer Data Provider</PackageReleaseNotes>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Analogy.LogViewer.Interfaces" Version="5.0.3" />
<PackageReference Include="Analogy.CommonUtilities" Version="5.0.3" />
<PackageReference Include="Analogy.LogViewer.Template" Version="5.0.3" />
<PackageReference Include="Microsoft.Build.Tasks.Git" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Resources.Extensions" Version="7.0.0" />
<PackageReference Include="Analogy.LogViewer.Interfaces" Version="6.0.0.1" />
<PackageReference Include="Analogy.CommonUtilities" Version="6.0.0" />
<PackageReference Include="Analogy.LogViewer.Template" Version="6.0.0" />
<PackageReference Include="System.Resources.Extensions" Version="8.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' or '$(TargetFramework)' == 'net471' ">
<PackageReference Include="PolySharp" Version="1.13.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<None Include="..\icon.png">
<Pack>True</Pack>
Expand Down
4 changes: 1 addition & 3 deletions Analogy.LogViewer.Example/IAnalogy/ExampleAnalogyImages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ namespace Analogy.LogViewer.Example.IAnalogy
{
public class ExampleAnalogyImages : AnalogyImages
{

}
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using Analogy.Interfaces;
using Analogy.Interfaces;
using Analogy.LogViewer.Template;
using System;
using System.Collections.Generic;

namespace Analogy.LogViewer.Example.IAnalogy
{
Expand All @@ -15,10 +15,11 @@ public class ExampleDataProviderFactory : DataProvidersFactory
//add 2 "real time data providers"
new OnlineExampleDataProvider("Online Data Provider 1", new Guid("6642B160-F992-4120-B688-B02DE2E83256")),
new OnlineExampleDataProvider("Online Data Provider 2", new Guid("5AB690DC-545B-4150-B2CD-2534B2ACBF82")),

//add 2 "offline data providers"
new OfflineExampleDataProvider("Offline Data Provider 1", new Guid("2BFC1602-17EF-447D-8DDC-8A00F46C1CE1")),
new OfflineExampleDataProvider("Offline Data Provider 2", new Guid("B22D4BD1-10D7-460B-ADCE-849E73BCA91D")),
new ServerSidePagingProvider(),
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public override string InstalledVersionNumber
{
return _installedVersionNumber;
}

Assembly assembly = Assembly.GetExecutingAssembly();
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
_installedVersionNumber = fvi.FileVersion;
Expand All @@ -33,6 +34,5 @@ public override string InstalledVersionNumber
public override string? LatestVersionNumber { get; set; }
public override TargetFrameworkAttribute CurrentFrameworkAttribute { get; set; } = (TargetFrameworkAttribute)Assembly.GetExecutingAssembly().GetCustomAttribute(typeof(TargetFrameworkAttribute));

Check warning on line 35 in Analogy.LogViewer.Example/IAnalogy/ExampleDownloadInformation.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Converting null literal or possible null value to non-nullable type.

Check warning on line 35 in Analogy.LogViewer.Example/IAnalogy/ExampleDownloadInformation.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference assignment.

Check warning on line 35 in Analogy.LogViewer.Example/IAnalogy/ExampleDownloadInformation.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Converting null literal or possible null value to non-nullable type.

Check warning on line 35 in Analogy.LogViewer.Example/IAnalogy/ExampleDownloadInformation.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference assignment.

Check warning on line 35 in Analogy.LogViewer.Example/IAnalogy/ExampleDownloadInformation.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Converting null literal or possible null value to non-nullable type.

Check warning on line 35 in Analogy.LogViewer.Example/IAnalogy/ExampleDownloadInformation.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Possible null reference assignment.
protected override string RepositoryURL { get; set; } = "https://api.github.com/repos/Analogy-LogViewer/Analogy.LogViewer.Example";

}
}
}
11 changes: 5 additions & 6 deletions Analogy.LogViewer.Example/IAnalogy/ExampleOnDemandPlotting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ namespace Analogy.LogViewer.Example.IAnalogy
{
public class ExampleOnDemandPlotting : IAnalogyOnDemandPlotting
{

public Guid Id { get; } = new Guid("bb38ccb7-8625-4b22-a33c-50a3cbd1e741");
public event EventHandler<(Guid Id, IEnumerable<AnalogyPlottingPointData> PointsData)> OnNewPointsData;

Check warning on line 15 in Analogy.LogViewer.Example/IAnalogy/ExampleOnDemandPlotting.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Non-nullable event 'OnNewPointsData' must contain a non-null value when exiting constructor. Consider declaring the event as nullable.

Check warning on line 15 in Analogy.LogViewer.Example/IAnalogy/ExampleOnDemandPlotting.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Non-nullable event 'OnNewPointsData' must contain a non-null value when exiting constructor. Consider declaring the event as nullable.
private Timer simulateData;

Check warning on line 16 in Analogy.LogViewer.Example/IAnalogy/ExampleOnDemandPlotting.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Non-nullable field 'simulateData' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
int counter;
private int counter;
private IAnalogyOnDemandPlottingInteractor Interactor { get; set; }

Check warning on line 18 in Analogy.LogViewer.Example/IAnalogy/ExampleOnDemandPlotting.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Non-nullable property 'Interactor' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
public Task InitializeOnDemandPlotting(IAnalogyOnDemandPlottingInteractor onDemandPlottingInteractor, ILogger logger)
{
Expand All @@ -28,7 +27,6 @@ public Task InitializeOnDemandPlotting(IAnalogyOnDemandPlottingInteractor onDema
return Task.CompletedTask;
}


private void SimulateData_Tick(object sender, EventArgs e)
{
var now = DateTime.Now;
Expand All @@ -39,8 +37,7 @@ private void SimulateData_Tick(object sender, EventArgs e)

counter++;
}

double GenerateValue(double x) { return Math.Sin(x / 1000.0) * 3 * x + x / 2 + 5; }
private double GenerateValue(double x) { return Math.Sin(x / 1000.0) * 3 * x + x / 2 + 5; }

public void StartPlotting() => simulateData.Enabled = true;

Expand All @@ -50,6 +47,7 @@ public void ShowPlot()
{
Interactor.ShowPlot(Id, "Example", AnalogyOnDemandPlottingStartupType.TabbedWindow);
}

public void ClosePlot()
{
Interactor.ClosePlot(Id);
Expand All @@ -59,6 +57,7 @@ public void RemoveSeriesFromPlot(string seriesName)
{
Interactor.RemoveSeriesFromPlot(Id, seriesName);
}

public void ClearSeriesData(string seriesNameToClear)
{
Interactor.ClearSeriesData(Id, seriesNameToClear);
Expand All @@ -74,4 +73,4 @@ public void HidePlot()
Interactor.ClosePlot(Id);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace Analogy.LogViewer.Example.IAnalogy
{
public class ExampleOnDemandPlottingFactory : IAnalogyOnDemandPlottingFactory
{

public Guid Id { get; set; } = new Guid("4f59de24-aaab-4de0-9269-ef681f8f3ee6");
public string Title { get; set; } = "on Demand Plots Example";
public List<IAnalogyOnDemandPlotting> OnDemandPlottingGenerators { get; set; }
Expand All @@ -26,4 +25,4 @@ public void AddedOnDemandPlottingGenerator(IAnalogyOnDemandPlotting plotGenerato
OnAddedOnDemandPlottingGenerator?.Invoke(this, plotGenerator);
}
}
}
}
8 changes: 5 additions & 3 deletions Analogy.LogViewer.Example/IAnalogy/ExamplePlotting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ExamplePlotting : IAnalogyPlotting
public Guid FactoryId { get; set; } = PrimaryFactory.Id;
public string Title { get; set; } = "Example real time plotting";
private Timer simulateData;
int counter;
private int counter;
public Task InitializePlotting(IAnalogyPlottingInteractor uiInteractor, ILogger logger)
{
simulateData = new Timer();
Expand All @@ -31,6 +31,7 @@ public Task StartPlotting()
simulateData.Enabled = true;
return Task.CompletedTask;
}

public Task StopPlotting()
{
simulateData.Enabled = false;
Expand All @@ -42,6 +43,7 @@ public Task StopPlotting()
yield return ("series1", AnalogyPlottingSeriesType.Line);
yield return ("series2", AnalogyPlottingSeriesType.Line);
}

private void SimulateData_Tick(object sender, EventArgs e)
{
var now = DateTime.Now;
Expand All @@ -51,7 +53,7 @@ private void SimulateData_Tick(object sender, EventArgs e)
OnNewPointData?.Invoke(this, d2);
counter++;
}
double GenerateValue(double x) { return Math.Sin(x / 1000.0) * 3 * x + x / 2 + 5; }

private double GenerateValue(double x) { return Math.Sin(x / 1000.0) * 3 * x + x / 2 + 5; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ public class ExamplePolicyEnforcer : Template.AnalogyPolicyEnforcer
{
public override bool DisableUpdates { get; set; }
}
}
}
17 changes: 10 additions & 7 deletions Analogy.LogViewer.Example/IAnalogy/ExampleUserControl.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System;
using Analogy.Interfaces;
using Analogy.Interfaces.DataTypes;
using Analogy.Interfaces.Factories;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Analogy.Interfaces;
using Analogy.Interfaces.DataTypes;
using Analogy.Interfaces.Factories;
using Microsoft.Extensions.Logging;

namespace Analogy.LogViewer.Example.IAnalogy
{
Expand All @@ -18,8 +18,11 @@ public class ExampleUserControlFactory : IAnalogyCustomUserControlsFactory
public string Title { get; set; } = "User Control Examples";

public IEnumerable<IAnalogyCustomUserControl> UserControls { get; } = new List<IAnalogyCustomUserControl>
{new ExampleUserControl()};
{
new ExampleUserControl(),
};
}

public class ExampleUserControl :IAnalogyCustomUserControl
{
public Task InitializeUserControl(Control hostingControl, ILogger logger)
Expand All @@ -39,4 +42,4 @@ public Task UserControlRemoved()
public string Title { get; set; } = "Example User Control";
public AnalogyToolTip? ToolTip { get; set; }
}
}
}
3 changes: 1 addition & 2 deletions Analogy.LogViewer.Example/IAnalogy/ExampleUserControlUC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ private void btnGeneratorHide_Click(object sender, EventArgs e)
private void btnStopPlotting_Click(object sender, EventArgs e)
{
p.StopPlotting();

}

private void btnShowPlot_Click(object sender, EventArgs e)
{
p.ShowPlot();
}
}
}
}
18 changes: 7 additions & 11 deletions Analogy.LogViewer.Example/IAnalogy/ExampleUserSettingsFactory.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using System;
using Analogy.Interfaces;
using Analogy.Interfaces.DataTypes;
using Analogy.LogViewer.Example.Properties;
using Analogy.LogViewer.Template;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Analogy.Interfaces;
using Analogy.Interfaces.DataTypes;
using Analogy.LogViewer.Example.Properties;
using Analogy.LogViewer.Template;
using Microsoft.Extensions.Logging;

namespace Analogy.LogViewer.Example.IAnalogy
{
Expand All @@ -21,8 +21,6 @@ public class ExampleUserSettingsFactory:TemplateUserSettingsFactory
public override string Title { get; set; } = "Example User Settings";
public override Image? SmallImage { get; set; } = Resources.Analogy_image_16x16;
public override Image? LargeImage { get; set; } = Resources.Analogy_image_32x32;


public override AnalogyToolTip? ToolTip { get; set; } = new AnalogyToolTip("Example tooltip", "some content",
"footer/title", Resources.Analogy_image_16x16, Resources.Analogy_image_32x32);

Expand All @@ -35,7 +33,5 @@ public override Task SaveSettingsAsync()
{
return Task.CompletedTask;
}


}
}
}
Loading

0 comments on commit 90a33ee

Please sign in to comment.