mirror of
https://ghfast.top/https://github.com/zsjy/AdbTools.git
synced 2025-03-15 19:09:41 +08:00
Compare commits
No commits in common. "master" and "1.0.0" have entirely different histories.
2
.gitignore
vendored
2
.gitignore
vendored
@ -33,8 +33,6 @@ bld/
|
|||||||
[Ll]og/
|
[Ll]og/
|
||||||
[Ll]ogs/
|
[Ll]ogs/
|
||||||
|
|
||||||
Autosave/
|
|
||||||
|
|
||||||
# Visual Studio 2015/2017 cache/options directory
|
# Visual Studio 2015/2017 cache/options directory
|
||||||
.vs/
|
.vs/
|
||||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||||
|
26
AdbTools.sln
26
AdbTools.sln
@ -5,42 +5,16 @@ VisualStudioVersion = 16.0.34407.143
|
|||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdbTools", "AdbTools\AdbTools.csproj", "{D80557CC-6756-4A53-BE06-2A0B21224607}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdbTools", "AdbTools\AdbTools.csproj", "{D80557CC-6756-4A53-BE06-2A0B21224607}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "AdbToolsSetup", "AdbToolsSetup\AdbToolsSetup.vdproj", "{22559873-B825-4CCF-816B-F0C0BC1FBA06}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Update", "Update\Update.csproj", "{F22C4131-D4CC-426E-8FC4-5C2E60C6B0CE}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Debug|x64 = Debug|x64
|
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
Release|x64 = Release|x64
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{D80557CC-6756-4A53-BE06-2A0B21224607}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{D80557CC-6756-4A53-BE06-2A0B21224607}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{D80557CC-6756-4A53-BE06-2A0B21224607}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{D80557CC-6756-4A53-BE06-2A0B21224607}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{D80557CC-6756-4A53-BE06-2A0B21224607}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{D80557CC-6756-4A53-BE06-2A0B21224607}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{D80557CC-6756-4A53-BE06-2A0B21224607}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{D80557CC-6756-4A53-BE06-2A0B21224607}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{D80557CC-6756-4A53-BE06-2A0B21224607}.Release|Any CPU.Build.0 = Release|Any CPU
|
{D80557CC-6756-4A53-BE06-2A0B21224607}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{D80557CC-6756-4A53-BE06-2A0B21224607}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{D80557CC-6756-4A53-BE06-2A0B21224607}.Release|x64.Build.0 = Release|x64
|
|
||||||
{22559873-B825-4CCF-816B-F0C0BC1FBA06}.Debug|Any CPU.ActiveCfg = Debug
|
|
||||||
{22559873-B825-4CCF-816B-F0C0BC1FBA06}.Debug|Any CPU.Build.0 = Debug
|
|
||||||
{22559873-B825-4CCF-816B-F0C0BC1FBA06}.Debug|x64.ActiveCfg = Debug
|
|
||||||
{22559873-B825-4CCF-816B-F0C0BC1FBA06}.Debug|x64.Build.0 = Debug
|
|
||||||
{22559873-B825-4CCF-816B-F0C0BC1FBA06}.Release|Any CPU.ActiveCfg = Release
|
|
||||||
{22559873-B825-4CCF-816B-F0C0BC1FBA06}.Release|Any CPU.Build.0 = Release
|
|
||||||
{22559873-B825-4CCF-816B-F0C0BC1FBA06}.Release|x64.ActiveCfg = Release
|
|
||||||
{22559873-B825-4CCF-816B-F0C0BC1FBA06}.Release|x64.Build.0 = Release
|
|
||||||
{F22C4131-D4CC-426E-8FC4-5C2E60C6B0CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{F22C4131-D4CC-426E-8FC4-5C2E60C6B0CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{F22C4131-D4CC-426E-8FC4-5C2E60C6B0CE}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{F22C4131-D4CC-426E-8FC4-5C2E60C6B0CE}.Debug|x64.Build.0 = Debug|Any CPU
|
|
||||||
{F22C4131-D4CC-426E-8FC4-5C2E60C6B0CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{F22C4131-D4CC-426E-8FC4-5C2E60C6B0CE}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{F22C4131-D4CC-426E-8FC4-5C2E60C6B0CE}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{F22C4131-D4CC-426E-8FC4-5C2E60C6B0CE}.Release|x64.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -1,150 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Text;
|
|
||||||
using System.Web.Script.Serialization;
|
|
||||||
using System.Configuration;
|
|
||||||
using AdbTools.bean;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Windows;
|
|
||||||
using System.IO;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
|
|
||||||
namespace AdbTools.AccessInterface
|
|
||||||
{
|
|
||||||
|
|
||||||
public delegate void UpdateInfo(GithubReleases githubReleases);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// post请求
|
|
||||||
/// </summary>
|
|
||||||
public static class RequestJson
|
|
||||||
{
|
|
||||||
public const string ApiUrl = @"https://api.github.com/repos/zsjy/AdbTools/releases";
|
|
||||||
public const string ApiUrlMirror = @"https://code.hcjike.com/api/v1/repos/hcjike/AdbTools/releases";
|
|
||||||
|
|
||||||
public const string UpdateFileName = "update.zip";
|
|
||||||
private static JavaScriptSerializer jss = new JavaScriptSerializer();
|
|
||||||
|
|
||||||
public static void UpdateCheck(MainWindow mainWindow, Image updateVersion)
|
|
||||||
{
|
|
||||||
UpdateCheck(mainWindow, githubReleases =>
|
|
||||||
{
|
|
||||||
updateVersion.Visibility = Visibility.Visible;
|
|
||||||
updateVersion.Tag = githubReleases;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void UpdateCheck(MainWindow mainWindow, UpdateInfo action)
|
|
||||||
{
|
|
||||||
Thread thread = new Thread(new ThreadStart(() =>
|
|
||||||
{
|
|
||||||
GithubReleases githubReleases = Request();
|
|
||||||
if (null == githubReleases || App.Version.Equals(githubReleases.Name))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
GithubReleasesAssets githubReleasesAssets = null;
|
|
||||||
foreach (GithubReleasesAssets assets in githubReleases.Assets)
|
|
||||||
{
|
|
||||||
if (UpdateFileName.Equals(assets.Name, StringComparison.CurrentCultureIgnoreCase))
|
|
||||||
{
|
|
||||||
githubReleasesAssets = assets;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (null == githubReleasesAssets)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mainWindow.Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
action.Invoke(githubReleases);
|
|
||||||
}));
|
|
||||||
}));
|
|
||||||
thread.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 执行请求,返回返回类型对象
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="T">请求的类型</typeparam>
|
|
||||||
/// <typeparam name="S">返回的类型</typeparam>
|
|
||||||
/// <param name="requestType">接口名称</param>
|
|
||||||
/// <param name="obj">请求的参数Json对象</param>
|
|
||||||
/// <returns>返回的类型的对象</returns>
|
|
||||||
public static GithubReleases Request()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
string strURL = ApiUrlMirror;
|
|
||||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strURL);
|
|
||||||
request.UserAgent = "User-Agent:Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1";
|
|
||||||
request.ContentType = "application/x-www-form-urlencoded";
|
|
||||||
request.Credentials = CredentialCache.DefaultCredentials;
|
|
||||||
request.Method = "GET";
|
|
||||||
request.Proxy = null;
|
|
||||||
request.Timeout = 60000;
|
|
||||||
System.Net.HttpWebResponse response = (System.Net.HttpWebResponse)request.GetResponse();
|
|
||||||
System.IO.StreamReader myreader = new System.IO.StreamReader(response.GetResponseStream(), Encoding.UTF8);
|
|
||||||
string responseText = myreader.ReadToEnd();
|
|
||||||
myreader.Close();
|
|
||||||
|
|
||||||
//return responseText;
|
|
||||||
List<GithubReleases> s = jss.Deserialize<List<GithubReleases>>(responseText);
|
|
||||||
return s[0];
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void DownloadFile(string url, string savePath)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// 创建 HttpWebRequest 对象
|
|
||||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create($"{Globals.AppSettings.GITHUB_PROXY}{url}");
|
|
||||||
request.Method = "GET";
|
|
||||||
|
|
||||||
// 发送请求并获取响应
|
|
||||||
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
|
|
||||||
using (Stream responseStream = response.GetResponseStream())
|
|
||||||
using (FileStream fileStream = new FileStream(savePath, FileMode.Create, FileAccess.Write))
|
|
||||||
{
|
|
||||||
// 缓冲区大小(可以根据需要调整)
|
|
||||||
byte[] buffer = new byte[4096];
|
|
||||||
int bytesRead;
|
|
||||||
|
|
||||||
// 从响应流中读取数据并写入文件
|
|
||||||
while ((bytesRead = responseStream.Read(buffer, 0, buffer.Length)) > 0)
|
|
||||||
{
|
|
||||||
fileStream.Write(buffer, 0, bytesRead);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Console.WriteLine($"File downloaded and saved to: {savePath}");
|
|
||||||
}
|
|
||||||
catch (WebException ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"WebException: {ex.Message}");
|
|
||||||
if (ex.Response != null)
|
|
||||||
{
|
|
||||||
using (var errorResponse = (HttpWebResponse)ex.Response)
|
|
||||||
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
|
|
||||||
{
|
|
||||||
string errorText = reader.ReadToEnd();
|
|
||||||
Console.WriteLine($"Error details: {errorText}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"Error: {ex.Message}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -8,13 +8,12 @@
|
|||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<RootNamespace>AdbTools</RootNamespace>
|
<RootNamespace>AdbTools</RootNamespace>
|
||||||
<AssemblyName>AdbTools</AssemblyName>
|
<AssemblyName>AdbTools</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
<TargetFrameworkProfile />
|
|
||||||
<PublishUrl>publish\</PublishUrl>
|
<PublishUrl>publish\</PublishUrl>
|
||||||
<Install>true</Install>
|
<Install>true</Install>
|
||||||
<InstallFrom>Disk</InstallFrom>
|
<InstallFrom>Disk</InstallFrom>
|
||||||
@ -29,6 +28,7 @@
|
|||||||
<ApplicationRevision>1</ApplicationRevision>
|
<ApplicationRevision>1</ApplicationRevision>
|
||||||
<ApplicationVersion>1.0.0.1</ApplicationVersion>
|
<ApplicationVersion>1.0.0.1</ApplicationVersion>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
|
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
@ -40,7 +40,6 @@
|
|||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
@ -50,7 +49,6 @@
|
|||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
@ -59,10 +57,10 @@
|
|||||||
<StartupObject>AdbTools.App</StartupObject>
|
<StartupObject>AdbTools.App</StartupObject>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
<ApplicationIcon>ico.ico</ApplicationIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManifestCertificateThumbprint>737999CE000B08BB39DC1FD926B611A4EA3D170C</ManifestCertificateThumbprint>
|
<ManifestCertificateThumbprint>1B0D79BFE5D45799D0892F29742D83306C8BFE72</ManifestCertificateThumbprint>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManifestKeyFile>
|
<ManifestKeyFile>
|
||||||
@ -72,45 +70,21 @@
|
|||||||
<GenerateManifests>true</GenerateManifests>
|
<GenerateManifests>true</GenerateManifests>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<SignManifests>false</SignManifests>
|
<SignManifests>true</SignManifests>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<SignAssembly>false</SignAssembly>
|
<SignAssembly>true</SignAssembly>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>AdbTools_TemporaryKey.pfx</AssemblyOriginatorKeyFile>
|
||||||
</AssemblyOriginatorKeyFile>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetZone>LocalIntranet</TargetZone>
|
<TargetZone>LocalIntranet</TargetZone>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
|
||||||
<LangVersion>7.3</LangVersion>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
|
||||||
<OutputPath>bin\x64\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
|
||||||
<LangVersion>7.3</LangVersion>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.configuration" />
|
<Reference Include="System.configuration" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.IO.Compression" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Web.Extensions" />
|
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
@ -128,27 +102,6 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
<Compile Include="AccessInterface\RequestJson.cs" />
|
|
||||||
<Page Include="CustomControl\HintComboBox.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Include="CustomControl\HintPasswordBox.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Include="CustomControl\HintTextBox.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Include="CustomControl\ProgressBarControl.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Include="CustomControl\RoundProcessBarLoading.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Include="MainWindow.xaml">
|
<Page Include="MainWindow.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
@ -157,34 +110,12 @@
|
|||||||
<DependentUpon>App.xaml</DependentUpon>
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="bean\Device.cs" />
|
|
||||||
<Compile Include="bean\GithubReleasesAssets.cs" />
|
|
||||||
<Compile Include="bean\GithubReleases.cs" />
|
|
||||||
<Compile Include="CmdExecutor.cs" />
|
<Compile Include="CmdExecutor.cs" />
|
||||||
<Compile Include="CustomControl\HintComboBox.xaml.cs">
|
|
||||||
<DependentUpon>HintComboBox.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="CustomControl\HintPasswordBox.xaml.cs">
|
|
||||||
<DependentUpon>HintPasswordBox.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="CustomControl\HintTextBox.xaml.cs">
|
|
||||||
<DependentUpon>HintTextBox.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="CustomControl\ProgressBarControl.xaml.cs">
|
|
||||||
<DependentUpon>ProgressBarControl.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="CustomControl\RoundProcessBarLoading.xaml.cs">
|
|
||||||
<DependentUpon>RoundProcessBarLoading.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Globals.cs" />
|
<Compile Include="Globals.cs" />
|
||||||
<Compile Include="MainWindow.xaml.cs">
|
<Compile Include="MainWindow.xaml.cs">
|
||||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Page Include="resource\ControlStyle.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
@ -204,6 +135,7 @@
|
|||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<None Include="AdbTools_TemporaryKey.pfx" />
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
<None Include="app.manifest" />
|
<None Include="app.manifest" />
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
@ -221,8 +153,10 @@
|
|||||||
<Content Include="AdbWinUsbApi.dll">
|
<Content Include="AdbWinUsbApi.dll">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Resource Include="resource\imgs\new_version.png" />
|
<Content Include="dotNetFx40 在线安装包.exe">
|
||||||
<Resource Include="icon.ico" />
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Resource Include="ico.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||||
@ -231,11 +165,5 @@
|
|||||||
<Install>false</Install>
|
<Install>false</Install>
|
||||||
</BootstrapperPackage>
|
</BootstrapperPackage>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Update\Update.csproj">
|
|
||||||
<Project>{f22c4131-d4cc-426e-8fc4-5c2e60c6b0ce}</Project>
|
|
||||||
<Name>Update</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
@ -1,3 +1,3 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>
|
</configuration>
|
@ -4,25 +4,6 @@
|
|||||||
xmlns:local="clr-namespace:AdbTools"
|
xmlns:local="clr-namespace:AdbTools"
|
||||||
StartupUri="MainWindow.xaml">
|
StartupUri="MainWindow.xaml">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
|
||||||
|
|
||||||
|
|
||||||
<ResourceDictionary Source="resource/ControlStyle.xaml"></ResourceDictionary>
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
|
||||||
|
|
||||||
<!--所有button应用-->
|
|
||||||
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource UserButtonStyle}"/>
|
|
||||||
|
|
||||||
<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource UserMenuItemStyle}"/>
|
|
||||||
|
|
||||||
<!--<Style TargetType="{x:Type ComboBoxItem}" BasedOn="{StaticResource UserComboBoxItem}"/>-->
|
|
||||||
|
|
||||||
<!--<Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource UserComboBox}"/>-->
|
|
||||||
|
|
||||||
<!--<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource UserTextBox}"/>-->
|
|
||||||
|
|
||||||
</ResourceDictionary>
|
|
||||||
|
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
</Application>
|
</Application>
|
||||||
|
@ -2,11 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace AdbTools
|
namespace AdbTools
|
||||||
@ -16,82 +12,5 @@ namespace AdbTools
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
[DllImport("User32.dll")]
|
|
||||||
private static extern bool ShowWindowAsync(System.IntPtr hWnd, int cmdShow);
|
|
||||||
[DllImport("User32.dll")]
|
|
||||||
private static extern bool SetForegroundWindow(System.IntPtr hWnd);
|
|
||||||
|
|
||||||
public static string Version => Assembly.GetExecutingAssembly().GetName().Version.ToString(3);
|
|
||||||
|
|
||||||
protected override void OnStartup(StartupEventArgs e)
|
|
||||||
{
|
|
||||||
base.OnStartup(e);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Process current = Process.GetCurrentProcess();
|
|
||||||
Process[] createMeetingProcess = Process.GetProcessesByName(current.ProcessName);
|
|
||||||
if (createMeetingProcess.Count() > 1)
|
|
||||||
{
|
|
||||||
HandleRunningInstance(createMeetingProcess[0]);
|
|
||||||
Application.Current.Shutdown();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
|
|
||||||
|
|
||||||
//UI线程未捕获异常处理事件(UI主线程)
|
|
||||||
Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
|
|
||||||
//非UI线程未捕获异常处理事件(例如自己创建的一个子线程)
|
|
||||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
|
||||||
//Task线程内未捕获异常处理事件
|
|
||||||
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandleRunningInstance(Process instance)
|
|
||||||
{
|
|
||||||
ShowWindowAsync(instance.MainWindowHandle, 1); //调用api函数,正常显示窗口
|
|
||||||
SetForegroundWindow(instance.MainWindowHandle); //将窗口放置最前端
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
|
|
||||||
{
|
|
||||||
Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
MessageBox.Show("未捕获Task线程异常:" + e.ToString() + "\r\n异常消息:" + e.Exception.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnExit(ExitEventArgs e)
|
|
||||||
{
|
|
||||||
base.OnExit(e);
|
|
||||||
|
|
||||||
Environment.Exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
|
||||||
{
|
|
||||||
Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
MessageBox.Show("未捕获非UI线程异常:" + e.ToString() + "\r\n对象:" + e.ExceptionObject, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
|
|
||||||
{
|
|
||||||
var comException = e.Exception as System.Runtime.InteropServices.COMException;
|
|
||||||
if (comException != null && comException.ErrorCode == -2147221040)
|
|
||||||
{
|
|
||||||
e.Handled = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
e.Handled = true;
|
|
||||||
|
|
||||||
Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
MessageBox.Show("未捕获UI线程异常:" + e.ToString() + "\r\n异常消息:" + e.Exception.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,84 +1,33 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Threading;
|
using System.Linq;
|
||||||
using System.Windows;
|
using System.Text;
|
||||||
|
|
||||||
namespace AdbTools
|
namespace AdbTools
|
||||||
{
|
{
|
||||||
public delegate void ExecuteResult(string result);
|
|
||||||
public delegate bool ExecuteErrResult(string err);
|
|
||||||
|
|
||||||
public class CmdExecutor
|
public class CmdExecutor
|
||||||
{
|
{
|
||||||
|
public static string ExecuteCommandAndReturn(string command)
|
||||||
public static void ExecuteCommandAndReturnAsync(string command)
|
|
||||||
{
|
{
|
||||||
ExecuteCommandAndReturnAsync(new string[] { command }, null, null);
|
using (Process process = new Process())
|
||||||
}
|
|
||||||
|
|
||||||
public static void ExecuteCommandAndReturnAsync(string command, ExecuteResult executeResult)
|
|
||||||
{
|
|
||||||
ExecuteCommandAndReturnAsync(new string[] { command }, executeResult, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void ExecuteCommandAndReturnAsync(string command, ExecuteResult executeResult, ExecuteErrResult errorResult)
|
|
||||||
{
|
|
||||||
ExecuteCommandAndReturnAsync(new string[] { command }, executeResult, errorResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void ExecuteCommandAndReturnAsync(string[] command, ExecuteResult executeResult, ExecuteErrResult errorResult, int timeout = 5)
|
|
||||||
{
|
|
||||||
new Thread(() =>
|
|
||||||
{
|
{
|
||||||
using (Process process = new Process())
|
process.StartInfo.FileName = "cmd.exe";
|
||||||
{
|
process.StartInfo.RedirectStandardInput = true;
|
||||||
process.StartInfo.FileName = "cmd.exe";
|
process.StartInfo.RedirectStandardOutput = true;
|
||||||
process.StartInfo.RedirectStandardInput = true;
|
process.StartInfo.UseShellExecute = false;
|
||||||
process.StartInfo.RedirectStandardOutput = true;
|
process.StartInfo.CreateNoWindow = true;
|
||||||
process.StartInfo.RedirectStandardError = true;
|
|
||||||
process.StartInfo.UseShellExecute = false;
|
|
||||||
process.StartInfo.CreateNoWindow = true;
|
|
||||||
|
|
||||||
process.Start();
|
process.Start();
|
||||||
|
|
||||||
foreach (string com in command)
|
process.StandardInput.WriteLine(command);
|
||||||
{
|
process.StandardInput.WriteLine("exit");
|
||||||
process.StandardInput.WriteLine(com);
|
|
||||||
Thread.Sleep(50);
|
|
||||||
}
|
|
||||||
|
|
||||||
process.StandardInput.WriteLine("exit");
|
process.WaitForExit(2000);
|
||||||
process.StandardInput.Close(); // 关闭输入流
|
|
||||||
|
|
||||||
string ret = process.StandardOutput.ReadToEnd();
|
return process.StandardOutput.ReadToEnd();
|
||||||
string err = process.StandardError.ReadToEnd();
|
|
||||||
Console.WriteLine($"result : {ret}");
|
|
||||||
Console.WriteLine($"err : {err}");
|
|
||||||
|
|
||||||
if (!process.WaitForExit(timeout * 1000)) // 等待5秒
|
|
||||||
{
|
|
||||||
process.Kill(); // 强制终止进程
|
|
||||||
}
|
|
||||||
|
|
||||||
Application.Current.Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
bool dispose = false;
|
|
||||||
if (!string.IsNullOrWhiteSpace(err))
|
|
||||||
{
|
|
||||||
if (null != errorResult)
|
|
||||||
{
|
|
||||||
dispose = errorResult.Invoke(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!dispose)
|
|
||||||
{
|
|
||||||
executeResult?.Invoke(ret);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}).Start();
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ExecuteCommandByShell(string command)
|
public static void ExecuteCommandByShell(string command)
|
||||||
@ -90,42 +39,29 @@ namespace AdbTools
|
|||||||
process.StartInfo.CreateNoWindow = false;
|
process.StartInfo.CreateNoWindow = false;
|
||||||
process.StartInfo.Arguments = $"/c \"{command}\"";
|
process.StartInfo.Arguments = $"/c \"{command}\"";
|
||||||
process.Start();
|
process.Start();
|
||||||
|
process.WaitForExit();
|
||||||
|
|
||||||
|
//process.StandardInput.WriteLine(command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool StartExe(string exePath)
|
public static void ExecuteCommandAndQuit(string command)
|
||||||
{
|
{
|
||||||
return StartExe(exePath, new List<string>());
|
using (Process process = new Process())
|
||||||
}
|
{
|
||||||
|
process.StartInfo.FileName = "cmd.exe";
|
||||||
|
process.StartInfo.RedirectStandardInput = true;
|
||||||
|
process.StartInfo.RedirectStandardOutput = true;
|
||||||
|
process.StartInfo.UseShellExecute = false;
|
||||||
|
process.StartInfo.CreateNoWindow = true;
|
||||||
|
|
||||||
public static bool StartExe(string exePath, List<string> cmdArges)
|
process.Start();
|
||||||
{
|
|
||||||
string args = "";
|
|
||||||
foreach (string a in cmdArges)
|
|
||||||
{
|
|
||||||
args += a + " ";
|
|
||||||
}
|
|
||||||
// 创建ProcessStartInfo对象
|
|
||||||
ProcessStartInfo startInfo = new ProcessStartInfo
|
|
||||||
{
|
|
||||||
FileName = exePath,
|
|
||||||
Arguments = args,
|
|
||||||
UseShellExecute = true // 使用操作系统shell启动
|
|
||||||
};
|
|
||||||
|
|
||||||
try
|
process.StandardInput.WriteLine(command);
|
||||||
{
|
process.StandardInput.WriteLine("exit");
|
||||||
// 启动外部程序
|
|
||||||
Process.Start(startInfo);
|
process.WaitForExit(2000);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
//MessageBox.Show("启动程序时出错: " + ex.Message);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
<UserControl x:Class="AdbTools.CustomControl.HintComboBox"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignHeight="40" d:DesignWidth="300" Loaded="UserControl_Loaded">
|
|
||||||
<Grid x:Name="grid" Margin="0,0,0,0">
|
|
||||||
<ComboBox x:Name="comboBox" Width="{Binding ElementName=grid, Path=ActualWidth}" Height="{Binding ElementName=grid, Path=ActualHeight}" Foreground="#FF2F99FB" Background="{x:Null}" IsReadOnly="true"
|
|
||||||
Padding="3,3,3,3" Margin="0,0,0,2" BorderThickness="0" SelectionChanged="comboBox_SelectionChanged" VerticalContentAlignment="Center" KeyUp="comboBox_KeyUp" IsEditable="True" KeyDown="comboBox_KeyDown"/>
|
|
||||||
<Label x:Name="hint" Content="" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#FF797A80" IsHitTestVisible="False" Background="{x:Null}" Margin="3,0,0,0"/>
|
|
||||||
<Line x:Name="line" X1="0" X2="{Binding ElementName=grid, Path=ActualWidth}" Y1="{Binding ElementName=comboBox, Path=ActualHeight}" Y2="{Binding ElementName=comboBox, Path=ActualHeight}"/>
|
|
||||||
<!--<Image x:Name="image" Width="20" Height="20" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" />-->
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
@ -1,271 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
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.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace AdbTools.CustomControl
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// HintComboBox.xaml 的交互逻辑
|
|
||||||
/// </summary>
|
|
||||||
public partial class HintComboBox : UserControl
|
|
||||||
{
|
|
||||||
public HintComboBox()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//[Description("获取或设置图片")]
|
|
||||||
//public System.Windows.Media.ImageSource ImageSource
|
|
||||||
//{
|
|
||||||
// set
|
|
||||||
// {
|
|
||||||
// this.image.Source = value;
|
|
||||||
// }
|
|
||||||
// get
|
|
||||||
// {
|
|
||||||
// return this.image.Source;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
[Description("设置或获取提示信息")]
|
|
||||||
public object Hint
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.hint.Content;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.hint.Content = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取提示信息的颜色")]
|
|
||||||
public System.Windows.Media.Brush HintForeground
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.hint.Foreground;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.hint.Foreground = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取提示信息的字体大小")]
|
|
||||||
public double HintFontSize
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.hint.FontSize;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.hint.FontSize = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取输入框的字体颜色")]
|
|
||||||
public System.Windows.Media.Brush TextForeground
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.comboBox.Foreground;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.comboBox.Foreground = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取输入框的字体大小")]
|
|
||||||
public double TextFontSize
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.comboBox.FontSize;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.comboBox.FontSize = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取下划线的颜色")]
|
|
||||||
public System.Windows.Media.Brush LineStroke
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.line.Stroke;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.line.Stroke = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取输入框的文本")]
|
|
||||||
public string Text
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.comboBox.Text;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(value))
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Visible;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
this.comboBox.Text = value;
|
|
||||||
this.UpdateLayout();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取控件是否只读")]
|
|
||||||
public bool IsReadOnly
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.comboBox.IsReadOnly;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.comboBox.IsReadOnly = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("获取控件的所有项")]
|
|
||||||
public System.Windows.Controls.ItemCollection Items
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.comboBox.Items;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取控件的内边距")]
|
|
||||||
public System.Windows.Thickness ComboBoxPadding
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
Thickness t = this.comboBox.Padding;
|
|
||||||
return new Thickness(t.Left - 10, t.Top, t.Right, t.Bottom);
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.comboBox.Padding = new Thickness(10 + value.Left, value.Top, value.Right, value.Bottom);
|
|
||||||
this.hint.Margin = new Thickness(10 + value.Left, 0, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取控件的下拉条高度")]
|
|
||||||
public double MaxDropDownHeight
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.comboBox.MaxDropDownHeight;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.comboBox.MaxDropDownHeight = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("下拉改变事件,可以获取到选择的项")]
|
|
||||||
public event EventHandler<SelectionChangedEventArgs> SelectionChanged;
|
|
||||||
|
|
||||||
private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (this.IsLoad)
|
|
||||||
{
|
|
||||||
if (e.AddedItems.Count > 0)
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SelectionChanged != null)
|
|
||||||
{
|
|
||||||
SelectionChanged(sender, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool IsLoad;
|
|
||||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
this.IsLoad = true;
|
|
||||||
this.comboBox.Height = this.ActualHeight;
|
|
||||||
this.comboBox.Width = this.ActualWidth;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(Text))
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Visible;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void comboBox_KeyUp(object sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
if (this.IsLoad)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(this.Text))
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Visible;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void comboBox_KeyDown(object sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
if (this.IsLoad)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(this.Text))
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Visible;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
<UserControl x:Class="AdbTools.CustomControl.HintPasswordBox"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignHeight="40" d:DesignWidth="300" Loaded="UserControl_Loaded">
|
|
||||||
<Grid x:Name="grid">
|
|
||||||
<PasswordBox x:Name="passwordBox" PasswordChar="*" Height="{Binding ElementName=grid, Path=ActualHeight}" Margin="0,0,0,2" Padding="0,1,1,1" VerticalContentAlignment="Center" Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="#FF3399FF" BorderThickness="0" PasswordChanged="passwordBox_PasswordChanged"
|
|
||||||
DataObject.Pasting="passwordBox_Pasting" PreviewKeyDown="passwordBox_PreviewKeyDown" PreviewTextInput="passwordBox_PreviewTextInput"/>
|
|
||||||
<Label x:Name="hint" Content="" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#FF797A80" IsHitTestVisible="False" Background="{x:Null}" Margin="0,0,0,0"/>
|
|
||||||
<Line x:Name="line" X1="0" X2="{Binding ElementName=grid, Path=ActualWidth}" Y1="{Binding ElementName=passwordBox, Path=ActualHeight}" Y2="{Binding ElementName=passwordBox, Path=ActualHeight}"/>
|
|
||||||
<!--<Image x:Name="image" Width="20" Height="20" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" />-->
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
@ -1,245 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
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.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace AdbTools.CustomControl
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// HintPasswordBox.xaml 的交互逻辑
|
|
||||||
/// </summary>
|
|
||||||
public partial class HintPasswordBox : UserControl
|
|
||||||
{
|
|
||||||
public HintPasswordBox()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
//[Description("获取或设置图片")]
|
|
||||||
//public System.Windows.Media.ImageSource ImageSource
|
|
||||||
//{
|
|
||||||
// set
|
|
||||||
// {
|
|
||||||
// this.image.Source = value;
|
|
||||||
// }
|
|
||||||
// get
|
|
||||||
// {
|
|
||||||
// return this.image.Source;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
[Description("设置或获取提示信息")]
|
|
||||||
public object Hint
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.hint.Content;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.hint.Content = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取提示信息的颜色")]
|
|
||||||
public System.Windows.Media.Brush HintForeground
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.hint.Foreground;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.hint.Foreground = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取提示信息的字体大小")]
|
|
||||||
public double HintFontSize
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.hint.FontSize;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.hint.FontSize = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取输入框的字体颜色")]
|
|
||||||
public System.Windows.Media.Brush TextForeground
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.passwordBox.Foreground;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.passwordBox.Foreground = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取输入框的字体大小")]
|
|
||||||
public double TextFontSize
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.passwordBox.FontSize;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.passwordBox.FontSize = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取下划线的颜色")]
|
|
||||||
public System.Windows.Media.Brush LineStroke
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.line.Stroke;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.line.Stroke = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取输入框的文字")]
|
|
||||||
public string Text
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.passwordBox.Password;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.passwordBox.Password = value;
|
|
||||||
this.UpdateLayout();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取输入框的文字的最大字符数")]
|
|
||||||
public int MaxLength
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.passwordBox.MaxLength;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.passwordBox.MaxLength = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取控件的内边距")]
|
|
||||||
public System.Windows.Thickness BoxPadding
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
Thickness t = this.passwordBox.Padding;
|
|
||||||
return new Thickness(t.Left - 10, t.Top, t.Right, t.Bottom);
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.passwordBox.Padding = new Thickness(10 + value.Left, value.Top, value.Right, value.Bottom);
|
|
||||||
this.hint.Margin = new Thickness(10 + value.Left, 0, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取PasswordBox水平对齐方式")]
|
|
||||||
public HorizontalAlignment BoxHorizontalContentAlignment
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.passwordBox.HorizontalContentAlignment;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.passwordBox.HorizontalContentAlignment = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置控件BoxPasting事件")]
|
|
||||||
public event EventHandler<TextBoxPastingEventArgs> BoxPasting;
|
|
||||||
private void passwordBox_Pasting(object sender, DataObjectPastingEventArgs e)
|
|
||||||
{
|
|
||||||
BoxPasting?.Invoke(sender, new TextBoxPastingEventArgs(e));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置控件BoxPreviewKeyDown事件")]
|
|
||||||
public event KeyEventHandler BoxPreviewKeyDown;
|
|
||||||
|
|
||||||
private void passwordBox_PreviewKeyDown(object sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
BoxPreviewKeyDown?.Invoke(sender, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置控件BoxPreviewTextInput事件")]
|
|
||||||
public event TextCompositionEventHandler BoxPreviewTextInput;
|
|
||||||
private void passwordBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
|
||||||
{
|
|
||||||
BoxPreviewTextInput?.Invoke(sender, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置控件PasswordBoxPasswordChanged事件")]
|
|
||||||
public event RoutedEventHandler PasswordBoxPasswordChanged;
|
|
||||||
|
|
||||||
private void passwordBox_PasswordChanged(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (this.IsLoad)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(this.Text))
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Visible;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PasswordBoxPasswordChanged?.Invoke(sender, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool IsLoad;
|
|
||||||
|
|
||||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
this.IsLoad = true;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(this.Text))
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Visible;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void TextFocus()
|
|
||||||
{
|
|
||||||
this.passwordBox.Focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
<UserControl x:Class="AdbTools.CustomControl.HintTextBox"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
mc:Ignorable="d" x:Name="parent"
|
|
||||||
d:DesignHeight="40" d:DesignWidth="300" Loaded="UserControl_Loaded">
|
|
||||||
<Grid x:Name="grid">
|
|
||||||
<TextBox x:Name="textBox" Margin="0" VerticalContentAlignment="Center" Background="{x:Null}"
|
|
||||||
TextChanged="textBox_TextChanged" TextInput="textBox_TextInput" BorderBrush="{Binding ElementName=parent, Path=BorderBrush}" BorderThickness="{Binding ElementName=parent, Path=BorderThickness}"
|
|
||||||
Foreground="{Binding ElementName=parent, Path=Foreground}"
|
|
||||||
DataObject.Pasting="textBox_Pasting" PreviewKeyDown="textBox_PreviewKeyDown" PreviewTextInput="textBox_PreviewTextInput"/>
|
|
||||||
<Label x:Name="hint" Content="" Foreground="#FF797A80" IsHitTestVisible="False" Background="{x:Null}" Margin="0" Padding="0" VerticalContentAlignment="Center"/>
|
|
||||||
<Line x:Name="line" X1="0" X2="{Binding ElementName=textBox, Path=ActualWidth}" Y1="{Binding ElementName=textBox, Path=ActualHeight}" Y2="{Binding ElementName=textBox, Path=ActualHeight}"/>
|
|
||||||
<!--<Image x:Name="image" Width="20" Height="20" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" />-->
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
@ -1,371 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
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.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace AdbTools.CustomControl
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// HintTextBox.xaml 的交互逻辑
|
|
||||||
/// </summary>
|
|
||||||
public partial class HintTextBox : UserControl
|
|
||||||
{
|
|
||||||
public HintTextBox()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
//[Description("获取或设置图片")]
|
|
||||||
//public System.Windows.Media.ImageSource ImageSource
|
|
||||||
//{
|
|
||||||
// set
|
|
||||||
// {
|
|
||||||
// this.image.Source = value;
|
|
||||||
// }
|
|
||||||
// get
|
|
||||||
// {
|
|
||||||
// return this.image.Source;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
[Description("设置或获取提示信息")]
|
|
||||||
[Bindable(true)]
|
|
||||||
public object Hint
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.hint.Content;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.hint.Content = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("获取TextBox")]
|
|
||||||
public TextBox GetTextBox
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.textBox;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取提示信息的颜色")]
|
|
||||||
public System.Windows.Media.Brush HintForeground
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.hint.Foreground;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.hint.Foreground = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取光标颜色")]
|
|
||||||
[Bindable(true)]
|
|
||||||
public Brush BoxCaretBrush
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.textBox.CaretBrush;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.textBox.CaretBrush = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取提示信息的字体大小")]
|
|
||||||
public double HintFontSize
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.hint.FontSize;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.hint.FontSize = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取指定文本在到达包含框的边缘时是否换行")]
|
|
||||||
public TextWrapping TextBoxWrapping
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.textBox.TextWrapping;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.textBox.TextWrapping = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("获取或设置可见行的最大数目。")]
|
|
||||||
public int TextBoxMaxLines
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.textBox.MaxLines;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.textBox.MaxLines = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取输入框的字体颜色")]
|
|
||||||
public System.Windows.Media.Brush TextForeground
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.textBox.Foreground;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.textBox.Foreground = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取输入框的字体大小")]
|
|
||||||
public double TextFontSize
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.textBox.FontSize;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.textBox.FontSize = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("获取或设置一个值,确定当用户导航控件通过使用 TAB 键元素接收焦点的顺序。")]
|
|
||||||
public int TextTabIndex
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.textBox.TabIndex;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.textBox.TabIndex = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void TextFocus()
|
|
||||||
{
|
|
||||||
this.textBox.Focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取下划线的颜色")]
|
|
||||||
public System.Windows.Media.Brush LineStroke
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.line.Stroke;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.line.Stroke = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取输入框的文字")]
|
|
||||||
public string Text
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.textBox.Text;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.textBox.Text = value;
|
|
||||||
this.UpdateLayout();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取输入框的文字的最大字符数")]
|
|
||||||
public int MaxLength
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.textBox.MaxLength;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.textBox.MaxLength = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取控件的内边距")]
|
|
||||||
public System.Windows.Thickness BoxPadding
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
Thickness t = this.textBox.Padding;
|
|
||||||
return new Thickness(t.Left - 10, t.Top, t.Right, t.Bottom);
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.textBox.Padding = new Thickness(10 + value.Left, value.Top, value.Right, value.Bottom);
|
|
||||||
this.hint.Margin = new Thickness(10 + value.Left, 0, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取Hint水平对齐方式")]
|
|
||||||
public HorizontalAlignment HintHorizontalContentAlignment
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.hint.HorizontalContentAlignment;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.hint.HorizontalContentAlignment = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取TextBox水平对齐方式")]
|
|
||||||
public HorizontalAlignment BoxHorizontalContentAlignment
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.textBox.HorizontalContentAlignment;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.textBox.HorizontalContentAlignment = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Description("设置或获取下划线的显示和隐藏")]
|
|
||||||
public Visibility LineVisibility
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.line.Visibility;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.line.Visibility = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置或获取控件是否只读")]
|
|
||||||
public bool IsReadOnly
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.textBox.IsReadOnly;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.textBox.IsReadOnly = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置控件BoxPasting事件")]
|
|
||||||
public event EventHandler<TextBoxPastingEventArgs> BoxPasting;
|
|
||||||
private void textBox_Pasting(object sender, DataObjectPastingEventArgs e)
|
|
||||||
{
|
|
||||||
BoxPasting?.Invoke(sender, new TextBoxPastingEventArgs(e));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置控件BoxPreviewKeyDown事件")]
|
|
||||||
public event KeyEventHandler BoxPreviewKeyDown;
|
|
||||||
|
|
||||||
private void textBox_PreviewKeyDown(object sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
BoxPreviewKeyDown?.Invoke(sender, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置控件BoxPreviewTextInput事件")]
|
|
||||||
public event TextCompositionEventHandler BoxPreviewTextInput;
|
|
||||||
private void textBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
|
||||||
{
|
|
||||||
BoxPreviewTextInput?.Invoke(sender, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("设置控件TextBoxTextChanged事件")]
|
|
||||||
public event TextChangedEventHandler TextBoxTextChanged;
|
|
||||||
|
|
||||||
private void textBox_TextChanged(object sender, TextChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (this.IsLoad)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(this.Text))
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Visible;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TextBoxTextChanged?.Invoke(sender, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool IsLoad;
|
|
||||||
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
this.IsLoad = true;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(Text))
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Visible;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.hint.Visibility = System.Windows.Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("文本输入事件")]
|
|
||||||
public event EventHandler<TextCompositionEventArgs> TextBoxInput;
|
|
||||||
private void textBox_TextInput(object sender, TextCompositionEventArgs e)
|
|
||||||
{
|
|
||||||
if (TextBoxInput != null)
|
|
||||||
{
|
|
||||||
TextBoxInput(this, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class TextBoxPastingEventArgs : EventArgs
|
|
||||||
{
|
|
||||||
|
|
||||||
public DataObjectPastingEventArgs e
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
private set;
|
|
||||||
}
|
|
||||||
public TextBoxPastingEventArgs(DataObjectPastingEventArgs e)
|
|
||||||
{
|
|
||||||
this.e = e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
<UserControl x:Class="AdbTools.CustomControl.ProgressBarControl"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignHeight="30" d:DesignWidth="300">
|
|
||||||
<Grid>
|
|
||||||
<Rectangle x:Name="progressBG" Fill="White" StrokeThickness="0" />
|
|
||||||
<Rectangle x:Name="progressValue" HorizontalAlignment="Left" Width="0" StrokeThickness="0" />
|
|
||||||
<Label x:Name="progressTip" Content="" Padding="0" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
@ -1,141 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
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.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace AdbTools.CustomControl
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// ProgressBarControl.xaml 的交互逻辑
|
|
||||||
/// </summary>
|
|
||||||
public partial class ProgressBarControl : UserControl
|
|
||||||
{
|
|
||||||
public ProgressBarControl()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取或设置进度条的背景色
|
|
||||||
/// </summary>
|
|
||||||
[Description("获取或设置进度条的背景色")]
|
|
||||||
public System.Windows.Media.Brush ProgressBackground
|
|
||||||
{
|
|
||||||
get { return progressBG.Fill; }
|
|
||||||
set { progressBG.Fill = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取或设置进度条的边框色
|
|
||||||
/// </summary>
|
|
||||||
[Description("获取或设置进度条的边框色")]
|
|
||||||
public System.Windows.Media.Brush ProgressStroke
|
|
||||||
{
|
|
||||||
get { return progressBG.Stroke; }
|
|
||||||
set { progressBG.Stroke = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取或设置进度条的边框粗细
|
|
||||||
/// </summary>
|
|
||||||
[Description("获取或设置进度条的边框粗细")]
|
|
||||||
public double ProgressStrokeThickness
|
|
||||||
{
|
|
||||||
get { return progressBG.StrokeThickness; }
|
|
||||||
set { progressBG.StrokeThickness = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取或设置进度条的进度色
|
|
||||||
/// </summary>
|
|
||||||
[Description("获取或设置进度条的进度色")]
|
|
||||||
public System.Windows.Media.Brush ProgressColor
|
|
||||||
{
|
|
||||||
get { return progressValue.Fill; }
|
|
||||||
set { progressValue.Fill = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取或设置进度条提示信息
|
|
||||||
/// </summary>
|
|
||||||
[Description("获取或设置进度条提示信息")]
|
|
||||||
public string HintProgress
|
|
||||||
{
|
|
||||||
get { return progressTip.Content.ToString(); }
|
|
||||||
set { progressTip.Content = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取或设置进度条提示信息文字大小
|
|
||||||
/// </summary>
|
|
||||||
[Description("获取或设置进度条提示信息文字大小")]
|
|
||||||
public double HintFontSize
|
|
||||||
{
|
|
||||||
get { return progressTip.FontSize; }
|
|
||||||
set { progressTip.FontSize = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取或设置进度条提示信息字体颜色
|
|
||||||
/// </summary>
|
|
||||||
[Description("获取或设置进度条提示信息字体颜色")]
|
|
||||||
public System.Windows.Media.Brush HintForeground
|
|
||||||
{
|
|
||||||
get { return progressTip.Foreground; }
|
|
||||||
set { progressTip.Foreground = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private double _Maximum = 100.0;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取或设置进度条的最大进度值,默认值为100
|
|
||||||
/// </summary>
|
|
||||||
/// <exception cref="InvalidOperationException">进度值不可小于等于零</exception>
|
|
||||||
[Description("获取或设置进度条的最大进度值")]
|
|
||||||
public double Maximum
|
|
||||||
{
|
|
||||||
get { return _Maximum; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value <= 0)
|
|
||||||
throw new InvalidOperationException("进度值不可小于等于零");
|
|
||||||
_Maximum = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private double _Value;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取或设置进度条的进度值
|
|
||||||
/// </summary>
|
|
||||||
[Description("获取或设置进度条的进度值")]
|
|
||||||
public double Value
|
|
||||||
{
|
|
||||||
get { return _Value; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value < 0)
|
|
||||||
_Value = 0;
|
|
||||||
else if(value > _Maximum)
|
|
||||||
_Value = 100;
|
|
||||||
_Value = value;
|
|
||||||
|
|
||||||
this.progressValue.Width = (_Value / _Maximum) * this.progressBG.ActualWidth;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,211 +0,0 @@
|
|||||||
<UserControl x:Class="AdbTools.CustomControl.RoundProcessBarLoading"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignHeight="800" d:DesignWidth="800">
|
|
||||||
<Viewbox>
|
|
||||||
<Grid Height="800" Width="800">
|
|
||||||
<Grid x:Name="animationGrid" Visibility="Collapsed">
|
|
||||||
<Rectangle Name="Rect1" Height="200" Width="120" Fill="#FFC4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:IsLocked="True"/>
|
|
||||||
<Rectangle Name="Rect2" Height="200" Width="120" Fill="#20C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="45"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Name="Rect3" Height="200" Width="120" Fill="#40C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="90"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Name="Rect4" Height="200" Width="120" Fill="#60C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="135"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Name="Rect5" Height="200" Width="120" Fill="#80C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="180"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Name="Rect6" Height="200" Width="120" Fill="#A0C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="225"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Name="Rect7" Height="200" Width="120" Fill="#C0C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="270"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Name="Rect8" Height="200" Width="120" Fill="#E0C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="315"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Grid.Triggers>
|
|
||||||
<EventTrigger RoutedEvent="Page.Loaded">
|
|
||||||
<BeginStoryboard>
|
|
||||||
<Storyboard RepeatBehavior="Forever">
|
|
||||||
<!--Rect1-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect1" Duration="0:0:1" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
|
|
||||||
<!--Rect2-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect2" Duration="0:0:0.125" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
<ColorAnimation BeginTime="0:0:0.125" Storyboard.TargetName="Rect2" Duration="0:0:0.875" Storyboard.TargetProperty="Fill.Color" From="#FFC4C4C4" To="#20C4C4C4"/>
|
|
||||||
|
|
||||||
<!--Rect3-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect3" Duration="0:0:0.250" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
<ColorAnimation BeginTime="0:0:0.250" Storyboard.TargetName="Rect3" Duration="0:0:0.750" Storyboard.TargetProperty="Fill.Color" From="#FFC4C4C4" To="#40C4C4C4"/>
|
|
||||||
|
|
||||||
<!--Rect4-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect4" Duration="0:0:0.375" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
<ColorAnimation BeginTime="0:0:0.375" Storyboard.TargetName="Rect4" Duration="0:0:0.625" Storyboard.TargetProperty="Fill.Color" From="#FFC4C4C4" To="#60C4C4C4"/>
|
|
||||||
|
|
||||||
<!--Rect5-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect5" Duration="0:0:0.500" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
<ColorAnimation BeginTime="0:0:0.500" Storyboard.TargetName="Rect5" Duration="0:0:0.500" Storyboard.TargetProperty="Fill.Color" From="#FFC4C4C4" To="#80C4C4C4"/>
|
|
||||||
|
|
||||||
<!--Rect6-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect6" Duration="0:0:0.625" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
<ColorAnimation BeginTime="0:0:0.625" Storyboard.TargetName="Rect6" Duration="0:0:0.375" Storyboard.TargetProperty="Fill.Color" From="#FFC4C4C4" To="#A0C4C4C4"/>
|
|
||||||
|
|
||||||
<!--Rect7-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect7" Duration="0:0:0.750" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
<ColorAnimation BeginTime="0:0:0.750" Storyboard.TargetName="Rect7" Duration="0:0:0.250" Storyboard.TargetProperty="Fill.Color" From="#FFC4C4C4" To="#C0C4C4C4"/>
|
|
||||||
|
|
||||||
<!--Rect8-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect8" Duration="0:0:0.875" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
<ColorAnimation BeginTime="0:0:0.875" Storyboard.TargetName="Rect8" Duration="0:0:0.125" Storyboard.TargetProperty="Fill.Color" From="#FFC4C4C4" To="#E0C4C4C4"/>
|
|
||||||
</Storyboard>
|
|
||||||
</BeginStoryboard>
|
|
||||||
</EventTrigger>
|
|
||||||
</Grid.Triggers>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Grid x:Name="defaultGrid" Visibility="Visible">
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#FFC4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:IsLocked="True"/>
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#20C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="45"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#40C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="90"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#60C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="135"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#80C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="180"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#A0C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="225"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#C0C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="270"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#E0C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="315"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</Viewbox>
|
|
||||||
|
|
||||||
</UserControl>
|
|
@ -1,50 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
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.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace AdbTools.CustomControl
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// RoundProcessBarLoading.xaml 的交互逻辑
|
|
||||||
/// </summary>
|
|
||||||
public partial class RoundProcessBarLoading : UserControl
|
|
||||||
{
|
|
||||||
public RoundProcessBarLoading()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("获取或设置是否显示动画")]
|
|
||||||
public bool IsShowAnimation
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value)
|
|
||||||
{
|
|
||||||
this.defaultGrid.Visibility = Visibility.Collapsed;
|
|
||||||
this.animationGrid.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.defaultGrid.Visibility = Visibility.Visible;
|
|
||||||
this.animationGrid.Visibility = Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Visibility.Visible == this.animationGrid.Visibility;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -20,7 +20,6 @@ namespace AdbTools
|
|||||||
{
|
{
|
||||||
private static string _LAST_DEVICE_ADDRESS = null;
|
private static string _LAST_DEVICE_ADDRESS = null;
|
||||||
private static List<string> _DEVICE_ADDRESS_HISTORY = null;
|
private static List<string> _DEVICE_ADDRESS_HISTORY = null;
|
||||||
private static string _GITHUB_PROXY = null;
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -74,42 +73,6 @@ namespace AdbTools
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public static string GITHUB_PROXY
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (null == _GITHUB_PROXY)
|
|
||||||
{
|
|
||||||
_GITHUB_PROXY = GetKeyVlaue("GITHUB_PROXY");
|
|
||||||
}
|
|
||||||
if (null == _GITHUB_PROXY)
|
|
||||||
{
|
|
||||||
_GITHUB_PROXY = "https://ghfast.top/";
|
|
||||||
}
|
|
||||||
return _GITHUB_PROXY;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
UpdateAppConfig("GITHUB_PROXY", value);
|
|
||||||
_GITHUB_PROXY = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public static bool IS_GITHUB_PROXY
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string v = GetKeyVlaue("GITHUB_PROXY");
|
|
||||||
return null != v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取配置的值
|
/// 获取配置的值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -3,124 +3,41 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:AdbTools" xmlns:customcontrol="clr-namespace:AdbTools.CustomControl"
|
xmlns:local="clr-namespace:AdbTools"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Adb连接工具" Height="460" Width="350" FontSize="16" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded" Unloaded="Window_Unloaded" >
|
Title="Adb无线连接工具" Height="450" Width="350" FontSize="16" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded" Unloaded="Window_Unloaded">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<ContextMenu x:Key="ListBoxItemContextMenu" FontSize="13">
|
<ContextMenu x:Key="ListBoxItemContextMenu">
|
||||||
<MenuItem x:Name="installApkItem" Header="安装应用" Click="installApkItem_Click" Cursor="Hand" Margin="0,2" />
|
<MenuItem x:Name="installApkItem" Header="安装应用" Click="installApkItem_Click" Cursor="Hand" />
|
||||||
<MenuItem x:Name="disconnectDeviceItem" Header="断开设备" Click="disconnectDeviceItem_Click" Cursor="Hand" Margin="0,2"/>
|
<MenuItem x:Name="disconnectDeviceItem" Header="断开设备" Click="disconnectDeviceItem_Click" Cursor="Hand"/>
|
||||||
<Separator Margin="0,5"/>
|
<Separator/>
|
||||||
<MenuItem Header="查看日志" Cursor="Hand" Margin="0,2" >
|
<MenuItem x:Name="disconnectAllDeviceItem" Header="断开所有设备" Click="disconnectAllDeviceItem_Click" Cursor="Hand" />
|
||||||
<MenuItem x:Name="logcatItem" Header="实时日志" Cursor="Hand" Margin="0,2" Click="logcatItem_Click" />
|
|
||||||
<MenuItem x:Name="logcatDebugItem" Header="Debug日志" Cursor="Hand" Margin="0,2" Click="logcatDebugItem_Click" />
|
|
||||||
</MenuItem>
|
|
||||||
<Separator Margin="0,5"/>
|
|
||||||
<MenuItem Header="恢复默认" Cursor="Hand" Margin="0,2" >
|
|
||||||
<MenuItem x:Name="resetPortItem" Header="恢复默认TCP端口" Cursor="Hand" Margin="0,2" Click="resetPortItem_Click" />
|
|
||||||
<MenuItem x:Name="resetPXItem" Header="恢复默认分辨率" Cursor="Hand" Margin="0,2" Click="resetPXItem_Click" />
|
|
||||||
<MenuItem x:Name="resetDPIItem" Header="恢复默认DPI" Cursor="Hand" Margin="0,2" Click="resetDPIItem_Click"/>
|
|
||||||
</MenuItem>
|
|
||||||
<Separator Margin="0,5"/>
|
|
||||||
<MenuItem x:Name="disconnectAllDeviceItem" Header="断开所有设备" Click="disconnectAllDeviceItem_Click" Cursor="Hand" Margin="0,2" />
|
|
||||||
</ContextMenu>
|
|
||||||
<ContextMenu x:Key="ComboBoxItemContextMenu" FontSize="13">
|
|
||||||
<MenuItem x:Name="deleteHistory" Header="删除记录" Cursor="Hand" Margin="0,2" Click="deleteHistory_Click"/>
|
|
||||||
<Separator Margin="0,5"/>
|
|
||||||
<MenuItem x:Name="deleteAllHistory" Header="清空所有记录" Click="deleteAllHistory_Click" Cursor="Hand" Margin="0,2"/>
|
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<Window.InputBindings>
|
|
||||||
<KeyBinding Command="{x:Static local:MainWindow.CommandF5}"
|
|
||||||
Key="F5"/>
|
|
||||||
<KeyBinding Command="{x:Static local:MainWindow.CommandF8}"
|
|
||||||
Key="F8"/>
|
|
||||||
</Window.InputBindings>
|
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="30"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<RowDefinition Height="auto"/>
|
</Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="*"/>
|
<Grid Grid.Column="0" Grid.ColumnSpan="3">
|
||||||
</Grid.RowDefinitions>
|
<Label Content="已连接列表(每10秒自动刷新)" Margin="10,125,10,0" VerticalAlignment="Top" HorizontalContentAlignment="Center"/>
|
||||||
<Grid Grid.Row="0" x:Name="menuHeader" Background="#FFF6F6F6">
|
<ListBox x:Name="deviceList" Margin="10,160,10,10" ToolTip="右键连接的设备进行操作">
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="30"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
|
||||||
<Button x:Name="setup" Content="设置" Cursor="Hand" Background="{x:Null}" Margin="10,0,0,0" Click="setup_Click"/>
|
|
||||||
<Popup x:Name="setup_popup" Placement="Bottom" PlacementTarget="{Binding ElementName=setup}" StaysOpen="False" HorizontalOffset="0" VerticalOffset="0" AllowsTransparency="True">
|
|
||||||
<Border Background="{Binding ElementName=menuHeader,Path=Background}" Padding="10" CornerRadius="0,0,5,5" BorderBrush="#FF06AB26" BorderThickness="1,0,1,1">
|
|
||||||
<StackPanel>
|
|
||||||
<CheckBox IsChecked="False" x:Name="topmastCB" Content="置顶显示" Cursor="Hand" Click="topmastCB_Click" VerticalContentAlignment="Center" HorizontalAlignment="Left" FontSize="14"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
</Popup>
|
|
||||||
|
|
||||||
<Button x:Name="about" Content="关于" Cursor="Hand" Background="{x:Null}" Margin="10,0,0,0" Click="about_Click"/>
|
|
||||||
<Popup x:Name="about_popup" Placement="Bottom" PlacementTarget="{Binding ElementName=about}" StaysOpen="False" HorizontalOffset="0" VerticalOffset="0" AllowsTransparency="True">
|
|
||||||
<Border Background="{Binding ElementName=menuHeader,Path=Background}" Padding="10" CornerRadius="0,0,5,5" BorderBrush="#FF06AB26" BorderThickness="1,0,1,1">
|
|
||||||
<StackPanel Cursor="">
|
|
||||||
<Button x:Name="projectAddress" Content="项目地址" Background="{x:Null}" Click="projectAddress_Click" HorizontalAlignment="Left" Cursor="Hand" FontSize="14"/>
|
|
||||||
<Button x:Name="cheackUpdate" Content="检查更新" Margin="0,10,0,0" Background="{x:Null}" Click="cheackUpdate_Click" HorizontalAlignment="Left" Cursor="Hand" FontSize="14"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
</Popup>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<Image x:Name="updateVersion" Grid.Column="1" Visibility="Collapsed" Source="/resource/imgs/new_version.png" VerticalAlignment="Center" HorizontalAlignment="Center" Width="25" Height="25" MouseDown="updateVersion_MouseDown" />
|
|
||||||
</Grid>
|
|
||||||
<Grid Grid.Row="1" Grid.ColumnSpan="3" Margin="0,0,0,10">
|
|
||||||
<Label Content="IP和端口" Margin="10,10,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Center" HorizontalAlignment="Left" Width="85"/>
|
|
||||||
<ComboBox x:Name="deviceAddress" IsEditable="True" ToolTip="示例:192.168.0.1:5555,使用英文【:】连接IP和端口" Margin="100,10,10,0" IsSynchronizedWithCurrentItem="False" Height="30" VerticalAlignment="Top" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderBrush="{x:Null}" Background="{x:Null}" TabIndex="0" >
|
|
||||||
<ComboBox.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<TextBlock Text="{Binding}" ContextMenu="{StaticResource ComboBoxItemContextMenu}" Cursor="Hand" Margin="0,0,0,0"/>
|
|
||||||
</DataTemplate>
|
|
||||||
</ComboBox.ItemTemplate>
|
|
||||||
</ComboBox>
|
|
||||||
<Label Content="配对码" Margin="10,50,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Center" HorizontalAlignment="Left" Width="85"/>
|
|
||||||
<TextBox x:Name="pairCode" Margin="100,50,10,0" Height="30" ToolTip="配对设备时输入配对码" VerticalAlignment="Top" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" MaxLength="10" TabIndex="1"/>
|
|
||||||
<Button x:Name="connectDevice" IsDefault="True" Content="连接(Enter)" ToolTip="输入连接的IP和端口进行连接" Foreground="White" Background="#FF2A9FFF" Margin="10,90,0,0" VerticalAlignment="Top" Height="30" HorizontalAlignment="Left" Width="100" Click="connectDevice_Click" Cursor="Hand" TabIndex="2"/>
|
|
||||||
<Button x:Name="refreshList" Content="刷新(F5)" ToolTip="刷新已连接列表" Margin="0,90,0,10" Width="100" Cursor="Hand" Height="30" VerticalAlignment="Bottom" Click="refreshList_Click" Foreground="White" BorderBrush="{x:Null}" Background="#FF06AB26" TabIndex="5"/>
|
|
||||||
<Button x:Name="pairDevice" Content="配对(F8)" ToolTip="输入配对的IP和端口进行配对" Margin="0,90,10,0" Foreground="White" Background="#FFE87D00" VerticalAlignment="Top" Height="30" HorizontalAlignment="Right" Width="100" Click="pairDevice_Click" Cursor="Hand" TabIndex="3"/>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Grid Grid.Row="2" Grid.ColumnSpan="3">
|
|
||||||
<Label Content="连接列表" Margin="10,0,10,0" VerticalAlignment="Top" HorizontalContentAlignment="Center"/>
|
|
||||||
<ListBox x:Name="deviceList" Margin="10,35,10,10" ToolTip="右键连接的设备进行操作" ItemsSource="{Binding}" HorizontalContentAlignment="Center" TabIndex="4" ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
|
|
||||||
<ListBox.ItemsPanel>
|
|
||||||
<ItemsPanelTemplate>
|
|
||||||
<VirtualizingStackPanel Orientation="Vertical" />
|
|
||||||
</ItemsPanelTemplate>
|
|
||||||
</ListBox.ItemsPanel>
|
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Grid Cursor="Hand" Width="300" Margin="0,5" ContextMenu="{StaticResource ListBoxItemContextMenu}">
|
<TextBlock Text="{Binding}" ContextMenu="{StaticResource ListBoxItemContextMenu}" Cursor="Hand"/>
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="50"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid Grid.Column="0">
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{Binding Path=DeviceInfo, Mode=Default}" TextWrapping="Wrap"/>
|
|
||||||
<TextBlock Text="{Binding Path=DeviceMark, Mode=Default}" TextWrapping="Wrap" Foreground="#FF2A9FFF" FontSize="13"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
<Grid Grid.Column="1" Margin="0">
|
|
||||||
<Label Content="{Binding Path=ConnectWay}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Foreground="{Binding Path=ConnectWayColor}"/>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Grid Grid.RowSpan="3" Visibility="Collapsed" x:Name="processBarGrid" Background="#7F000000" >
|
|
||||||
<customcontrol:RoundProcessBarLoading x:Name="waitProcessBar" Height="130" Width="130"/>
|
|
||||||
<Label Content="处理中" Height="120" Width="120" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
<Grid Grid.Column="0" Grid.ColumnSpan="3">
|
||||||
|
<Label Content="指定连接设备的IP和端口" Margin="10,10,10,0" VerticalAlignment="Top" HorizontalContentAlignment="Center"/>
|
||||||
|
<ComboBox x:Name="deviceAddress" IsEditable="True" Margin="10,45,10,0" Height="30" VerticalAlignment="Top" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
|
||||||
|
<Button x:Name="connectDevice" Content="连接设备" ToolTip="输入连接的IP和端口进行连接" Margin="10,85,0,0" VerticalAlignment="Top" Height="30" HorizontalAlignment="Left" Width="90" Click="connectDevice_Click" Cursor="Hand"/>
|
||||||
|
<Button x:Name="deleteAllHistory" ToolTip="删除所有历史记录" Content="清空历史" Margin="0,85,0,0" VerticalAlignment="Top" Height="30" HorizontalAlignment="Center" Width="90" Click="deleteAllHistory_Click" Cursor="Hand"/>
|
||||||
|
<Button x:Name="pairDevice" Content="配对设备" ToolTip="输入配对的IP和端口进行配对" Margin="0,85,10,0" VerticalAlignment="Top" Height="30" HorizontalAlignment="Right" Width="90" Click="pairDevice_Click" Cursor="Hand"/>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
using AdbTools.AccessInterface;
|
using Microsoft.Win32;
|
||||||
using AdbTools.bean;
|
|
||||||
using Microsoft.Win32;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
@ -19,7 +17,6 @@ using System.Windows.Media.Imaging;
|
|||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using Update;
|
|
||||||
|
|
||||||
namespace AdbTools
|
namespace AdbTools
|
||||||
{
|
{
|
||||||
@ -28,57 +25,17 @@ namespace AdbTools
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MainWindow : Window
|
public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
public static RoutedCommand CommandF5 = new RoutedCommand();
|
private string adbPath = "";
|
||||||
public static RoutedCommand CommandF8 = new RoutedCommand();
|
private DispatcherTimer timer;
|
||||||
|
|
||||||
|
|
||||||
public static string adbPath = "";
|
|
||||||
//private DispatcherTimer timer;
|
|
||||||
private ObservableCollection<string> deviceAddressHistory;
|
private ObservableCollection<string> deviceAddressHistory;
|
||||||
private ObservableCollection<Device> deviceAddressList;
|
private ObservableCollection<string> deviceAddressList;
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
deviceAddressHistory = new ObservableCollection<string>();
|
deviceAddressHistory = new ObservableCollection<string>();
|
||||||
deviceAddressList = new ObservableCollection<Device>();
|
deviceAddressList = new ObservableCollection<string>();
|
||||||
|
|
||||||
// 创建 CommandBinding 并绑定到处理程序
|
|
||||||
CommandBinding commandF5Binding = new CommandBinding(
|
|
||||||
CommandF5,
|
|
||||||
CommandF5_Executed,
|
|
||||||
CommandF5_CanExecute);
|
|
||||||
|
|
||||||
CommandBinding commandF8Binding = new CommandBinding(
|
|
||||||
CommandF8,
|
|
||||||
CommandF8_Executed,
|
|
||||||
CommandF8_CanExecute);
|
|
||||||
|
|
||||||
|
|
||||||
this.CommandBindings.Add(commandF5Binding);
|
|
||||||
this.CommandBindings.Add(commandF8Binding);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CommandF5_Executed(object sender, ExecutedRoutedEventArgs e)
|
|
||||||
{
|
|
||||||
Timer_Tick(null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CommandF5_CanExecute(object sender, CanExecuteRoutedEventArgs e)
|
|
||||||
{
|
|
||||||
e.CanExecute = true; // 始终可以执行
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CommandF8_Executed(object sender, ExecutedRoutedEventArgs e)
|
|
||||||
{
|
|
||||||
pairDevice_Click(null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CommandF8_CanExecute(object sender, CanExecuteRoutedEventArgs e)
|
|
||||||
{
|
|
||||||
e.CanExecute = true; // 始终可以执行
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshDeviceAddressHistory()
|
private void refreshDeviceAddressHistory()
|
||||||
@ -93,7 +50,6 @@ namespace AdbTools
|
|||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.Title = $"{this.Title} V{App.Version}";
|
|
||||||
//adb相关资源文件
|
//adb相关资源文件
|
||||||
string path = AppDomain.CurrentDomain.BaseDirectory + "adb.exe";
|
string path = AppDomain.CurrentDomain.BaseDirectory + "adb.exe";
|
||||||
string adbDll1 = AppDomain.CurrentDomain.BaseDirectory + "AdbWinApi.dll";
|
string adbDll1 = AppDomain.CurrentDomain.BaseDirectory + "AdbWinApi.dll";
|
||||||
@ -104,13 +60,6 @@ namespace AdbTools
|
|||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Globals.AppSettings.IS_GITHUB_PROXY)
|
|
||||||
{
|
|
||||||
Globals.AppSettings.GITHUB_PROXY = Globals.AppSettings.GITHUB_PROXY;
|
|
||||||
}
|
|
||||||
|
|
||||||
RequestJson.UpdateCheck(this, updateVersion);
|
|
||||||
|
|
||||||
adbPath = $"\"{path}\"";
|
adbPath = $"\"{path}\"";
|
||||||
|
|
||||||
deviceAddress.Text = Globals.AppSettings.LAST_DEVICE_ADDRESS;
|
deviceAddress.Text = Globals.AppSettings.LAST_DEVICE_ADDRESS;
|
||||||
@ -119,139 +68,65 @@ namespace AdbTools
|
|||||||
|
|
||||||
deviceList.ItemsSource = deviceAddressList;
|
deviceList.ItemsSource = deviceAddressList;
|
||||||
|
|
||||||
//timer = new DispatcherTimer();
|
timer = new DispatcherTimer();
|
||||||
//timer.Interval = TimeSpan.FromSeconds(3);
|
timer.Interval = TimeSpan.FromSeconds(10);
|
||||||
//timer.Tick += Timer_Tick;
|
timer.Tick += Timer_Tick;
|
||||||
//timer.Start();
|
timer.Start();
|
||||||
|
|
||||||
Timer_Tick(null, null);
|
Timer_Tick(null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Timer_Tick(object sender, EventArgs e)
|
private void Timer_Tick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
waitAnimation(true);
|
deviceAddressList.Clear();
|
||||||
string command = $"{adbPath} devices";
|
string content = CmdExecutor.ExecuteCommandAndReturn($"{adbPath} devices");
|
||||||
CmdExecutor.ExecuteCommandAndReturnAsync(command, content =>
|
// 定义正则表达式模式
|
||||||
|
string pattern = @"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d+\b";
|
||||||
|
// 创建 Regex 对象
|
||||||
|
Regex regex = new Regex(pattern);
|
||||||
|
// 查找所有匹配项
|
||||||
|
MatchCollection matches = regex.Matches(content);
|
||||||
|
// 输出所有匹配项
|
||||||
|
foreach (Match match in matches)
|
||||||
{
|
{
|
||||||
// 输出所有匹配项
|
deviceAddressList.Add(match.Value.Trim());
|
||||||
int index = 0;
|
}
|
||||||
List<string> list = new List<string>();
|
|
||||||
string[] str = content.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
for (int i = 0; i < str.Length; ++i)
|
|
||||||
{
|
|
||||||
if (str[i].EndsWith("device"))
|
|
||||||
{
|
|
||||||
string address = str[i].Replace("device", "").Trim();
|
|
||||||
list.Add(address);
|
|
||||||
Device d = null;
|
|
||||||
if (!deviceAddressList.Any(o =>
|
|
||||||
{
|
|
||||||
d = o;
|
|
||||||
return o.DeviceMark.Equals(address);
|
|
||||||
}))
|
|
||||||
{
|
|
||||||
Device device = new Device()
|
|
||||||
{
|
|
||||||
IsWifiConnect = IsValidIPEndPoint(address),
|
|
||||||
DeviceMark = address,
|
|
||||||
ShowDeviceName = address
|
|
||||||
};
|
|
||||||
|
|
||||||
deviceAddressList.Insert(index, device);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
deviceAddressList.Remove(d);
|
|
||||||
deviceAddressList.Insert(index, d);
|
|
||||||
}
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Device> removeList = deviceAddressList.Where(o => !list.Contains(o.DeviceMark)).ToList();
|
|
||||||
removeList.ForEach(o => deviceAddressList.Remove(o));
|
|
||||||
foreach (Device d in deviceAddressList)
|
|
||||||
{
|
|
||||||
d.Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
waitAnimation(false);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Unloaded(object sender, RoutedEventArgs e)
|
private void Window_Unloaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
timer.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void connectDevice_Click(object sender, RoutedEventArgs e)
|
private void connectDevice_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
string address = deviceAddress.Text;
|
string address = deviceAddress.Text;
|
||||||
address = address.Replace(":", ":");
|
|
||||||
deviceAddress.Text = address;
|
|
||||||
if (!IsValidIPEndPoint(address))
|
if (!IsValidIPEndPoint(address))
|
||||||
{
|
{
|
||||||
MessageBox.Show("设备连接地址输入错误!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
MessageBox.Show("设备连接地址输入错误!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
waitAnimation(true);
|
CmdExecutor.ExecuteCommandAndQuit($"{adbPath} connect {address}");
|
||||||
CmdExecutor.ExecuteCommandAndReturnAsync($"{adbPath} connect {address}", result =>
|
Globals.AppSettings.LAST_DEVICE_ADDRESS = $"{address}";
|
||||||
|
if (!Globals.AppSettings.DEVICE_ADDRESS_HISTORY.Contains(address))
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(result) || ContainsAny(result, new string[] { "(10060)", "(10061)", "failed to connect" }))
|
Globals.AppSettings.DEVICE_ADDRESS_HISTORY.Insert(0, address);
|
||||||
{
|
Globals.AppSettings.DEVICE_ADDRESS_HISTORY = Globals.AppSettings.DEVICE_ADDRESS_HISTORY;
|
||||||
waitAnimation(false);
|
|
||||||
MessageBox.Show("设备连接失败!\r\n1.请检查IP和端口输入是否正确;\r\n2.设备与电脑是否完成配对。", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Globals.AppSettings.LAST_DEVICE_ADDRESS = $"{address}";
|
|
||||||
|
|
||||||
string ip = address.Split(':')[0];
|
|
||||||
List<string> list = Globals.AppSettings.DEVICE_ADDRESS_HISTORY.Where(item => !item.StartsWith(ip)).ToList();
|
|
||||||
list.Insert(0, address);
|
|
||||||
Globals.AppSettings.DEVICE_ADDRESS_HISTORY = list;
|
|
||||||
refreshDeviceAddressHistory();
|
refreshDeviceAddressHistory();
|
||||||
deviceAddress.Text = Globals.AppSettings.LAST_DEVICE_ADDRESS;
|
}
|
||||||
|
Timer_Tick(null, null);
|
||||||
Timer_Tick(null, null);
|
|
||||||
waitAnimation(false);
|
|
||||||
|
|
||||||
}, (err) =>
|
|
||||||
{
|
|
||||||
waitAnimation(false);
|
|
||||||
MessageBox.Show("设备连接失败!\r\n1.请检查IP和端口输入是否正确;\r\n2.设备与电脑是否完成配对。", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pairDevice_Click(object sender, RoutedEventArgs e)
|
private void pairDevice_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
string address = deviceAddress.Text;
|
string address = deviceAddress.Text;
|
||||||
address = address.Replace(":", ":");
|
|
||||||
deviceAddress.Text = address;
|
|
||||||
string code = pairCode.Text;
|
|
||||||
if (!IsValidIPEndPoint(address))
|
if (!IsValidIPEndPoint(address))
|
||||||
{
|
{
|
||||||
MessageBox.Show("设备配对地址输入错误!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
MessageBox.Show("设备配对地址输入错误!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (string.IsNullOrWhiteSpace(code))
|
CmdExecutor.ExecuteCommandByShell($"{adbPath} pair {address}");
|
||||||
{
|
|
||||||
MessageBox.Show("请输入配对码!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
waitAnimation(true);
|
|
||||||
CmdExecutor.ExecuteCommandAndReturnAsync(new string[] { $"{adbPath} pair {address}", code }, result =>
|
|
||||||
{
|
|
||||||
waitAnimation(false);
|
|
||||||
if (string.IsNullOrWhiteSpace(result) || !ContainsAny(result, new string[] { "Successfully" }))
|
|
||||||
{
|
|
||||||
MessageBox.Show("设备配对失败!\r\n1.确认IP地址和端口是否处于配对状态;\r\n2.配对码输入是否正确。", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (ContainsAny(result, new string[] { "Successfully" }))
|
|
||||||
{
|
|
||||||
MessageBox.Show("设备配对成功!", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk);
|
|
||||||
}
|
|
||||||
}, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private string SelectApkFile()
|
private string SelectApkFile()
|
||||||
@ -271,9 +146,10 @@ namespace AdbTools
|
|||||||
|
|
||||||
private void installApkItem_Click(object sender, RoutedEventArgs e)
|
private void installApkItem_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
int index = deviceList.SelectedIndex;
|
var menuItem = (MenuItem)sender;
|
||||||
Device device = deviceAddressList[index];
|
var contextMenu = (ContextMenu)menuItem.Parent;
|
||||||
if (MessageBoxResult.OK != MessageBox.Show($"确定要安装应用到设备【{device.ShowDeviceName}】吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question))
|
var textBlock = (TextBlock)contextMenu.PlacementTarget;
|
||||||
|
if (MessageBoxResult.OK != MessageBox.Show($"确定要安装应用到【{textBlock.Text}】吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -282,63 +158,33 @@ namespace AdbTools
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
waitAnimation(true);
|
CmdExecutor.ExecuteCommandByShell($"{adbPath} -s {textBlock.Text} install \"{path}\"");
|
||||||
CmdExecutor.ExecuteCommandAndReturnAsync(new string[] { $"{adbPath} -s {device.DeviceMark} install \"{path}\"" }, result =>
|
|
||||||
{
|
|
||||||
waitAnimation(false);
|
|
||||||
if (!string.IsNullOrWhiteSpace(result) && ContainsAny(result, new string[] { "Success" }))
|
|
||||||
{
|
|
||||||
MessageBox.Show($"设备【{device.ShowDeviceName}】安装应用成功!", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
err =>
|
|
||||||
{
|
|
||||||
waitAnimation(false);
|
|
||||||
if (!string.IsNullOrWhiteSpace(err) && ContainsAny(err, new string[] { "adb: failed to install", "device offline" }))
|
|
||||||
{
|
|
||||||
MessageBox.Show($"设备【{device.ShowDeviceName}】安装应用失败!\r\n1.请确认安卓设备是否允许安装应用;\r\n2.应用签名是否不符;\r\n3.检查设备是否已离线。", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}, 600);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void disconnectDeviceItem_Click(object sender, RoutedEventArgs e)
|
private void disconnectDeviceItem_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
int index = deviceList.SelectedIndex;
|
var menuItem = (MenuItem)sender;
|
||||||
Device device = deviceAddressList[index];
|
var contextMenu = (ContextMenu)menuItem.Parent;
|
||||||
|
var textBlock = (TextBlock)contextMenu.PlacementTarget;
|
||||||
if (MessageBoxResult.OK != MessageBox.Show($"确定要断开设备【{device.ShowDeviceName}】的连接吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question))
|
if (MessageBoxResult.OK != MessageBox.Show($"确定要断开设备【{textBlock.Text}】的连接吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
waitAnimation(true);
|
CmdExecutor.ExecuteCommandAndQuit($"{adbPath} disconnect {textBlock.Text}");
|
||||||
CmdExecutor.ExecuteCommandAndReturnAsync($"{adbPath} disconnect {device.DeviceMark}", result =>
|
Timer_Tick(null, null);
|
||||||
{
|
|
||||||
Timer_Tick(null, null);
|
|
||||||
waitAnimation(false);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void disconnectAllDeviceItem_Click(object sender, RoutedEventArgs e)
|
private void disconnectAllDeviceItem_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (MessageBoxResult.OK == MessageBox.Show("确定要【断开所有设备】吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question))
|
if (MessageBoxResult.OK == MessageBox.Show("确定要断开所有设备吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question))
|
||||||
{
|
{
|
||||||
waitAnimation(true);
|
CmdExecutor.ExecuteCommandAndQuit($"{adbPath} disconnect");
|
||||||
CmdExecutor.ExecuteCommandAndReturnAsync($"{adbPath} disconnect", result =>
|
Timer_Tick(null, null);
|
||||||
{
|
|
||||||
Timer_Tick(null, null);
|
|
||||||
waitAnimation(false);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsValidIPEndPoint(string ipPort)
|
public static bool IsValidIPEndPoint(string ipPort)
|
||||||
{
|
{
|
||||||
if (ipPort.Contains("._adb-tls-connect._tcp"))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
string[] parts = ipPort.Split(':');
|
string[] parts = ipPort.Split(':');
|
||||||
if (parts.Length > 2)
|
if (parts.Length > 2)
|
||||||
{
|
{
|
||||||
@ -376,23 +222,9 @@ namespace AdbTools
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteHistory_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
var menuItem = (MenuItem)sender;
|
|
||||||
var contextMenu = (ContextMenu)menuItem.Parent;
|
|
||||||
var textBlock = (TextBlock)contextMenu.PlacementTarget;
|
|
||||||
if (MessageBoxResult.OK != MessageBox.Show($"确定要删除记录【{textBlock.Text}】吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Globals.AppSettings.DEVICE_ADDRESS_HISTORY.Remove(textBlock.Text);
|
|
||||||
Globals.AppSettings.DEVICE_ADDRESS_HISTORY = Globals.AppSettings.DEVICE_ADDRESS_HISTORY;
|
|
||||||
refreshDeviceAddressHistory();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void deleteAllHistory_Click(object sender, RoutedEventArgs e)
|
private void deleteAllHistory_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (MessageBoxResult.OK == MessageBox.Show("确定要【清空所有历史纪录】吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question))
|
if (MessageBoxResult.OK == MessageBox.Show("确定要清空所有历史纪录吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question))
|
||||||
{
|
{
|
||||||
Globals.AppSettings.DEVICE_ADDRESS_HISTORY.Clear();
|
Globals.AppSettings.DEVICE_ADDRESS_HISTORY.Clear();
|
||||||
Globals.AppSettings.DEVICE_ADDRESS_HISTORY = Globals.AppSettings.DEVICE_ADDRESS_HISTORY;
|
Globals.AppSettings.DEVICE_ADDRESS_HISTORY = Globals.AppSettings.DEVICE_ADDRESS_HISTORY;
|
||||||
@ -400,199 +232,5 @@ namespace AdbTools
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ContainsAny(string source, params string[] substrings)
|
|
||||||
{
|
|
||||||
return substrings.Any(substring => source.Contains(substring));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void waitAnimation(bool show)
|
|
||||||
{
|
|
||||||
if (show)
|
|
||||||
{
|
|
||||||
processBarGrid.Visibility = Visibility.Visible;
|
|
||||||
waitProcessBar.IsShowAnimation = show;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
processBarGrid.Visibility = Visibility.Collapsed;
|
|
||||||
waitProcessBar.IsShowAnimation = show;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void refreshList_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
Timer_Tick(null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void resetPortItem_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
int index = deviceList.SelectedIndex;
|
|
||||||
Device device = deviceAddressList[index];
|
|
||||||
if (MessageBoxResult.OK == MessageBox.Show($"确定要对设备【{device.ShowDeviceName}】执行【恢复默认TCP端口(5555)】吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question))
|
|
||||||
{
|
|
||||||
waitAnimation(true);
|
|
||||||
CmdExecutor.ExecuteCommandAndReturnAsync(new string[] { $"{adbPath} -s {device.DeviceMark} tcpip 5555 " }, result =>
|
|
||||||
{
|
|
||||||
waitAnimation(false);
|
|
||||||
MessageBox.Show($"设备【{device.ShowDeviceName}】恢复默认TCP端口(5555)成功", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk);
|
|
||||||
},
|
|
||||||
err =>
|
|
||||||
{
|
|
||||||
waitAnimation(false);
|
|
||||||
MessageBox.Show($"设备【{device.ShowDeviceName}】恢复默认TCP端口(5555)失败!\r\n检查设备是否已离线。", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void resetPXItem_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
int index = deviceList.SelectedIndex;
|
|
||||||
Device device = deviceAddressList[index];
|
|
||||||
if (MessageBoxResult.OK == MessageBox.Show($"确定要对设备【{device.ShowDeviceName}】执行【恢复默认分辨率】吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question))
|
|
||||||
{
|
|
||||||
waitAnimation(true);
|
|
||||||
CmdExecutor.ExecuteCommandAndReturnAsync(new string[] { $"{adbPath} -s {device.DeviceMark} shell wm size reset " }, result =>
|
|
||||||
{
|
|
||||||
waitAnimation(false);
|
|
||||||
MessageBox.Show($"设备【{device.ShowDeviceName}】恢复默认分辨率成功", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk);
|
|
||||||
},
|
|
||||||
err =>
|
|
||||||
{
|
|
||||||
waitAnimation(false);
|
|
||||||
MessageBox.Show($"设备【{device.ShowDeviceName}】恢复默认分辨率失败!\r\n检查设备是否已离线。", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void resetDPIItem_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
int index = deviceList.SelectedIndex;
|
|
||||||
Device device = deviceAddressList[index];
|
|
||||||
if (MessageBoxResult.OK == MessageBox.Show($"确定要对设备【{device.ShowDeviceName}】执行【恢复默认DPI】吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question))
|
|
||||||
{
|
|
||||||
waitAnimation(true);
|
|
||||||
CmdExecutor.ExecuteCommandAndReturnAsync(new string[] { $"{adbPath} -s {device.DeviceMark} shell wm density reset " }, result =>
|
|
||||||
{
|
|
||||||
waitAnimation(false);
|
|
||||||
MessageBox.Show($"设备【{device.ShowDeviceName}】恢复默认DPI成功", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk);
|
|
||||||
},
|
|
||||||
err =>
|
|
||||||
{
|
|
||||||
waitAnimation(false);
|
|
||||||
MessageBox.Show($"设备【{device.ShowDeviceName}】恢复默认DPI失败!\r\n检查设备是否已离线。", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void logcatItem_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
int index = deviceList.SelectedIndex;
|
|
||||||
Device device = deviceAddressList[index];
|
|
||||||
CmdExecutor.ExecuteCommandByShell($"{adbPath} -s {device.DeviceMark} logcat");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void logcatDebugItem_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
int index = deviceList.SelectedIndex;
|
|
||||||
Device device = deviceAddressList[index];
|
|
||||||
CmdExecutor.ExecuteCommandByShell($"{adbPath} -s {device.DeviceMark} logcat -s DEBUG");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 《版本更新》
|
|
||||||
|
|
||||||
private void updateVersion_MouseDown(object sender, MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.LeftButton == MouseButtonState.Pressed)
|
|
||||||
{
|
|
||||||
GithubReleases githubReleases = (GithubReleases)updateVersion.Tag;
|
|
||||||
UpdateVersion(githubReleases);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateVersion(GithubReleases githubReleases)
|
|
||||||
{
|
|
||||||
if (null == githubReleases) return;
|
|
||||||
GithubReleasesAssets githubReleasesAssets = null;
|
|
||||||
foreach (GithubReleasesAssets assets in githubReleases.Assets)
|
|
||||||
{
|
|
||||||
if (RequestJson.UpdateFileName.Equals(assets.Name, StringComparison.CurrentCultureIgnoreCase))
|
|
||||||
{
|
|
||||||
githubReleasesAssets = assets;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (null == githubReleasesAssets)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
updateVersion.Visibility = Visibility.Visible;
|
|
||||||
updateVersion.Tag = githubReleases;
|
|
||||||
|
|
||||||
if (MessageBoxResult.OK != MessageBox.Show($"发现新版本【V{githubReleases.Name}】是否更新?", "新版本", MessageBoxButton.OKCancel, MessageBoxImage.Question))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<string> cmdArges = new List<string>();
|
|
||||||
//cmdArges.Add($"{Globals.AppSettings.GITHUB_PROXY}{githubReleasesAssets.browser_download_url}");
|
|
||||||
cmdArges.Add($"{githubReleasesAssets.browser_download_url}");
|
|
||||||
cmdArges.Add($"{AppDomain.CurrentDomain.BaseDirectory}");
|
|
||||||
cmdArges.Add($"{AppDomain.CurrentDomain.BaseDirectory}{AppDomain.CurrentDomain.FriendlyName}");
|
|
||||||
|
|
||||||
if (CmdExecutor.StartExe($"{AppDomain.CurrentDomain.BaseDirectory}Update.exe", cmdArges))
|
|
||||||
{
|
|
||||||
Application.Current.Shutdown();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 《关于菜单及控制》
|
|
||||||
|
|
||||||
private void about_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
about_popup.IsOpen = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void projectAddress_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
about_popup.IsOpen = false;
|
|
||||||
CmdExecutor.StartExe("https://github.com/zsjy/AdbTools");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void cheackUpdate_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
about_popup.IsOpen = false;
|
|
||||||
RequestJson.UpdateCheck(this, githubReleases =>
|
|
||||||
{
|
|
||||||
UpdateVersion(githubReleases);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 《设置菜单及控制》
|
|
||||||
|
|
||||||
private void setup_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
setup_popup.IsOpen = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void topmastCB_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
this.Topmost = (bool)topmastCB.IsChecked;
|
|
||||||
setup_popup.IsOpen = false;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,11 +8,11 @@ using System.Windows;
|
|||||||
// 控制。更改这些特性值可修改
|
// 控制。更改这些特性值可修改
|
||||||
// 与程序集关联的信息。
|
// 与程序集关联的信息。
|
||||||
[assembly: AssemblyTitle("AdbTools")]
|
[assembly: AssemblyTitle("AdbTools")]
|
||||||
[assembly: AssemblyDescription("Adb无线连接工具")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("宏尘极客")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("AdbTools")]
|
[assembly: AssemblyProduct("AdbTools")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 宏尘极客 2025")]
|
[assembly: AssemblyCopyright("Copyright © 2025")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
@ -51,5 +51,5 @@ using System.Windows;
|
|||||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||||
//通过使用 "*",如下所示:
|
//通过使用 "*",如下所示:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.1.2")]
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.1.2")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
|
55
AdbTools/Properties/Resources.Designer.cs
generated
55
AdbTools/Properties/Resources.Designer.cs
generated
@ -1,61 +1,68 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// 此代码由工具生成。
|
// 此代码由工具生成。
|
||||||
// 运行时版本:4.0.30319.42000
|
// 运行时版本: 4.0.30319.42000
|
||||||
//
|
//
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
// 对此文件的更改可能导致不正确的行为,如果
|
||||||
// 重新生成代码,这些更改将会丢失。
|
// 重新生成代码,则所做更改将丢失。
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace AdbTools.Properties {
|
|
||||||
using System;
|
namespace AdbTools.Properties
|
||||||
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 一个强类型的资源类,用于查找本地化的字符串等。
|
/// 强类型资源类,用于查找本地化字符串等。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// 此类是由 StronglyTypedResourceBuilder
|
// 此类是由 StronglyTypedResourceBuilder
|
||||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||||
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Resources {
|
internal class Resources
|
||||||
|
{
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
internal Resources() {
|
internal Resources()
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 返回此类使用的缓存的 ResourceManager 实例。
|
/// 返回此类使用的缓存 ResourceManager 实例。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
internal static global::System.Resources.ResourceManager ResourceManager
|
||||||
get {
|
{
|
||||||
if (object.ReferenceEquals(resourceMan, null)) {
|
get
|
||||||
|
{
|
||||||
|
if ((resourceMan == null))
|
||||||
|
{
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AdbTools.Properties.Resources", typeof(Resources).Assembly);
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AdbTools.Properties.Resources", typeof(Resources).Assembly);
|
||||||
resourceMan = temp;
|
resourceMan = temp;
|
||||||
}
|
}
|
||||||
return resourceMan;
|
return resourceMan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 重写当前线程的 CurrentUICulture 属性,对
|
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||||
/// 使用此强类型资源类的所有资源查找执行重写。
|
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Globalization.CultureInfo Culture {
|
internal static global::System.Globalization.CultureInfo Culture
|
||||||
get {
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
return resourceCulture;
|
return resourceCulture;
|
||||||
}
|
}
|
||||||
set {
|
set
|
||||||
|
{
|
||||||
resourceCulture = value;
|
resourceCulture = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
29
AdbTools/Properties/Settings.Designer.cs
generated
29
AdbTools/Properties/Settings.Designer.cs
generated
@ -1,24 +1,27 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// 此代码由工具生成。
|
// This code was generated by a tool.
|
||||||
// 运行时版本:4.0.30319.42000
|
// Runtime Version:4.0.30319.42000
|
||||||
//
|
//
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// 重新生成代码,这些更改将会丢失。
|
// the code is regenerated.
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace AdbTools.Properties {
|
|
||||||
|
namespace AdbTools.Properties
|
||||||
|
{
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.13.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||||
|
{
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
public static Settings Default {
|
public static Settings Default
|
||||||
get {
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
return defaultInstance;
|
return defaultInstance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,140 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
namespace AdbTools.bean
|
|
||||||
{
|
|
||||||
public class Device : INotifyPropertyChanged
|
|
||||||
{
|
|
||||||
|
|
||||||
public string DeviceMark
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string DeviceBrand
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string DeviceModel
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsWifiConnect
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ShowDeviceName
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ConnectWay
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Brush ConnectWayColor
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string DeviceInfo
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void Refresh()
|
|
||||||
{
|
|
||||||
UpdateShow();
|
|
||||||
new Thread(() =>
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(DeviceBrand))
|
|
||||||
{
|
|
||||||
CmdExecutor.ExecuteCommandAndReturnAsync($"{MainWindow.adbPath} -s {DeviceMark} shell getprop ro.product.brand ", result =>
|
|
||||||
{
|
|
||||||
string[] str = result.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
string s = "";
|
|
||||||
for (int i = 0; i < str.Length; ++i)
|
|
||||||
{
|
|
||||||
if (str[i].Contains("shell getprop ro.product.brand") && i < str.Length)
|
|
||||||
{
|
|
||||||
s = str[i + 1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Application.Current.Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
DeviceBrand = s;
|
|
||||||
UpdateShow();
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(DeviceModel))
|
|
||||||
{
|
|
||||||
CmdExecutor.ExecuteCommandAndReturnAsync($"{MainWindow.adbPath} -s {DeviceMark} shell getprop ro.product.model ", result =>
|
|
||||||
{
|
|
||||||
string[] str = result.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
string s = "";
|
|
||||||
for (int i = 0; i < str.Length; ++i)
|
|
||||||
{
|
|
||||||
if (str[i].Contains("shell getprop ro.product.model") && i < str.Length)
|
|
||||||
{
|
|
||||||
s = str[i + 1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Application.Current.Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
DeviceModel = s;
|
|
||||||
UpdateShow();
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}).Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateShow()
|
|
||||||
{
|
|
||||||
string s = "";
|
|
||||||
s += DeviceBrand;
|
|
||||||
s += (string.IsNullOrWhiteSpace(s) ? "" : " ") + DeviceModel;
|
|
||||||
DeviceInfo = s;
|
|
||||||
ConnectWay = IsWifiConnect ? "WiFi" : "USB";
|
|
||||||
ConnectWayColor = IsWifiConnect ? Brushes.Green : Brushes.Orange;
|
|
||||||
|
|
||||||
s += $" {ConnectWay}";
|
|
||||||
s += string.IsNullOrWhiteSpace(s) ? $"{DeviceMark}" : $" ({DeviceMark})";
|
|
||||||
|
|
||||||
ShowDeviceName = s;
|
|
||||||
OnPropertyChanged(string.Empty);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
|
||||||
protected void OnPropertyChanged(string propertyName = null)
|
|
||||||
{
|
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace AdbTools.bean
|
|
||||||
{
|
|
||||||
public class GithubReleases
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 发布的名称
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 上传构件
|
|
||||||
/// </summary>
|
|
||||||
public List<GithubReleasesAssets> Assets { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 发布的说明,Markdown
|
|
||||||
/// </summary>
|
|
||||||
public string Body { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace AdbTools.bean
|
|
||||||
{
|
|
||||||
public class GithubReleasesAssets
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 上传构件名称
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 上传构件下载地址
|
|
||||||
/// </summary>
|
|
||||||
public string browser_download_url { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
BIN
AdbTools/dotNetFx40 在线安装包.exe
Normal file
BIN
AdbTools/dotNetFx40 在线安装包.exe
Normal file
Binary file not shown.
BIN
AdbTools/ico.ico
Normal file
BIN
AdbTools/ico.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.8 KiB |
@ -1,164 +0,0 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
|
|
||||||
|
|
||||||
<Style x:Key="UserButtonStyle" TargetType="{x:Type Button}">
|
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
<Setter Property="Template">
|
|
||||||
<Setter.Value>
|
|
||||||
<ControlTemplate TargetType="{x:Type Button}">
|
|
||||||
<Border x:Name="border" CornerRadius="5" BorderThickness="0" BorderBrush="Black"
|
|
||||||
Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}">
|
|
||||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
||||||
</Border>
|
|
||||||
<ControlTemplate.Triggers>
|
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
|
||||||
<Setter Property="Opacity" Value="0.8" />
|
|
||||||
</Trigger>
|
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
|
||||||
<Setter TargetName="border" Property="Background" Value="#FFCFCFCF" />
|
|
||||||
</Trigger>
|
|
||||||
</ControlTemplate.Triggers>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
|
|
||||||
<Style x:Key="UserMenuItemStyle" TargetType="{x:Type MenuItem}">
|
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style x:Key="UserLabelStyle" TargetType="{x:Type Label}">
|
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style x:Key="UserGridStyle" TargetType="{x:Type Grid}">
|
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style x:Key="UserComboBoxItem" TargetType="{x:Type ComboBoxItem}">
|
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<!--<Style x:Key="UserComboBox" TargetType="{x:Type ComboBox}">
|
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
</Style>-->
|
|
||||||
|
|
||||||
<Style x:Key="UserTextBox" TargetType="{x:Type TextBox}">
|
|
||||||
<Setter Property="Template">
|
|
||||||
<Setter.Value>
|
|
||||||
<ControlTemplate TargetType="{x:Type TextBox}">
|
|
||||||
<Grid FocusManager.FocusedElement="{Binding ElementName=border}">
|
|
||||||
<Border x:Name="border" CornerRadius="5" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
|
|
||||||
<ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<!--ComboBox-->
|
|
||||||
<!--ComBoBox toggleButton样式-->
|
|
||||||
<ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
|
|
||||||
<Grid Height="25" >
|
|
||||||
<Border Grid.Column="1" Background="Transparent" Opacity="0" Cursor="Hand"/>
|
|
||||||
<Border Padding="0 0 5 0">
|
|
||||||
<Path x:Name="Arrow" Grid.Column="1" Data="M 0 0 6 6 12 0 Z" VerticalAlignment="Center" HorizontalAlignment="Right" Stretch="None" Fill="#FFB1B1B1" />
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
<ControlTemplate.Triggers>
|
|
||||||
<Trigger Property="IsChecked" Value="true">
|
|
||||||
<Setter TargetName="Arrow" Property="RenderTransform">
|
|
||||||
<Setter.Value>
|
|
||||||
<RotateTransform CenterX="6" CenterY="3" Angle="180"></RotateTransform>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
<Setter TargetName="Arrow" Property="Margin" Value="0 0 0 2"/>
|
|
||||||
</Trigger>
|
|
||||||
</ControlTemplate.Triggers>
|
|
||||||
</ControlTemplate>
|
|
||||||
<Style x:Key="UserComboBox" TargetType="{x:Type ComboBox}">
|
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
<Setter Property="ItemContainerStyle">
|
|
||||||
<Setter.Value>
|
|
||||||
<Style TargetType="ComboBoxItem">
|
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
<Setter Property="Height" Value="auto"/>
|
|
||||||
<Setter Property="MinHeight" Value="25"/>
|
|
||||||
<Setter Property="Template">
|
|
||||||
<Setter.Value>
|
|
||||||
<ControlTemplate TargetType="{x:Type ComboBoxItem}">
|
|
||||||
<Grid Height="{TemplateBinding Height}" Width="{TemplateBinding Width}">
|
|
||||||
<Border x:Name="_borderbg" Background="Transparent"/>
|
|
||||||
<TextBlock Margin="3 0 3 0" VerticalAlignment="Center" x:Name="_txt" Foreground="#e6e6e6" Text="{Binding Content,RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Center"/>
|
|
||||||
<Border x:Name="_border" Background="White" Opacity="0"/>
|
|
||||||
</Grid>
|
|
||||||
<ControlTemplate.Triggers>
|
|
||||||
<Trigger Property="IsSelected" Value="true">
|
|
||||||
<Setter TargetName="_borderbg" Property="Background" Value="#FF69B6FF" />
|
|
||||||
<Setter TargetName="_txt" Property="Foreground" Value="White"/>
|
|
||||||
</Trigger>
|
|
||||||
<MultiTrigger>
|
|
||||||
<MultiTrigger.Conditions>
|
|
||||||
<Condition Property="IsSelected" Value="false"/>
|
|
||||||
<Condition Property="IsMouseOver" Value="true"/>
|
|
||||||
</MultiTrigger.Conditions>
|
|
||||||
<Setter TargetName="_borderbg" Property="Background" Value="#FFC1C1C1" />
|
|
||||||
<Setter TargetName="_txt" Property="Foreground" Value="White"/>
|
|
||||||
</MultiTrigger>
|
|
||||||
|
|
||||||
</ControlTemplate.Triggers>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
</Style>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
<Setter Property="Template">
|
|
||||||
<Setter.Value>
|
|
||||||
<ControlTemplate TargetType="{x:Type ComboBox}">
|
|
||||||
<Border Padding="0">
|
|
||||||
<Grid Background="Transparent">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="0.7*"/>
|
|
||||||
<ColumnDefinition Width="20" MaxWidth="30"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Border x:Name="_borderbg" Grid.Column="0" Grid.ColumnSpan="2" Background="{TemplateBinding Background}" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="3"/>
|
|
||||||
<ContentPresenter Grid.Column="0" HorizontalAlignment="Center" Margin="3" x:Name="ContentSite" VerticalAlignment="Center" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" IsHitTestVisible="False"/>
|
|
||||||
|
|
||||||
<!--ToggleButton 已数据绑定到 ComboBox 本身以切换 IsDropDownOpen-->
|
|
||||||
<ToggleButton Grid.Column="0" Grid.ColumnSpan="2" Template="{StaticResource ComboBoxToggleButton}" x:Name="ToggleButton" Focusable="false" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"/>
|
|
||||||
<!--必须将 TextBox 命名为 PART_EditableTextBox,否则 ComboBox 将无法识别它-->
|
|
||||||
<TextBox Visibility="Hidden" BorderThickness="0" Margin="2 0 0 0" x:Name="PART_EditableTextBox" VerticalAlignment="Center" Focusable="True" Background="Transparent" IsReadOnly="{TemplateBinding IsReadOnly}"/>
|
|
||||||
<!--Popup 可显示 ComboBox 中的项列表。IsOpen 已数据绑定到通过 ComboBoxToggleButton 来切换的 IsDropDownOpen-->
|
|
||||||
<Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide">
|
|
||||||
<Grid MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
|
|
||||||
<Border x:Name="DropDownBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1"/>
|
|
||||||
<ScrollViewer Margin="1" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
|
|
||||||
<!--StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True-->
|
|
||||||
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="White"/>
|
|
||||||
</ScrollViewer>
|
|
||||||
</Grid>
|
|
||||||
</Popup>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
<ControlTemplate.Triggers>
|
|
||||||
<Trigger Property="IsEditable" Value="true">
|
|
||||||
<Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" />
|
|
||||||
</Trigger>
|
|
||||||
<!--<MultiTrigger>
|
|
||||||
<MultiTrigger.Conditions>
|
|
||||||
<Condition Property="IsSelected" Value="false"/>
|
|
||||||
<Condition Property="IsMouseOver" Value="true"/>
|
|
||||||
</MultiTrigger.Conditions>
|
|
||||||
<Setter TargetName="_borderbg" Property="Background" Value="#FF1492C0" />
|
|
||||||
<Setter Property="Foreground" Value="White"/>
|
|
||||||
</MultiTrigger>-->
|
|
||||||
</ControlTemplate.Triggers>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
</ResourceDictionary>
|
|
Binary file not shown.
Before Width: | Height: | Size: 5.4 KiB |
4039
AdbToolsSetup.suf
4039
AdbToolsSetup.suf
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
201
LICENSE
201
LICENSE
@ -1,201 +0,0 @@
|
|||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright 2025 宏尘
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
File diff suppressed because one or more lines are too long
41
README.md
41
README.md
@ -1,41 +1,4 @@
|
|||||||
### 开发环境
|
### 使用VS2019开发
|
||||||
> 使用VS2022开发
|
> 依赖`.NET4.0`
|
||||||
>
|
|
||||||
> 依赖 [.NET4.6下载](https://www.microsoft.com/zh-cn/download/details.aspx?id=48137)
|
|
||||||
|
|
||||||
### 运行环境
|
|
||||||
- 需要`.NET4.6`运行时环境;
|
|
||||||
- `64位Windows`电脑运行。
|
|
||||||
|
|
||||||
### 连接准备
|
|
||||||
[观看视频](/docs/videos/1.mp4)
|
|
||||||
#### 开启开发者模式
|
|
||||||
- `设置 - 关于 - 版本号`,连续点击`7次`开启开发者模式;
|
|
||||||
#### 安卓11及以上
|
|
||||||
- `设置 - 系统 - 开发者选项`,找到`无线调试`功能,`连接WiFi`后点击`开启`,进入`无线调试`,查看`IP地址和端口`,使用此地址即可无线连接到设备。
|
|
||||||
- **注:部分设备位置不同,需要自行寻找**
|
|
||||||
|
|
||||||
#### 安卓11以下
|
|
||||||
- `连接WiFi`查看当前设备的`局域网IP地址`,使用此地址即可无线连接到设备,此时无需输入端口号。
|
|
||||||
- **注:过低版本的设备可能无法连接**
|
|
||||||
|
|
||||||
### 安装和使用
|
|
||||||
- 解压到`不含空格和中文`的目录;
|
|
||||||
- 运行`AdbTools.exe`程序,开始使用。
|
|
||||||
|
|
||||||
### 设备配对
|
|
||||||
- `IP和端口`输入框中输入安卓设备`使用配对码配对设备`提供的`IP:Port`地址;
|
|
||||||
- `配对码`输入框中输入`配对码`,点击`配对设备`进行配对。
|
|
||||||
|
|
||||||
### 设备连接
|
|
||||||
- `IP和端口`输入框中输入安卓设备`无线连接`的`IP:Port`地址,支持省略`Port`只输入`IP`,此时端口默认为`5555`;
|
|
||||||
- 点击`连接设备`,等待连接成功。
|
|
||||||
|
|
||||||
### 历史记录
|
|
||||||
- 连接成功的设备会在历史纪录中展示;
|
|
||||||
- `IP和端口`右侧打开下拉选,右键下拉选中的内容,点击菜单进行操作。
|
|
||||||
|
|
||||||
### 安装apk
|
|
||||||
- 右键`已连接列表`中的设备`IP:Port`形式的地址,点击`安装应用`选择需要安装的`apk`程序,等待完成安装。
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,61 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Net;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace Update.AccessInterface
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// post请求
|
|
||||||
/// </summary>
|
|
||||||
public static class RequestJson
|
|
||||||
{
|
|
||||||
|
|
||||||
public static bool DownloadFile(string url, string savePath)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// 创建 HttpWebRequest 对象
|
|
||||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
|
||||||
request.Method = "GET";
|
|
||||||
|
|
||||||
// 发送请求并获取响应
|
|
||||||
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
|
|
||||||
using (Stream responseStream = response.GetResponseStream())
|
|
||||||
using (FileStream fileStream = new FileStream(savePath, FileMode.Create, FileAccess.Write))
|
|
||||||
{
|
|
||||||
// 缓冲区大小(可以根据需要调整)
|
|
||||||
byte[] buffer = new byte[4096];
|
|
||||||
int bytesRead;
|
|
||||||
|
|
||||||
// 从响应流中读取数据并写入文件
|
|
||||||
while ((bytesRead = responseStream.Read(buffer, 0, buffer.Length)) > 0)
|
|
||||||
{
|
|
||||||
fileStream.Write(buffer, 0, bytesRead);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch (WebException ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"WebException: {ex.Message}");
|
|
||||||
if (ex.Response != null)
|
|
||||||
{
|
|
||||||
using (var errorResponse = (HttpWebResponse)ex.Response)
|
|
||||||
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
|
|
||||||
{
|
|
||||||
string errorText = reader.ReadToEnd();
|
|
||||||
Console.WriteLine($"Error details: {errorText}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"Error: {ex.Message}");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<configuration>
|
|
||||||
<startup>
|
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
|
|
||||||
</startup>
|
|
||||||
</configuration>
|
|
@ -1,9 +0,0 @@
|
|||||||
<Application x:Class="Update.App"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:local="clr-namespace:Update"
|
|
||||||
StartupUri="MainWindow.xaml">
|
|
||||||
<Application.Resources>
|
|
||||||
|
|
||||||
</Application.Resources>
|
|
||||||
</Application>
|
|
@ -1,114 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Configuration;
|
|
||||||
using System.Data;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
|
|
||||||
namespace Update
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// App.xaml 的交互逻辑
|
|
||||||
/// </summary>
|
|
||||||
public partial class App : Application
|
|
||||||
{
|
|
||||||
[DllImport("User32.dll")]
|
|
||||||
private static extern bool ShowWindowAsync(System.IntPtr hWnd, int cmdShow);
|
|
||||||
[DllImport("User32.dll")]
|
|
||||||
private static extern bool SetForegroundWindow(System.IntPtr hWnd);
|
|
||||||
|
|
||||||
public static string downloadUrl;
|
|
||||||
public static string unZipPath;
|
|
||||||
public static string startExePath;
|
|
||||||
|
|
||||||
protected override void OnStartup(StartupEventArgs e)
|
|
||||||
{
|
|
||||||
base.OnStartup(e);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (e.Args.Count() < 2)
|
|
||||||
{
|
|
||||||
///退出当前新开进程,不走OnExit方法
|
|
||||||
Environment.Exit(0);
|
|
||||||
//Application.Current.Shutdown();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
downloadUrl = e.Args[0];
|
|
||||||
unZipPath = e.Args[1];
|
|
||||||
if (e.Args.Count() > 2) {
|
|
||||||
startExePath = e.Args[2];
|
|
||||||
}
|
|
||||||
|
|
||||||
Process current = Process.GetCurrentProcess();
|
|
||||||
Process[] createMeetingProcess = Process.GetProcessesByName(current.ProcessName);
|
|
||||||
if (createMeetingProcess.Count() > 1)
|
|
||||||
{
|
|
||||||
HandleRunningInstance(createMeetingProcess[0]);
|
|
||||||
///退出当前新开进程,不走OnExit方法
|
|
||||||
Environment.Exit(0);
|
|
||||||
//Application.Current.Shutdown();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
|
|
||||||
|
|
||||||
//UI线程未捕获异常处理事件(UI主线程)
|
|
||||||
Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
|
|
||||||
//非UI线程未捕获异常处理事件(例如自己创建的一个子线程)
|
|
||||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
|
||||||
//Task线程内未捕获异常处理事件
|
|
||||||
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandleRunningInstance(Process instance)
|
|
||||||
{
|
|
||||||
ShowWindowAsync(instance.MainWindowHandle, 1); //调用api函数,正常显示窗口
|
|
||||||
SetForegroundWindow(instance.MainWindowHandle); //将窗口放置最前端
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
|
|
||||||
{
|
|
||||||
Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
MessageBox.Show("未捕获Task线程异常:" + e.ToString() + "\r\n异常消息:" + e.Exception.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnExit(ExitEventArgs e)
|
|
||||||
{
|
|
||||||
base.OnExit(e);
|
|
||||||
|
|
||||||
Environment.Exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
|
||||||
{
|
|
||||||
Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
MessageBox.Show("未捕获非UI线程异常:" + e.ToString() + "\r\n对象:" + e.ExceptionObject, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
|
|
||||||
{
|
|
||||||
var comException = e.Exception as System.Runtime.InteropServices.COMException;
|
|
||||||
if (comException != null && comException.ErrorCode == -2147221040)
|
|
||||||
{
|
|
||||||
e.Handled = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
e.Handled = true;
|
|
||||||
|
|
||||||
Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
MessageBox.Show("未捕获UI线程异常:" + e.ToString() + "\r\n异常消息:" + e.Exception.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,211 +0,0 @@
|
|||||||
<UserControl x:Class="Update.CustomControl.RoundProcessBarLoading"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignHeight="800" d:DesignWidth="800">
|
|
||||||
<Viewbox>
|
|
||||||
<Grid Height="800" Width="800">
|
|
||||||
<Grid x:Name="animationGrid" Visibility="Collapsed">
|
|
||||||
<Rectangle Name="Rect1" Height="200" Width="120" Fill="#FFC4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:IsLocked="True"/>
|
|
||||||
<Rectangle Name="Rect2" Height="200" Width="120" Fill="#20C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="45"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Name="Rect3" Height="200" Width="120" Fill="#40C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="90"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Name="Rect4" Height="200" Width="120" Fill="#60C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="135"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Name="Rect5" Height="200" Width="120" Fill="#80C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="180"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Name="Rect6" Height="200" Width="120" Fill="#A0C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="225"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Name="Rect7" Height="200" Width="120" Fill="#C0C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="270"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Name="Rect8" Height="200" Width="120" Fill="#E0C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="315"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Grid.Triggers>
|
|
||||||
<EventTrigger RoutedEvent="Page.Loaded">
|
|
||||||
<BeginStoryboard>
|
|
||||||
<Storyboard RepeatBehavior="Forever">
|
|
||||||
<!--Rect1-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect1" Duration="0:0:1" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
|
|
||||||
<!--Rect2-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect2" Duration="0:0:0.125" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
<ColorAnimation BeginTime="0:0:0.125" Storyboard.TargetName="Rect2" Duration="0:0:0.875" Storyboard.TargetProperty="Fill.Color" From="#FFC4C4C4" To="#20C4C4C4"/>
|
|
||||||
|
|
||||||
<!--Rect3-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect3" Duration="0:0:0.250" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
<ColorAnimation BeginTime="0:0:0.250" Storyboard.TargetName="Rect3" Duration="0:0:0.750" Storyboard.TargetProperty="Fill.Color" From="#FFC4C4C4" To="#40C4C4C4"/>
|
|
||||||
|
|
||||||
<!--Rect4-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect4" Duration="0:0:0.375" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
<ColorAnimation BeginTime="0:0:0.375" Storyboard.TargetName="Rect4" Duration="0:0:0.625" Storyboard.TargetProperty="Fill.Color" From="#FFC4C4C4" To="#60C4C4C4"/>
|
|
||||||
|
|
||||||
<!--Rect5-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect5" Duration="0:0:0.500" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
<ColorAnimation BeginTime="0:0:0.500" Storyboard.TargetName="Rect5" Duration="0:0:0.500" Storyboard.TargetProperty="Fill.Color" From="#FFC4C4C4" To="#80C4C4C4"/>
|
|
||||||
|
|
||||||
<!--Rect6-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect6" Duration="0:0:0.625" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
<ColorAnimation BeginTime="0:0:0.625" Storyboard.TargetName="Rect6" Duration="0:0:0.375" Storyboard.TargetProperty="Fill.Color" From="#FFC4C4C4" To="#A0C4C4C4"/>
|
|
||||||
|
|
||||||
<!--Rect7-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect7" Duration="0:0:0.750" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
<ColorAnimation BeginTime="0:0:0.750" Storyboard.TargetName="Rect7" Duration="0:0:0.250" Storyboard.TargetProperty="Fill.Color" From="#FFC4C4C4" To="#C0C4C4C4"/>
|
|
||||||
|
|
||||||
<!--Rect8-->
|
|
||||||
<ColorAnimation BeginTime="0:0:0.0" Storyboard.TargetName="Rect8" Duration="0:0:0.875" Storyboard.TargetProperty="Fill.Color" To="#00C4C4C4"/>
|
|
||||||
<ColorAnimation BeginTime="0:0:0.875" Storyboard.TargetName="Rect8" Duration="0:0:0.125" Storyboard.TargetProperty="Fill.Color" From="#FFC4C4C4" To="#E0C4C4C4"/>
|
|
||||||
</Storyboard>
|
|
||||||
</BeginStoryboard>
|
|
||||||
</EventTrigger>
|
|
||||||
</Grid.Triggers>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Grid x:Name="defaultGrid" Visibility="Visible">
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#FFC4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:IsLocked="True"/>
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#20C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="45"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#40C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="90"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#60C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="135"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#80C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="180"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#A0C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="225"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#C0C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="270"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
|
|
||||||
<Rectangle Height="200" Width="120" Fill="#E0C4C4C4" RadiusY="60" RadiusX="60" VerticalAlignment="Top" d:LayoutOverrides="Width" RenderTransformOrigin="0.5,2">
|
|
||||||
<Rectangle.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="315"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Rectangle.RenderTransform>
|
|
||||||
</Rectangle>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</Viewbox>
|
|
||||||
|
|
||||||
</UserControl>
|
|
@ -1,50 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
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.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace Update.CustomControl
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// RoundProcessBarLoading.xaml 的交互逻辑
|
|
||||||
/// </summary>
|
|
||||||
public partial class RoundProcessBarLoading : UserControl
|
|
||||||
{
|
|
||||||
public RoundProcessBarLoading()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Description("获取或设置是否显示动画")]
|
|
||||||
public bool IsShowAnimation
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value)
|
|
||||||
{
|
|
||||||
this.defaultGrid.Visibility = Visibility.Collapsed;
|
|
||||||
this.animationGrid.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.defaultGrid.Visibility = Visibility.Visible;
|
|
||||||
this.animationGrid.Visibility = Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Visibility.Visible == this.animationGrid.Visibility;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
<Window x:Class="Update.MainWindow"
|
|
||||||
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:Update" xmlns:customcontrol="clr-namespace:Update.CustomControl"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="更新" Height="200" Width="200" FontSize="12" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded">
|
|
||||||
<Grid x:Name="processBarGrid" Background="#7F000000" >
|
|
||||||
<customcontrol:RoundProcessBarLoading x:Name="waitProcessBar" Width="80" Margin="0,20,0,0" Height="80" VerticalAlignment="Top" HorizontalAlignment="Center"/>
|
|
||||||
|
|
||||||
<Label x:Name="tipLabel" Content="处理中" Foreground="White" Margin="10,105,9.6,0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
|
@ -1,123 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
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.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
using Update.AccessInterface;
|
|
||||||
|
|
||||||
namespace Update
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// MainWindow.xaml 的交互逻辑
|
|
||||||
/// </summary>
|
|
||||||
public partial class MainWindow : Window
|
|
||||||
{
|
|
||||||
private Thread thread;
|
|
||||||
private string updateFilePath;
|
|
||||||
|
|
||||||
public MainWindow()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
waitProcessBar.IsShowAnimation = true;
|
|
||||||
updateFilePath = $"{AppDomain.CurrentDomain.BaseDirectory}update.zip";
|
|
||||||
updateTip("正在下载...");
|
|
||||||
thread = new Thread(() =>
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (RequestJson.DownloadFile(App.downloadUrl, updateFilePath))
|
|
||||||
{
|
|
||||||
updateTip("正在解压");
|
|
||||||
Thread.Sleep(1000);
|
|
||||||
ZipFileUtils.UnzipFile(updateFilePath, App.unZipPath);
|
|
||||||
updateTip("更新完成");
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(App.startExePath))
|
|
||||||
{
|
|
||||||
updateTip("启动程序");
|
|
||||||
Thread.Sleep(1000);
|
|
||||||
StartExe(App.startExePath, "");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Thread.Sleep(1000);
|
|
||||||
Quit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
updateTip("下载失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
updateTip("更新失败,请使用全量更新");
|
|
||||||
this.Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
waitProcessBar.IsShowAnimation = false;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
thread.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateTip(string tip)
|
|
||||||
{
|
|
||||||
this.Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
tipLabel.Content = tip;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void StartExe(string exePath, string args)
|
|
||||||
{
|
|
||||||
this.Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
// 创建ProcessStartInfo对象
|
|
||||||
ProcessStartInfo startInfo = new ProcessStartInfo
|
|
||||||
{
|
|
||||||
FileName = exePath,
|
|
||||||
Arguments = args,
|
|
||||||
UseShellExecute = true // 使用操作系统shell启动
|
|
||||||
};
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// 启动外部程序
|
|
||||||
Process.Start(startInfo);
|
|
||||||
|
|
||||||
///退出当前新开进程,不走OnExit方法
|
|
||||||
Environment.Exit(0);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show(ex.Message);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Quit()
|
|
||||||
{
|
|
||||||
this.Dispatcher.Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
Application.Current.Shutdown();
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,55 +0,0 @@
|
|||||||
using System.Reflection;
|
|
||||||
using System.Resources;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Windows;
|
|
||||||
|
|
||||||
// 有关程序集的一般信息由以下
|
|
||||||
// 控制。更改这些特性值可修改
|
|
||||||
// 与程序集关联的信息。
|
|
||||||
[assembly: AssemblyTitle("Update")]
|
|
||||||
[assembly: AssemblyDescription("更新程序")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("宏尘极客")]
|
|
||||||
[assembly: AssemblyProduct("Update")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © 宏尘极客 2025")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
|
||||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
|
||||||
//请将此类型的 ComVisible 特性设置为 true。
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
//若要开始生成可本地化的应用程序,请设置
|
|
||||||
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
|
|
||||||
//例如,如果您在源文件中使用的是美国英语,
|
|
||||||
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
|
|
||||||
//对以下 NeutralResourceLanguage 特性的注释。 更新
|
|
||||||
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
|
|
||||||
|
|
||||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
|
||||||
|
|
||||||
|
|
||||||
[assembly: ThemeInfo(
|
|
||||||
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
|
|
||||||
//(未在页面中找到资源时使用,
|
|
||||||
//或应用程序资源字典中找到时使用)
|
|
||||||
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
|
|
||||||
//(未在页面中找到资源时使用,
|
|
||||||
//、应用程序或任何主题专用资源字典中找到时使用)
|
|
||||||
)]
|
|
||||||
|
|
||||||
|
|
||||||
// 程序集的版本信息由下列四个值组成:
|
|
||||||
//
|
|
||||||
// 主版本
|
|
||||||
// 次版本
|
|
||||||
// 生成号
|
|
||||||
// 修订号
|
|
||||||
//
|
|
||||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
|
||||||
//通过使用 "*",如下所示:
|
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||||
[assembly: AssemblyVersion("1.0.0")]
|
|
||||||
[assembly: AssemblyFileVersion("1.0.0")]
|
|
63
Update/Properties/Resources.Designer.cs
generated
63
Update/Properties/Resources.Designer.cs
generated
@ -1,63 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// 此代码由工具生成。
|
|
||||||
// 运行时版本:4.0.30319.42000
|
|
||||||
//
|
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
|
||||||
// 重新生成代码,这些更改将会丢失。
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace Update.Properties {
|
|
||||||
using System;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 一个强类型的资源类,用于查找本地化的字符串等。
|
|
||||||
/// </summary>
|
|
||||||
// 此类是由 StronglyTypedResourceBuilder
|
|
||||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
|
||||||
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
|
||||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
internal class Resources {
|
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
|
||||||
|
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
|
||||||
internal Resources() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 返回此类使用的缓存的 ResourceManager 实例。
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
|
||||||
get {
|
|
||||||
if (object.ReferenceEquals(resourceMan, null)) {
|
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Update.Properties.Resources", typeof(Resources).Assembly);
|
|
||||||
resourceMan = temp;
|
|
||||||
}
|
|
||||||
return resourceMan;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 重写当前线程的 CurrentUICulture 属性,对
|
|
||||||
/// 使用此强类型资源类的所有资源查找执行重写。
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
internal static global::System.Globalization.CultureInfo Culture {
|
|
||||||
get {
|
|
||||||
return resourceCulture;
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
resourceCulture = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,117 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
</root>
|
|
26
Update/Properties/Settings.Designer.cs
generated
26
Update/Properties/Settings.Designer.cs
generated
@ -1,26 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// 此代码由工具生成。
|
|
||||||
// 运行时版本:4.0.30319.42000
|
|
||||||
//
|
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
|
||||||
// 重新生成代码,这些更改将会丢失。
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace Update.Properties {
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.13.0.0")]
|
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
|
||||||
|
|
||||||
public static Settings Default {
|
|
||||||
get {
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
|
||||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
|
||||||
<Profiles>
|
|
||||||
<Profile Name="(Default)" />
|
|
||||||
</Profiles>
|
|
||||||
<Settings />
|
|
||||||
</SettingsFile>
|
|
@ -1,120 +0,0 @@
|
|||||||
<?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')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{F22C4131-D4CC-426E-8FC4-5C2E60C6B0CE}</ProjectGuid>
|
|
||||||
<OutputType>WinExe</OutputType>
|
|
||||||
<RootNamespace>Update</RootNamespace>
|
|
||||||
<AssemblyName>Update</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
|
||||||
<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>
|
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<ApplicationIcon>update.ico</ApplicationIcon>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.IO.Compression" />
|
|
||||||
<Reference Include="System.IO.Compression.FileSystem" />
|
|
||||||
<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.Net.Http" />
|
|
||||||
<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="CustomControl\RoundProcessBarLoading.xaml.cs">
|
|
||||||
<DependentUpon>RoundProcessBarLoading.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="ZipFileUtils.cs" />
|
|
||||||
<Page Include="CustomControl\RoundProcessBarLoading.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Include="MainWindow.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Compile Include="AccessInterface\RequestJson.cs" />
|
|
||||||
<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>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTime>True</DesignTime>
|
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Properties\Settings.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
</Compile>
|
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<None Include="app.manifest" />
|
|
||||||
<None Include="Properties\Settings.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="App.config" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Resource Include="update.ico" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
</Project>
|
|
@ -1,66 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.IO.Compression;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Update
|
|
||||||
{
|
|
||||||
public class ZipFileUtils
|
|
||||||
{
|
|
||||||
public static bool UnzipFile(string zipFilePath, string extractPath)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// 检查 ZIP 文件是否存在
|
|
||||||
if (!File.Exists(zipFilePath))
|
|
||||||
{
|
|
||||||
throw new FileNotFoundException($"ZIP file not found: {zipFilePath}");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查目标文件夹是否存在,如果不存在则创建
|
|
||||||
if (!Directory.Exists(extractPath))
|
|
||||||
{
|
|
||||||
Directory.CreateDirectory(extractPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 打开 ZIP 文件
|
|
||||||
using (ZipArchive archive = ZipFile.OpenRead(zipFilePath))
|
|
||||||
{
|
|
||||||
foreach (ZipArchiveEntry entry in archive.Entries)
|
|
||||||
{
|
|
||||||
string fullPath = Path.Combine(extractPath, entry.FullName);
|
|
||||||
|
|
||||||
// 如果是目录,则创建目录
|
|
||||||
if (string.IsNullOrEmpty(entry.Name))
|
|
||||||
{
|
|
||||||
Directory.CreateDirectory(fullPath);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// 如果是文件,检查是否已存在
|
|
||||||
if (File.Exists(fullPath))
|
|
||||||
{
|
|
||||||
File.Delete(fullPath); // 删除已存在的文件
|
|
||||||
}
|
|
||||||
|
|
||||||
// 解压文件
|
|
||||||
entry.ExtractToFile(fullPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File.Delete(zipFilePath);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"Error extracting ZIP file: {ex.Message}");
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,78 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
|
||||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
|
||||||
<security>
|
|
||||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
|
||||||
<!-- UAC 清单选项
|
|
||||||
如果想要更改 Windows 用户帐户控制级别,请使用
|
|
||||||
以下节点之一替换 requestedExecutionLevel 节点。n
|
|
||||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
|
||||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
|
||||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
|
||||||
|
|
||||||
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
|
|
||||||
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
|
|
||||||
元素。
|
|
||||||
-->
|
|
||||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
|
||||||
</requestedPrivileges>
|
|
||||||
</security>
|
|
||||||
</trustInfo>
|
|
||||||
|
|
||||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
|
||||||
<application>
|
|
||||||
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
|
|
||||||
Windows 版本的列表。取消评论适当的元素,
|
|
||||||
Windows 将自动选择最兼容的环境。 -->
|
|
||||||
|
|
||||||
<!-- Windows Vista -->
|
|
||||||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
|
|
||||||
|
|
||||||
<!-- Windows 7 -->
|
|
||||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
|
|
||||||
|
|
||||||
<!-- Windows 8 -->
|
|
||||||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
|
|
||||||
|
|
||||||
<!-- Windows 8.1 -->
|
|
||||||
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
|
|
||||||
|
|
||||||
<!-- Windows 10 -->
|
|
||||||
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
|
|
||||||
|
|
||||||
</application>
|
|
||||||
</compatibility>
|
|
||||||
|
|
||||||
<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
|
|
||||||
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
|
|
||||||
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应
|
|
||||||
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。
|
|
||||||
|
|
||||||
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
|
|
||||||
<!--
|
|
||||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
|
||||||
<windowsSettings>
|
|
||||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
|
||||||
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
|
||||||
</windowsSettings>
|
|
||||||
</application>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
|
|
||||||
<!--
|
|
||||||
<dependency>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity
|
|
||||||
type="win32"
|
|
||||||
name="Microsoft.Windows.Common-Controls"
|
|
||||||
version="6.0.0.0"
|
|
||||||
processorArchitecture="*"
|
|
||||||
publicKeyToken="6595b64144ccf1df"
|
|
||||||
language="*"
|
|
||||||
/>
|
|
||||||
</dependentAssembly>
|
|
||||||
</dependency>
|
|
||||||
-->
|
|
||||||
|
|
||||||
</assembly>
|
|
Binary file not shown.
Before Width: | Height: | Size: 795 B |
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
libs/adb.exe
BIN
libs/adb.exe
Binary file not shown.
BIN
libs/icon.ico
BIN
libs/icon.ico
Binary file not shown.
Before Width: | Height: | Size: 3.8 KiB |
Loading…
x
Reference in New Issue
Block a user