Merge pull request #4 from tomlm/master

port to dotnet core and update packages to latest.
This commit is contained in:
Javier Suárez 2020-08-25 11:25:18 +02:00 коммит произвёл GitHub
Родитель 45a8c2c7fb 935fe1b00d
Коммит 6f8d9ba466
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 64 добавлений и 215 удалений

Просмотреть файл

@ -1,100 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{001DDB75-EEBF-4CBF-A5E8-BB8631829D9D}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Terminal.Gui.Forms.Sample</RootNamespace>
<AssemblyName>Terminal.Gui.Forms.Sample</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="NStack, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NStack.Core.0.12.0\lib\netstandard1.5\NStack.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Terminal.Gui, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Terminal.Gui.0.16.0\lib\net461\Terminal.Gui.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.3.1.0.697729\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.3.1.0.697729\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.3.1.0.697729\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="App.cs" />
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="MainPageCS.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Terminal.Gui.Forms\Terminal.Gui.Forms.csproj">
<Project>{a0fe3efe-9610-4470-ba8a-218fab3680a1}</Project>
<Name>Terminal.Gui.Forms</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="MainPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
<TargetFramework>netcoreapp3.1</TargetFramework>
<OutputType>Exe</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.props'))" />
<Error Condition="!Exists('..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.targets'))" />
</Target>
<Import Project="..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.targets')" />
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Compile Update="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Terminal.Gui.Forms\Terminal.Gui.Forms.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Terminal.Gui" Version="0.16.0" />
<PackageReference Include="Xamarin.Forms" Version="4.6.0.847" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /></startup></configuration>

Просмотреть файл

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NStack.Core" version="0.12.0" targetFramework="net471" />
<package id="NStack.Core" version="0.14.0" targetFramework="net461" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net471" />
<package id="Terminal.Gui" version="0.16.0" targetFramework="net471" />
<package id="Xamarin.Forms" version="3.1.0.697729" targetFramework="net471" />
<package id="Xamarin.Forms" version="4.6.0.847" targetFramework="net461" />
</packages>

Просмотреть файл

@ -1,6 +1,10 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Net.Http;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Xamarin.Forms;
@ -14,6 +18,8 @@ namespace Terminal.Gui.Forms
public string RuntimePlatform => "Gui";
public OSAppTheme RequestedTheme => OSAppTheme.Unspecified;
public void BeginInvokeOnMainThread(Action action)
{
Task.Run(action);
@ -26,7 +32,9 @@ namespace Terminal.Gui.Forms
public string GetMD5Hash(string input)
{
throw new NotImplementedException();
var bytes = Encoding.UTF8.GetBytes(input);
var hash = MD5.Create().ComputeHash(bytes);
return Convert.ToBase64String(hash);
}
public double GetNamedSize(NamedSize size, Type targetElementType, bool useOldSizes)
@ -49,7 +57,7 @@ namespace Terminal.Gui.Forms
public Task<Stream> GetStreamAsync(Uri uri, CancellationToken cancellationToken)
{
throw new NotImplementedException();
return new HttpClient().GetStreamAsync(uri.ToString());
}
public IIsolatedStorageFile GetUserStoreForApplication()
@ -59,13 +67,13 @@ namespace Terminal.Gui.Forms
public void OpenUriAction(Uri uri)
{
throw new NotImplementedException();
Process.Start(uri.ToString());
}
public void StartTimer(TimeSpan interval, Func<bool> callback)
{
Timer timer = null;
timer = new Timer((_ =>
timer = new Timer((_ =>
{
if (!callback())
{
@ -95,7 +103,8 @@ namespace Terminal.Gui.Forms
return;
var interval = TimeSpan.FromSeconds(1.0);
timer = new Timer((_ => {
timer = new Timer((_ =>
{
this.SendSignals();
}), null, (int)interval.TotalMilliseconds, (int)interval.TotalMilliseconds);
}
@ -104,5 +113,16 @@ namespace Terminal.Gui.Forms
public void QuitApplication()
{
}
public Xamarin.Forms.Color GetNamedColor(String name)
{
Enum.TryParse<Xamarin.Forms.Color>(name, out var color);
return color;
}
public SizeRequest GetNativeSize(VisualElement view, Double widthConstraint, Double heightConstraint)
{
return new SizeRequest();
}
}
}

Просмотреть файл

@ -1,111 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A0FE3EFE-9610-4470-BA8A-218FAB3680A1}</ProjectGuid>
<TargetFramework>netcoreapp3.1</TargetFramework>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Terminal.Gui.Forms</RootNamespace>
<AssemblyName>Terminal.Gui.Forms</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>1701;1702</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<Reference Include="NStack, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NStack.Core.0.12.0\lib\netstandard1.5\NStack.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Terminal.Gui, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Terminal.Gui.0.16.0\lib\net461\Terminal.Gui.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.3.1.0.697729\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.3.1.0.697729\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.3.1.0.697729\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Terminal.Gui" Version="0.16.0" />
<PackageReference Include="Xamarin.Forms" Version="4.6.0.847" />
</ItemGroup>
<ItemGroup>
<Compile Include="Controls\FormsPanel.cs" />
<Compile Include="EventArgs\VisualElementChangedEventArgs.cs" />
<Compile Include="EventTracker.cs" />
<Compile Include="Exports.cs" />
<Compile Include="Extensions\ColorExtensions.cs" />
<Compile Include="Extensions\VisualElementExtensions.cs" />
<Compile Include="Forms.cs" />
<Compile Include="FormsWindow.cs" />
<Compile Include="GuiDeviceInfo.cs" />
<Compile Include="GuiPlatformServices.cs" />
<Compile Include="Helpers\AttributeHelper.cs" />
<Compile Include="Platform.cs" />
<Compile Include="PlatformRenderer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RendererPool.cs" />
<Compile Include="Renderers\ButtonRenderer.cs" />
<Compile Include="Renderers\DefaultViewRenderer.cs" />
<Compile Include="Renderers\EditorRenderer.cs" />
<Compile Include="Renderers\EntryRenderer.cs" />
<Compile Include="Renderers\FrameRenderer.cs" />
<Compile Include="Renderers\LabelRenderer.cs" />
<Compile Include="Renderers\LayoutRenderer.cs" />
<Compile Include="Renderers\ListViewRenderer.cs" />
<Compile Include="Renderers\PageRenderer.cs" />
<Compile Include="Renderers\ProgressBarRenderer.cs" />
<Compile Include="Renderers\ScrollViewRenderer.cs" />
<Compile Include="Renderers\SwitchRenderer.cs" />
<Compile Include="Renderers\ViewRenderer.cs" />
<Compile Include="Renderers\VisualPageRenderer.cs" />
<Compile Include="ResourcesProvider.cs" />
<Compile Include="VisualElementTracker.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.props'))" />
<Error Condition="!Exists('..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.targets'))" />
</Target>
<Import Project="..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.3.1.0.697729\build\netstandard2.0\Xamarin.Forms.targets')" />
</Project>

Просмотреть файл

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NStack.Core" version="0.12.0" targetFramework="net471" />
<package id="NStack.Core" version="0.14.0" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net471" />
<package id="Terminal.Gui" version="0.16.0" targetFramework="net471" />
<package id="Xamarin.Forms" version="3.1.0.697729" targetFramework="net471" />
<package id="Xamarin.Forms" version="4.6.0.847" targetFramework="net472" />
</packages>