Skip to content

Commit

Permalink
修正定时器逻辑bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxuuu committed Jun 26, 2019
1 parent 9e7087e commit da76cc8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 5 deletions.
Binary file added llcom/DefaultFiles/vJine.Lua.dll
Binary file not shown.
6 changes: 5 additions & 1 deletion llcom/LuaEnv/LuaRunEnv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public static void StopTimer(int id)
{
if(pool[id] != null)
{
((CancellationTokenSource)pool[id]).Cancel();
pool[id].Cancel();
pool.Remove(id);
}
}
Expand All @@ -131,6 +131,10 @@ public static void StopLua(string ex)
LuaApis.PrintLog("lua代码报错了:\r\n" + ex);
else
LuaApis.PrintLog("lua代码已停止");
foreach(var v in pool)
{
v.Value.Cancel();
}
isRunning = false;
tokenSource.Cancel();
pool.Clear();
Expand Down
2 changes: 2 additions & 0 deletions llcom/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@
<LineBreak/>
LibUsbDotNet
<LineBreak/>
Costura.Fody
<LineBreak/>
<LineBreak/>
</TextBlock>
<TextBlock Text="软件版本"/>
Expand Down
6 changes: 4 additions & 2 deletions llcom/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
aboutScrollViewer.ScrollToTop();
versionTextBlock.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

this.Title += " - " + versionTextBlock.Text;

//检查更新
Task.Run(async() =>
{
Expand All @@ -135,8 +137,8 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
client.DefaultRequestHeaders.Add("user-agent", "llcom");
string data = await client.GetStringAsync("https://api.github.com/repos/chenxuuu/llcom/releases/latest");
JObject jo = (JObject)JsonConvert.DeserializeObject(data);
if((string)jo["tag_name"] !=
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString())
if(int.Parse(((string)jo["tag_name"]).Replace(".", "")) >
int.Parse(System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString().Replace(".","")))
{
var result = MessageBox.Show($"发现新版本{(string)jo["tag_name"]},是否前往官网进行更新?",
"更新检查",
Expand Down
4 changes: 2 additions & 2 deletions llcom/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.2")]
[assembly: AssemblyFileVersion("1.0.0.2")]
[assembly: AssemblyVersion("1.0.0.3")]
[assembly: AssemblyFileVersion("1.0.0.3")]
[assembly: NeutralResourcesLanguage("zh-CN")]

7 changes: 7 additions & 0 deletions llcom/llcom.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Costura.Fody.4.0.0\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.4.0.0\build\Costura.Fody.props')" />
<Import Project="..\packages\vJine.Lua.0.1.0.13\build\vJine.Lua.props" Condition="Exists('..\packages\vJine.Lua.0.1.0.13\build\vJine.Lua.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -88,6 +89,9 @@
<Reference Include="AdonisUI.ClassicTheme, Version=1.11.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AdonisUI.ClassicTheme.1.11.0\lib\net40\AdonisUI.ClassicTheme.dll</HintPath>
</Reference>
<Reference Include="Costura, Version=4.0.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.4.0.0\lib\net40\Costura.dll</HintPath>
</Reference>
<Reference Include="CrashReporter.NET, Version=1.5.7.0, Culture=neutral, PublicKeyToken=7828e0fd88cab698, processorArchitecture=MSIL">
<HintPath>..\packages\CrashReporter.NET.Official.1.5.7\lib\net462\CrashReporter.NET.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -193,6 +197,8 @@
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\vJine.Lua.0.1.0.13\build\vJine.Lua.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\vJine.Lua.0.1.0.13\build\vJine.Lua.props'))" />
<Error Condition="!Exists('..\packages\Fody.5.0.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.5.0.0\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.4.0.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.4.0.0\build\Costura.Fody.props'))" />
</Target>
<Target Name="AfterBuild">
<ItemGroup>
Expand All @@ -204,4 +210,5 @@
del *.xml
del *.pdb</PostBuildEvent>
</PropertyGroup>
<Import Project="..\packages\Fody.5.0.0\build\Fody.targets" Condition="Exists('..\packages\Fody.5.0.0\build\Fody.targets')" />
</Project>
2 changes: 2 additions & 0 deletions llcom/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<package id="AdonisUI" version="1.11.0" targetFramework="net472" />
<package id="AdonisUI.ClassicTheme" version="1.11.0" targetFramework="net472" />
<package id="AvalonEdit" version="5.0.4" targetFramework="net472" />
<package id="Costura.Fody" version="4.0.0" targetFramework="net472" />
<package id="CrashReporter.NET.Official" version="1.5.7" targetFramework="net472" />
<package id="Fody" version="5.0.0" targetFramework="net472" developmentDependency="true" />
<package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net472" />
<package id="LibUsbDotNet" version="2.2.29" targetFramework="net472" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net472" />
Expand Down

0 comments on commit da76cc8

Please sign in to comment.