Skip to content

Commit

Permalink
修复了卡顿的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperzlib committed Jun 9, 2021
1 parent 44808ec commit 4df3ebf
Show file tree
Hide file tree
Showing 8 changed files with 368 additions and 169 deletions.
283 changes: 186 additions & 97 deletions HousingCheck/HousingCheck.cs

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions HousingCheck/HousingCheck.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,22 @@
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows" />
<Reference Include="System.Windows.Controls.Ribbon" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="HousingCheck.cs" />
Expand All @@ -103,6 +107,9 @@
<Compile Include="PluginControl.Designer.cs">
<DependentUpon>PluginControl.cs</DependentUpon>
</Compile>
<Compile Include="PluginControlWpf.xaml.cs">
<DependentUpon>PluginControlWpf.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand All @@ -116,6 +123,12 @@
<None Include="Properties\DataSources\HousingCheck.datasource" />
<None Include="Properties\DataSources\PluginControl.datasource" />
</ItemGroup>
<ItemGroup>
<Page Include="PluginControlWpf.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
Expand Down
20 changes: 15 additions & 5 deletions HousingCheck/HousingOnSaleItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,34 @@ public bool Equals(HousingOnSaleItem obj)
return true;
}

//这里对比价格应该用<=,不然降价后会重复记录
//因为加了状态信息,所以不需要再对比售价
return (obj.Area == Area
&& obj.Slot == Slot
&& obj.Id == Id
&& obj.Price <= Price);
&& obj.Id == Id);
}

public void Update(HousingItem item)
{
if(item.Area == Area
&& item.Slot == Slot
&& item.Id == Id
&& item.Price <= Price)
&& item.Id == Id)
{
Price = item.Price;
ExistenceTime = DateTime.Now;
CurrentStatus = item.IsEmpty;
}
}

public void Update(HousingOnSaleItem item)
{
if (item.Area == Area
&& item.Slot == Slot
&& item.Id == Id)
{
Price = item.Price;
ExistenceTime = DateTime.Now;
CurrentStatus = item.CurrentStatus;
}
}
}
}
133 changes: 68 additions & 65 deletions HousingCheck/PluginControl.Designer.cs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions HousingCheck/PluginControl.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
<metadata name="pluginControlBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>238, 17</value>
</metadata>
<metadata name="pluginControlBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>238, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>69</value>
</metadata>
Expand Down
53 changes: 53 additions & 0 deletions HousingCheck/PluginControlWpf.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<UserControl x:Class="HousingCheck.PluginControlWpf"
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"
xmlns:local="clr-namespace:HousingCheck"
mc:Ignorable="d"
d:DesignWidth="800" d:DesignHeight="350">
<DockPanel>
<!-- 右侧功能 -->
<DockPanel DockPanel.Dock="Right" Width="360" Margin="0,8,10,8">
<StackPanel DockPanel.Dock="Top">
<GroupBox Header="上报设置" Padding="5,2">
<StackPanel>
<StackPanel VerticalAlignment="Center" Orientation="Horizontal">
<CheckBox Height="15.2">开启自动上报</CheckBox>
<CheckBox Margin="12,0,0,0" Height="15.2">上报房区快照</CheckBox>
<StackPanel Margin="12,0,0,0" Orientation="Horizontal" HorizontalAlignment="Center">
<Label Padding="0,-1,0,0" VerticalAlignment="Center" Margin="0,-1,0,0">上报API版本:</Label>
<ComboBox Width="50">
<ComboBoxItem>V1</ComboBoxItem>
<ComboBoxItem>V2</ComboBoxItem>
</ComboBox>
</StackPanel>
</StackPanel>
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0">上报地址</Label>
<TextBox Grid.Row="0" Grid.ColumnSpan="2" Margin="80,0,-257,0"/>
<Label Grid.Row="1" Grid.Column="0">Token</Label>
<TextBox Grid.ColumnSpan="2" Margin="80,25,-257,0" Grid.RowSpan="2"/>
</Grid>
</StackPanel>
</GroupBox>
</StackPanel>
<!-- Log区域 -->

</DockPanel>
<!-- 左侧房屋列表 -->
<GroupBox Header="房屋列表" Margin="10,8">
<DataGrid>

</DataGrid>
</GroupBox>
</DockPanel>
</UserControl>
28 changes: 28 additions & 0 deletions HousingCheck/PluginControlWpf.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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;

namespace HousingCheck
{
/// <summary>
/// PluginControlWpf.xaml 的交互逻辑
/// </summary>
public partial class PluginControlWpf : UserControl
{
public PluginControlWpf()
{
InitializeComponent();
}
}
}
4 changes: 2 additions & 2 deletions HousingCheck/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.8.0")]
[assembly: AssemblyFileVersion("1.3.8.0")]
[assembly: AssemblyVersion("1.4.2.0")]
[assembly: AssemblyFileVersion("1.4.2.0")]

0 comments on commit 4df3ebf

Please sign in to comment.