Skip to content

Commit

Permalink
Merge pull request #16 from awaescher/feature/UpdateFluentTransitions
Browse files Browse the repository at this point in the history
Update to FluentTransitions 2.0.1
  • Loading branch information
awaescher authored Apr 29, 2022
2 parents 867b001 + 634b35e commit 6255a10
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 29 deletions.
6 changes: 3 additions & 3 deletions src/FluentDragDrop.Effects/FadeOutEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ public override void Start(IEffect.Arguments arguments)
.With(arguments.PreviewForm, nameof(arguments.PreviewForm.Opacity), 0d)
.Build(new Deceleration(500));

void selfRemovingHandler(object _, Transition.Args __)
void selfRemovingHandler(object _, EventArgs __)
{
transition.TransitionCompletedEvent -= selfRemovingHandler;
transition.TransitionCompleted -= selfRemovingHandler;

arguments.PreviewForm.BeginInvoke((Action)(() => base.ClosePreview(arguments)));
}

transition.TransitionCompletedEvent += selfRemovingHandler;
transition.TransitionCompleted += selfRemovingHandler;

transition.Run();
}
Expand Down
6 changes: 3 additions & 3 deletions src/FluentDragDrop.Effects/FluentDragDrop.Effects.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<Description>FluentDrag&amp;Drop is the sexiest Drag&amp;Drop implemtation for WinForms on this planet.

This package extends FluentDrag&amp;Drop with rich effects. Powered by FluentTransitions.

The app icon was made by Freepik from www.flaticon.com and is licensed by Creative Commons BY 3.0.</Description>
<PackageTags>Fluent;Drag;Drop;Effects;Windows;Forms;WinForms;UI</PackageTags>
<Copyright>Andreas Wäscher 2020</Copyright>
<Copyright>Andreas Wäscher 2022</Copyright>
<PackageIcon>FluentDragDrop.Effects.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
Expand All @@ -20,7 +20,7 @@ The app icon was made by Freepik from www.flaticon.com and is licensed by Creati
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentTransitions" Version="1.0.3" />
<PackageReference Include="FluentTransitions" Version="2.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FluentDragDrop\FluentDragDrop.csproj" />
Expand Down
6 changes: 3 additions & 3 deletions src/FluentDragDrop.Effects/MorphToTargetEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public override void Start(IEffect.Arguments arguments)
.With(arguments.PreviewForm, nameof(arguments.PreviewForm.Opacity), 0d)
.Build(new Deceleration(750));

void selfRemovingHandler(object _, Transition.Args __)
void selfRemovingHandler(object _, EventArgs __)
{
transition.TransitionCompletedEvent -= selfRemovingHandler;
transition.TransitionCompleted -= selfRemovingHandler;

arguments.PreviewForm.BeginInvoke((Action)(() => base.ClosePreview(arguments)));
}

transition.TransitionCompletedEvent += selfRemovingHandler;
transition.TransitionCompleted += selfRemovingHandler;

transition.Run();
}
Expand Down
6 changes: 3 additions & 3 deletions src/FluentDragDrop.Effects/ReturnToStartEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ public override void Start(IEffect.Arguments arguments)
.With(arguments.PreviewForm, nameof(arguments.PreviewForm.Opacity), 0d)
.Build(new Deceleration(500));

void selfRemovingHandler(object _, Transition.Args __)
void selfRemovingHandler(object _, EventArgs __)
{
transition.TransitionCompletedEvent -= selfRemovingHandler;
transition.TransitionCompleted -= selfRemovingHandler;

arguments.PreviewForm.BeginInvoke((Action)(() => base.ClosePreview(arguments)));
}

transition.TransitionCompletedEvent += selfRemovingHandler;
transition.TransitionCompleted += selfRemovingHandler;

transition.Run();
}
Expand Down
4 changes: 2 additions & 2 deletions src/FluentDragDrop/FluentDragDrop.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<Description>Drag&amp;Drop in WinForms is cumbersome and error-prone. There are multiple events to handle, members to track and properties to set on at least two controls.
Passing data is kind of special and you don't get preview images while dragging things aroud.
Expand All @@ -10,7 +10,7 @@ This package brings rich Drag&amp;Drop experience to your app, just by adding a

The app icon was made by Freepik from www.flaticon.com and is licensed by Creative Commons BY 3.0.</Description>
<PackageTags>Fluent;Drag;Drop;Windows;Forms;WinForms;UI</PackageTags>
<Copyright>Andreas Wäscher 2020</Copyright>
<Copyright>Andreas Wäscher 2022</Copyright>
<PackageIcon>FluentDragDrop.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
Expand Down
34 changes: 20 additions & 14 deletions src/FluentDragDrop/Preview/OverlayForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,25 @@ private void OnGetMinMaxInfo(ref Message m)
m.Result = IntPtr.Zero;
}
}
}

internal struct MINMAXINFO
{
public POINT ptReserved;
public POINT ptMaxSize;
public POINT ptMaxPosition;
public POINT ptMinTrackSize;
public POINT ptMaxTrackSize;
}
#pragma warning disable S101 // Types should be named in PascalCase
#pragma warning disable 0649 // Field is never assigned to, and will always have its default value

internal struct POINT
{
public int X;
public int Y;
}
internal struct MINMAXINFO
{
public POINT ptReserved;
public POINT ptMaxSize;
public POINT ptMaxPosition;
public POINT ptMinTrackSize;
public POINT ptMaxTrackSize;
}

internal struct POINT
{
public int X;
public int Y;
}
#pragma warning restore 0649 // Field is never assigned to, and will always have its default value
#pragma warning restore S101 // Types should be named in PascalCase

}
2 changes: 1 addition & 1 deletion src/FluentDragDropExample/FluentDragDropExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ItemGroup>
<ProjectReference Include="..\FluentDragDrop.Effects\FluentDragDrop.Effects.csproj" />
<ProjectReference Include="..\FluentDragDrop\FluentDragDrop.csproj" />
<PackageReference Include="FluentTransitions" Version="1.0.3" />
<PackageReference Include="FluentTransitions" Version="2.0.1" />
<PackageReference Include="MarkdownSnippets.MsBuild" Version="21.0.7" />
</ItemGroup>

Expand Down

0 comments on commit 6255a10

Please sign in to comment.