Skip to content
Open
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
5 changes: 1 addition & 4 deletions src/Shapeshifter.Tests/Shapeshifter.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@
<HintPath>..\packages\Autofac.4.8.1\lib\net45\Autofac.dll</HintPath>
</Reference>
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.4.2.1\lib\net45\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="FluffySpoon.Http, Version=1.0.21.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FluffySpoon.Http.1.0.21\lib\netstandard2.0\FluffySpoon.Http.dll</HintPath>
<HintPath>..\packages\Castle.Core.4.3.0\lib\net45\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
Expand Down
3 changes: 1 addition & 2 deletions src/Shapeshifter.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Autofac" version="4.8.1" targetFramework="net471" />
<package id="Castle.Core" version="4.2.1" targetFramework="net471" />
<package id="FluffySpoon.Http" version="1.0.21" targetFramework="net471" />
<package id="Castle.Core" version="4.3.0" targetFramework="net471" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net471" />
<package id="NSubstitute" version="3.1.0" targetFramework="net471" />
<package id="Octokit" version="0.29.0" targetFramework="net471" />
Expand Down
1 change: 0 additions & 1 deletion src/Shapeshifter.Website/Shapeshifter.Website.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

<ItemGroup>
<PackageReference Include="FluffySpoon.Extensions.MicrosoftDependencyInjection" Version="1.0.5" />
<PackageReference Include="FluffySpoon.Http" Version="1.0.21" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
using Data;
using Data.Interfaces;

using Services.Interfaces;

class DesignerClipboardTextDataFacade
class DesignerClipboardTextDataFacade
: ClipboardTextData,
IClipboardTextData
{
public DesignerClipboardTextDataFacade(
IDesignerImageConverterService designerImageConverterService)
)
:
base()
{
Expand Down
6 changes: 6 additions & 0 deletions src/Shapeshifter.WindowsDesktop/Data/ClipboardCustomData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

namespace Shapeshifter.WindowsDesktop.Data
{
using System;

class ClipboardCustomData : IClipboardCustomData
{
public byte[] RawData { get; set; }

public IClipboardFormat RawFormat { get; set; }
public IClipboardDataPackage Package { get; set; }

public string ContentHash => Guid
.NewGuid()
.ToString();
}
}
36 changes: 28 additions & 8 deletions src/Shapeshifter.WindowsDesktop/Data/ClipboardDataPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ public class ClipboardDataPackage : IClipboardDataPackage
readonly List<IClipboardData> dataCollection;
readonly List<IAction> actions;

public IReadOnlyList<IClipboardData> Contents =>
dataCollection;

public IReadOnlyList<IAction> Actions => actions;

public Guid Id { get; set; }

public IDataSource Source { get; set; }

public string ContentHash { get; private set; }

public ClipboardDataPackage()
{
dataCollection = new List<IClipboardData>();
Expand All @@ -28,15 +39,23 @@ public ClipboardDataPackage(
Id = id;
}

public IReadOnlyList<IClipboardData> Contents =>
dataCollection;

public IReadOnlyList<IAction> Actions => actions;

public void AddData(IClipboardData data)
{
data.Package = this;
dataCollection.Add(data);

RecomputeHash();
}

void RecomputeHash()
{
var hash = string.Empty;
foreach (var data in dataCollection)
{
hash += data.ContentHash + "/" + data.RawFormat + "/" + data.RawData.Length + "\n";
}

ContentHash = hash;
}

public async void PopulateCompatibleActionsAsync(IEnumerable<IAction> actionCandidates)
Expand All @@ -50,8 +69,9 @@ public async void PopulateCompatibleActionsAsync(IEnumerable<IAction> actionCand
}
}

public Guid Id { get; set; }

public IDataSource Source { get; set; }
public override int GetHashCode()
{
return ContentHash.GetHashCode();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,19 @@ public class ClipboardFileCollectionData: IClipboardFileCollectionData

public IClipboardFormat RawFormat { get; set; }
public IClipboardDataPackage Package { get; set; }

public string ContentHash
{
get
{
var hash = string.Empty;
foreach (var file in Files)
{
hash += file.FullPath + "/" + file.FileIcon.Length;
}

return hash;
}
}
}
}
2 changes: 2 additions & 0 deletions src/Shapeshifter.WindowsDesktop/Data/ClipboardFileData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ public class ClipboardFileData: IClipboardFileData

public IClipboardFormat RawFormat { get; set; }
public IClipboardDataPackage Package { get; set; }

