Skip to content

Commit

Permalink
Switch demo project to .NET Core SDK
Browse files Browse the repository at this point in the history
Update build script
Add reference assemblies for .NET 3.5
  • Loading branch information
thomaslevesque committed Jan 4, 2020
1 parent fefbcb1 commit 2ef1b39
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 126 deletions.
23 changes: 23 additions & 0 deletions WpfAnimatedGif.Demo/InputBox.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Window x:Class="WpfAnimatedGif.Demo.InputBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfAnimatedGif.Demo"
mc:Ignorable="d"
SizeToContent="Height"
Title="InputBox" Height="100" Width="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" x:Name="prompt" Margin="5,3" TextWrapping="Wrap" />
<TextBox Grid.Row="1" x:Name="input" Margin="5,3"/>
<StackPanel Grid.Row="2" HorizontalAlignment="Right" Orientation="Horizontal">
<Button Content="OK" Click="OKButton_Click" IsDefault="True" Margin="5,3" />
<Button Content="Cancel" Click="CancelButton_Click" IsCancel="True" Margin="5,3" />
</StackPanel>
</Grid>
</Window>
48 changes: 48 additions & 0 deletions WpfAnimatedGif.Demo/InputBox.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfAnimatedGif.Demo
{
/// <summary>
/// Interaction logic for InputBox.xaml
/// </summary>
public partial class InputBox : Window
{
public InputBox()
{
InitializeComponent();
}

private void OKButton_Click(object sender, RoutedEventArgs e)
{
DialogResult = true;
}

private void CancelButton_Click(object sender, RoutedEventArgs e)
{
DialogResult = false;
}

public static string Show(string prompt, string title)
{
var w = new InputBox();
w.Title = title;
w.prompt.Text = prompt;
if (w.ShowDialog() is true)
{
return w.input.Text;
}

return null;
}
}
}
3 changes: 1 addition & 2 deletions WpfAnimatedGif.Demo/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Windows;
using System.Windows.Media.Animation;
using System.Windows.Threading;
using Microsoft.VisualBasic;
using Microsoft.Win32;

namespace WpfAnimatedGif.Demo
Expand Down Expand Up @@ -245,7 +244,7 @@ private void SetPlayPauseEnabled(bool isPaused)

private void btnOpenUrl_Click(object sender, RoutedEventArgs e)
{
string url = Interaction.InputBox("Enter the URL of the image to load", "Enter URL");
string url = InputBox.Show("Enter the URL of the image to load", "Enter URL");
if (!string.IsNullOrEmpty(url))
{
Images.Add(url);
Expand Down
128 changes: 13 additions & 115 deletions WpfAnimatedGif.Demo/WpfAnimatedGif.Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,127 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F15F23F1-D349-426E-8A05-AEEF1A663599}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WpfAnimatedGif.Demo</RootNamespace>
<AssemblyName>WpfAnimatedGif.Demo</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<TargetFramework>netcoreapp3.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWPF>true</UseWPF>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<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|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Presentation" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="TestRelativeUri.xaml.cs">
<DependentUpon>TestRelativeUri.xaml</DependentUpon>
</Compile>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="TestRelativeUri.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\working.gif" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WpfAnimatedGif\WpfAnimatedGif.csproj">
<Project>{D129789C-3096-4D0B-8DD7-FE24A4DF4B21}</Project>
<Name>WpfAnimatedGif</Name>
</ProjectReference>
<ProjectReference Include="..\WpfAnimatedGif\WpfAnimatedGif.csproj" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\bomb.gif" />
<Content Include="Images\siteoforigin.gif" CopyToOutputDirectory="PreserveNewest" />
<Resource Include="Images\bomb-once.gif" />
<Resource Include="Images\Bomb.gif" />
<Resource Include="Images\earth.gif" />
<Resource Include="Images\radar.gif" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\monster.gif" />
<Resource Include="Images\nonanimated.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\bomb-once.gif" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\play.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\pause.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\partialfirstframe.gif" />
<Resource Include="Images\monster.gif" />
<Content Include="Images\siteoforigin.gif">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Resource Include="Images\pause.png" />
<Resource Include="Images\play.png" />
<Resource Include="Images\radar.gif" />
<Resource Include="Images\working.gif" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
16 changes: 8 additions & 8 deletions WpfAnimatedGif.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2035
# Visual Studio Version 16
VisualStudioVersion = 16.0.29609.76
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfAnimatedGif", "WpfAnimatedGif\WpfAnimatedGif.csproj", "{D129789C-3096-4D0B-8DD7-FE24A4DF4B21}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfAnimatedGif", "WpfAnimatedGif\WpfAnimatedGif.csproj", "{D129789C-3096-4D0B-8DD7-FE24A4DF4B21}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfAnimatedGif.Demo", "WpfAnimatedGif.Demo\WpfAnimatedGif.Demo.csproj", "{F15F23F1-D349-426E-8A05-AEEF1A663599}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfAnimatedGif.Demo", "WpfAnimatedGif.Demo\WpfAnimatedGif.Demo.csproj", "{F15F23F1-D349-426E-8A05-AEEF1A663599}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0E0CF096-6B3E-4338-9DC7-7A52EE4D4648}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -22,10 +22,10 @@ Global
{D129789C-3096-4D0B-8DD7-FE24A4DF4B21}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{D129789C-3096-4D0B-8DD7-FE24A4DF4B21}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{D129789C-3096-4D0B-8DD7-FE24A4DF4B21}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{F15F23F1-D349-426E-8A05-AEEF1A663599}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{F15F23F1-D349-426E-8A05-AEEF1A663599}.Debug|Mixed Platforms.Build.0 = Debug|x86
{F15F23F1-D349-426E-8A05-AEEF1A663599}.Release|Mixed Platforms.ActiveCfg = Release|x86
{F15F23F1-D349-426E-8A05-AEEF1A663599}.Release|Mixed Platforms.Build.0 = Release|x86
{F15F23F1-D349-426E-8A05-AEEF1A663599}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{F15F23F1-D349-426E-8A05-AEEF1A663599}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{F15F23F1-D349-426E-8A05-AEEF1A663599}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{F15F23F1-D349-426E-8A05-AEEF1A663599}.Release|Mixed Platforms.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 6 additions & 0 deletions WpfAnimatedGif/WpfAnimatedGif.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="jnm2.ReferenceAssemblies.net35" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
3 changes: 2 additions & 1 deletion build.bat
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
msbuild WpfAnimatedGif.sln /t:Clean /t:Rebuild /property:Configuration=Release
@echo off
dotnet build -c Release

0 comments on commit 2ef1b39

Please sign in to comment.