Skip to content

Commit 4df3ebf

Browse files
committed
修复了卡顿的问题
1 parent 44808ec commit 4df3ebf

File tree

8 files changed

+368
-169
lines changed

8 files changed

+368
-169
lines changed

HousingCheck/HousingCheck.cs

Lines changed: 186 additions & 97 deletions
Large diffs are not rendered by default.

HousingCheck/HousingCheck.csproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,22 @@
7878
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
7979
<EmbedInteropTypes>False</EmbedInteropTypes>
8080
</Reference>
81+
<Reference Include="PresentationCore" />
82+
<Reference Include="PresentationFramework" />
8183
<Reference Include="System" />
8284
<Reference Include="System.Core" />
8385
<Reference Include="System.Drawing" />
8486
<Reference Include="System.Windows" />
8587
<Reference Include="System.Windows.Controls.Ribbon" />
8688
<Reference Include="System.Windows.Forms" />
89+
<Reference Include="System.Xaml" />
8790
<Reference Include="System.Xml.Linq" />
8891
<Reference Include="System.Data.DataSetExtensions" />
8992
<Reference Include="Microsoft.CSharp" />
9093
<Reference Include="System.Data" />
9194
<Reference Include="System.Net.Http" />
9295
<Reference Include="System.Xml" />
96+
<Reference Include="WindowsBase" />
9397
</ItemGroup>
9498
<ItemGroup>
9599
<Compile Include="HousingCheck.cs" />
@@ -103,6 +107,9 @@
103107
<Compile Include="PluginControl.Designer.cs">
104108
<DependentUpon>PluginControl.cs</DependentUpon>
105109
</Compile>
110+
<Compile Include="PluginControlWpf.xaml.cs">
111+
<DependentUpon>PluginControlWpf.xaml</DependentUpon>
112+
</Compile>
106113
<Compile Include="Properties\AssemblyInfo.cs" />
107114
</ItemGroup>
108115
<ItemGroup>
@@ -116,6 +123,12 @@
116123
<None Include="Properties\DataSources\HousingCheck.datasource" />
117124
<None Include="Properties\DataSources\PluginControl.datasource" />
118125
</ItemGroup>
126+
<ItemGroup>
127+
<Page Include="PluginControlWpf.xaml">
128+
<SubType>Designer</SubType>
129+
<Generator>MSBuild:Compile</Generator>
130+
</Page>
131+
</ItemGroup>
119132
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
120133
<PropertyGroup>
121134
<PostBuildEvent>

HousingCheck/HousingOnSaleItem.cs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,24 +108,34 @@ public bool Equals(HousingOnSaleItem obj)
108108
return true;
109109
}
110110

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

118117
public void Update(HousingItem item)
119118
{
120119
if(item.Area == Area
121120
&& item.Slot == Slot
122-
&& item.Id == Id
123-
&& item.Price <= Price)
121+
&& item.Id == Id)
124122
{
125123
Price = item.Price;
126124
ExistenceTime = DateTime.Now;
127125
CurrentStatus = item.IsEmpty;
128126
}
129127
}
128+
129+
public void Update(HousingOnSaleItem item)
130+
{
131+
if (item.Area == Area
132+
&& item.Slot == Slot
133+
&& item.Id == Id)
134+
{
135+
Price = item.Price;
136+
ExistenceTime = DateTime.Now;
137+
CurrentStatus = item.CurrentStatus;
138+
}
139+
}
130140
}
131141
}

HousingCheck/PluginControl.Designer.cs

Lines changed: 68 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

HousingCheck/PluginControl.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@
123123
<metadata name="pluginControlBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124124
<value>238, 17</value>
125125
</metadata>
126+
<metadata name="pluginControlBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
127+
<value>238, 17</value>
128+
</metadata>
126129
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
127130
<value>69</value>
128131
</metadata>

HousingCheck/PluginControlWpf.xaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<UserControl x:Class="HousingCheck.PluginControlWpf"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:HousingCheck"
7+
mc:Ignorable="d"
8+
d:DesignWidth="800" d:DesignHeight="350">
9+
<DockPanel>
10+
<!-- 右侧功能 -->
11+
<DockPanel DockPanel.Dock="Right" Width="360" Margin="0,8,10,8">
12+
<StackPanel DockPanel.Dock="Top">
13+
<GroupBox Header="上报设置" Padding="5,2">
14+
<StackPanel>
15+
<StackPanel VerticalAlignment="Center" Orientation="Horizontal">
16+
<CheckBox Height="15.2">开启自动上报</CheckBox>
17+
<CheckBox Margin="12,0,0,0" Height="15.2">上报房区快照</CheckBox>
18+
<StackPanel Margin="12,0,0,0" Orientation="Horizontal" HorizontalAlignment="Center">
19+
<Label Padding="0,-1,0,0" VerticalAlignment="Center" Margin="0,-1,0,0">上报API版本:</Label>
20+
<ComboBox Width="50">
21+
<ComboBoxItem>V1</ComboBoxItem>
22+
<ComboBoxItem>V2</ComboBoxItem>
23+
</ComboBox>
24+
</StackPanel>
25+
</StackPanel>
26+
<Grid>
27+
<Grid.RowDefinitions>
28+
<RowDefinition></RowDefinition>
29+
<RowDefinition></RowDefinition>
30+
</Grid.RowDefinitions>
31+
<Grid.ColumnDefinitions>
32+
<ColumnDefinition Width="80"></ColumnDefinition>
33+
<ColumnDefinition Width="Auto"></ColumnDefinition>
34+
</Grid.ColumnDefinitions>
35+
<Label Grid.Row="0" Grid.Column="0">上报地址</Label>
36+
<TextBox Grid.Row="0" Grid.ColumnSpan="2" Margin="80,0,-257,0"/>
37+
<Label Grid.Row="1" Grid.Column="0">Token</Label>
38+
<TextBox Grid.ColumnSpan="2" Margin="80,25,-257,0" Grid.RowSpan="2"/>
39+
</Grid>
40+
</StackPanel>
41+
</GroupBox>
42+
</StackPanel>
43+
<!-- Log区域 -->
44+
45+
</DockPanel>
46+
<!-- 左侧房屋列表 -->
47+
<GroupBox Header="房屋列表" Margin="10,8">
48+
<DataGrid>
49+
50+
</DataGrid>
51+
</GroupBox>
52+
</DockPanel>
53+
</UserControl>

HousingCheck/PluginControlWpf.xaml.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace HousingCheck
17+
{
18+
/// <summary>
19+
/// PluginControlWpf.xaml 的交互逻辑
20+
/// </summary>
21+
public partial class PluginControlWpf : UserControl
22+
{
23+
public PluginControlWpf()
24+
{
25+
InitializeComponent();
26+
}
27+
}
28+
}

HousingCheck/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.3.8.0")]
36-
[assembly: AssemblyFileVersion("1.3.8.0")]
35+
[assembly: AssemblyVersion("1.4.2.0")]
36+
[assembly: AssemblyFileVersion("1.4.2.0")]

0 commit comments

Comments
 (0)