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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ node_modules/

*.pfx
AppPackages/
BundleArtifacts/
BundleArtifacts/

*.assets.cache
87 changes: 6 additions & 81 deletions PasteEx.Deploy/PasteEx.Deploy.csproj
Original file line number Diff line number Diff line change
@@ -1,88 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E351ACDD-645A-47F1-BD2A-51D3EE4E2124}</ProjectGuid>
<TargetFramework>net8.0-windows</TargetFramework>
<OutputType>Exe</OutputType>
<RootNamespace>PasteEx.Deploy</RootNamespace>
<AssemblyName>PasteEx.Deploy</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</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|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<UseWindowsForms>true</UseWindowsForms>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FormMian.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormMian.Designer.cs">
<DependentUpon>FormMian.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FormMian.resx">
<DependentUpon>FormMian.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="latest.json" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
36 changes: 0 additions & 36 deletions PasteEx.Deploy/Properties/AssemblyInfo.cs

This file was deleted.

7 changes: 3 additions & 4 deletions PasteEx/Core/History/PasteResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using PasteEx.Util;
using System;
using System.Diagnostics;
using System.Web.Script.Serialization;
using System.Text.Json.Serialization;

namespace PasteEx.Core.History
{
Expand All @@ -17,14 +17,13 @@ public class PasteResult

public string[] UserHistoryExts { get; set; }

[ScriptIgnore]
[JsonIgnore]
public string Key
{
get
{
string str = string.Format("[{0}]-[{1}]-[{2}]", CopySourceName, string.Join(",", ClipboardFormats), string.Join(",", AnalyzeResultExts));
byte[] b = ObjectHelper.SerializeObject(str);
return ObjectHelper.ComputeMD5(b);
return ObjectHelper.ComputeMD5(str);
}
}

Expand Down
7 changes: 4 additions & 3 deletions PasteEx/Core/History/PasteResultHistory.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Web.Script.Serialization;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace PasteEx.Core.History
{
Expand All @@ -14,12 +15,12 @@ public PasteResultHistory()

public string ToJSONString()
{
return new JavaScriptSerializer().Serialize(this);
return JsonSerializer.Serialize(this);
}

public static PasteResultHistory Parse(string str)
{
return new JavaScriptSerializer().Deserialize<PasteResultHistory>(str);
return JsonSerializer.Deserialize<PasteResultHistory>(str);
}

public PasteResult Find(PasteResult res)
Expand Down
5 changes: 2 additions & 3 deletions PasteEx/Forms/FormSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using System.Text.Json;
using System.Windows.Forms;
using PasteEx.Properties;

Expand Down Expand Up @@ -311,8 +311,7 @@ private async void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
JavaScriptSerializer serializer = new JavaScriptSerializer();
AppInfo appInfo = serializer.Deserialize<AppInfo>(json);
AppInfo appInfo = JsonSerializer.Deserialize<AppInfo>(json);
string latestVersion = appInfo.Version;
string currentVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

Expand Down
2 changes: 1 addition & 1 deletion PasteEx/Forms/Hotkey/HotkeyTextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public HotkeyTextBox()
{
hotkey = new Hotkey();

ContextMenu = new ContextMenu(); // Disable right-clicking
ContextMenuStrip = new ContextMenuStrip(); // Disable right-clicking
GotFocus += delegate { User32.HideCaret(Handle); };
}

Expand Down
Loading