Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use multiple target frameworks for Eto.Forms #2439

Merged
merged 6 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Eto/Eto.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<LangVersion>10</LangVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors Condition="$(Configuration) == 'Release'">true</TreatWarningsAsErrors>
Expand Down
2 changes: 1 addition & 1 deletion src/Eto/Forms/Binding/ICommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !NETSTANDARD
#if !NETSTANDARD && !NETCOREAPP
using System;

namespace System.Windows.Input
Expand Down
4 changes: 4 additions & 0 deletions src/Eto/Forms/Clipboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,11 @@ public void SetObject(object value, string type)
{
using (var ms = new MemoryStream())
{
#pragma warning disable SYSLIB0011
var binaryFormatter = new BinaryFormatter();
binaryFormatter.Serialize(ms, value);
SetDataStream(ms, type);
#pragma warning restore SYSLIB0011
return;
}
}
Expand Down Expand Up @@ -273,8 +275,10 @@ public object GetObject(string type)
return null;
try
{
#pragma warning disable SYSLIB0011
var binaryFormatter = new BinaryFormatter();
return binaryFormatter.Deserialize(stream);
#pragma warning restore SYSLIB0011
}
catch (Exception ex)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Eto/Forms/Controls/Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Eto.Forms;
/// All visual user interface elements should inherit from this class to provide common functionality like binding,
/// load/unload, and common events.
/// </remarks>
#if !NETSTANDARD
#if !NETSTANDARD && !NETCOREAPP
[ToolboxItem(true)]
[DesignTimeVisible(true)]
[DesignerCategory("Eto.Forms")]
Expand Down
4 changes: 4 additions & 0 deletions src/Eto/Forms/DataObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,11 @@ public void SetObject(object value, string type)
{
using (var ms = new MemoryStream())
{
#pragma warning disable SYSLIB0011
var binaryFormatter = new BinaryFormatter();
binaryFormatter.Serialize(ms, value);
SetDataStream(ms, type);
#pragma warning restore SYSLIB0011
return;
}
}
Expand Down Expand Up @@ -329,8 +331,10 @@ public object GetObject(string type)
return null;
try
{
#pragma warning disable SYSLIB0011
var binaryFormatter = new BinaryFormatter();
return binaryFormatter.Deserialize(stream);
#pragma warning restore SYSLIB0011
}
catch (Exception ex)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Eto/PclTypes.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NETSTANDARD
#if NETSTANDARD || NETCOREAPP
using System;
using System.Collections.Generic;
using System.Globalization;
Expand Down