Move libraries to .NET Standard, allowing Xamarin.macOS GUI to compile.

This commit is contained in:
2018-08-27 22:03:20 +01:00
parent d2da31eeab
commit cb138490bc
24 changed files with 153 additions and 49 deletions

View File

@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<RootNamespace>DiscImageChef.Gui</RootNamespace>
<AssemblyName>DiscImageChef.Gui</AssemblyName>
<ReleaseVersion>$(Version)</ReleaseVersion>
@@ -11,6 +10,7 @@
<Product>The Disc Image Chef</Product>
<Title>The Disc Image Chef</Title>
<ApplicationVersion>$(Version)</ApplicationVersion>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<NrtRevisionFormat>$(Version)-{chash:8} built by {mname} in $(Configuration){!:, modified}</NrtRevisionFormat>
@@ -18,11 +18,11 @@
<NrtShowRevision>true</NrtShowRevision>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Eto.Forms" Version="2.4.1"/>
<PackageReference Include="Eto.Serialization.Xaml" Version="2.4.1"/>
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.2.2-beta"/>
<PackageReference Include="Eto.Forms" Version="2.4.1" />
<PackageReference Include="Eto.Serialization.Xaml" Version="2.4.1" />
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.2.2-beta" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DiscImageChef.Devices\DiscImageChef.Devices.csproj"/>
<ProjectReference Include="..\DiscImageChef.Devices\DiscImageChef.Devices.csproj" />
</ItemGroup>
</Project>

View File

@@ -126,22 +126,29 @@ namespace DiscImageChef.Gui
void RefreshDevices()
{
DicConsole.WriteLine("Refreshing devices");
devicesRoot.Children.Clear();
foreach(DeviceInfo device in Device.ListDevices().Where(d => d.Supported).OrderBy(d => d.Vendor)
.ThenBy(d => d.Model))
try
{
DicConsole.DebugWriteLine("Main window",
"Found support device model {0} by manufacturer {1} on bus {2} and path {3}",
device.Model, device.Vendor, device.Bus, device.Path);
devicesRoot.Children.Add(new TreeGridItem
{
Values = new object[] {$"{device.Vendor} {device.Model} ({device.Bus})", device.Path}
});
}
DicConsole.WriteLine("Refreshing devices");
devicesRoot.Children.Clear();
treeImages.ReloadData();
foreach (DeviceInfo device in Device.ListDevices().Where(d => d.Supported).OrderBy(d => d.Vendor)
.ThenBy(d => d.Model))
{
DicConsole.DebugWriteLine("Main window",
"Found support device model {0} by manufacturer {1} on bus {2} and path {3}",
device.Model, device.Vendor, device.Bus, device.Path);
devicesRoot.Children.Add(new TreeGridItem
{
Values = new object[] {$"{device.Vendor} {device.Model} ({device.Bus})", device.Path}
});
}
treeImages.ReloadData();
}
catch (InvalidOperationException ex)
{
DicConsole.ErrorWriteLine(ex.Message);
}
}
protected void OnMenuConsole(object sender, EventArgs e)