public string ContentHash => FullPath + "/" + FileIcon.Length;
}
}
4 changes: 4 additions & 0 deletions src/Shapeshifter.WindowsDesktop/Data/ClipboardImageData.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
namespace Shapeshifter.WindowsDesktop.Data
{
using System;

using Interfaces;

public class ClipboardImageData : IClipboardImageData
Expand All @@ -10,5 +12,7 @@ public class ClipboardImageData : IClipboardImageData

public IClipboardFormat RawFormat { get; set; }
public IClipboardDataPackage Package { get; set; }

public string ContentHash => Guid.NewGuid().ToString();
}
}
2 changes: 2 additions & 0 deletions src/Shapeshifter.WindowsDesktop/Data/ClipboardTextData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ public class ClipboardTextData : IClipboardTextData

public IClipboardFormat RawFormat { get; set; }
public IClipboardDataPackage Package { get; set; }

public string ContentHash => Text + "/" + RawData.Length;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ public interface IClipboardData

IClipboardFormat RawFormat { get; }
IClipboardDataPackage Package { get; set; }
}

string ContentHash { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public interface IClipboardDataPackage

IDataSource Source { get; }

string ContentHash { get; }

void PopulateCompatibleActionsAsync(IEnumerable<IAction> actionCandidates);
}
}
17 changes: 6 additions & 11 deletions src/Shapeshifter.WindowsDesktop/Shapeshifter.WindowsDesktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,13 @@
<HintPath>..\packages\AutofacSerilogIntegration.2.0.0\lib\net45\AutofacSerilogIntegration.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Costura, Version=2.0.1.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.2.0.1\lib\net452\Costura.dll</HintPath>
<Private>True</Private>
<Reference Include="Costura, Version=3.0.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.3.0.0\lib\net46\Costura.dll</HintPath>
</Reference>
<Reference Include="EasyHook, Version=2.7.6684.0, Culture=neutral, PublicKeyToken=4b580fca19d0b0c5, processorArchitecture=MSIL">
<HintPath>..\packages\EasyHook.2.7.6684\lib\net40\EasyHook.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluffySpoon.Http, Version=1.0.21.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FluffySpoon.Http.1.0.21\lib\netstandard2.0\FluffySpoon.Http.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.8.4.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<HintPath>..\packages\HtmlAgilityPack.1.8.4\lib\Net45\HtmlAgilityPack.dll</HintPath>
<Private>True</Private>
Expand Down Expand Up @@ -762,13 +757,13 @@
<Resource Include="Resources\Icon\Tray.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.3.0.3\build\Fody.targets" Condition="Exists('..\packages\Fody.3.0.3\build\Fody.targets')" />
<Import Project="..\packages\Fody.3.0.4\build\Fody.targets" Condition="Exists('..\packages\Fody.3.0.4\build\Fody.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\Fody.3.0.3\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.0.3\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.2.0.1\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.2.0.1\build\Costura.Fody.targets'))" />
<Error Condition="!Exists('..\packages\Fody.3.0.4\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.0.4\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.3.0.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.0.0\build\Costura.Fody.targets'))" />
</Target>
<Import Project="..\packages\Costura.Fody.2.0.1\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.2.0.1\build\Costura.Fody.targets')" />
<Import Project="..\packages\Costura.Fody.3.0.0\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.3.0.0\build\Costura.Fody.targets')" />
</Project>
5 changes: 2 additions & 3 deletions src/Shapeshifter.WindowsDesktop/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
<packages>
<package id="Autofac" version="4.8.1" targetFramework="net471" />
<package id="AutofacSerilogIntegration" version="2.0.0" targetFramework="net471" />
<package id="Costura.Fody" version="2.0.1" targetFramework="net471" developmentDependency="true" />
<package id="Costura.Fody" version="3.0.0" targetFramework="net471" developmentDependency="true" />
<package id="EasyHook" version="2.7.6684" targetFramework="net471" />
<package id="FluffySpoon.Http" version="1.0.21" targetFramework="net471" />
<package id="Fody" version="3.0.3" targetFramework="net471" developmentDependency="true" />
<package id="Fody" version="3.0.4" targetFramework="net471" developmentDependency="true" />
<package id="HtmlAgilityPack" version="1.8.4" targetFramework="net471" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net471" />
<package id="Octokit" version="0.29.0" targetFramework="net471" />
Expand Down
1 change: 1 addition & 0 deletions src/Shapeshifter.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=LoopCanBePartlyConvertedToQuery/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBeMadeStatic_002ELocal/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBePrivate_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=NonReadonlyMemberInGetHashCode/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=NotAccessedField_002ELocal/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ParameterHidesMember/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PossibleNullReferenceException/@EntryIndexedValue">DO_NOT_SHOW</s:String>
Expand Down