temu客户端程序
This commit is contained in:
commit
4aaf264e89
694 files changed
+263780
No files matched your search
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace LittleRabbit.LittleRabbitForms.CollectForms
|
||||
{
|
||||
public partial class CollectForm : Form
|
||||
{
|
||||
public Lazy<HaoWuCollectForm> haoWuCollectForm = new Lazy<HaoWuCollectForm>();
|
||||
public Lazy<FriendShopCollectForm> friendShopCollectForm = new Lazy<FriendShopCollectForm>();
|
||||
public Lazy<KeywordCollectForm> keywordCollectForm = new Lazy<KeywordCollectForm>();
|
||||
public Lazy<CaiNiXiHuanCollectForm> caiNiXiHuanCollectForm = new Lazy<CaiNiXiHuanCollectForm>();
|
||||
public Lazy<ShopProductCollectForm> shopProductCollectForm = new Lazy<ShopProductCollectForm>();
|
||||
|
||||
public CollectForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void tv_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
MainForm.sCurrentModule = e.Node.Name;
|
||||
this.lblName.Text = e.Node.Text;
|
||||
//如果是一级菜单,不做任何动作
|
||||
if (e.Node.Parent == null) return;
|
||||
new Thread(() =>
|
||||
{
|
||||
Thread.Sleep(200);
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
switch (e.Node.Name)
|
||||
{
|
||||
case "好物采集":
|
||||
SetForm(haoWuCollectForm.Value);
|
||||
break;
|
||||
case "同行采集":
|
||||
SetForm(friendShopCollectForm.Value);
|
||||
break;
|
||||
case "整店采集":
|
||||
SetForm(shopProductCollectForm.Value);
|
||||
break;
|
||||
case "关键词采集":
|
||||
SetForm(keywordCollectForm.Value);
|
||||
break;
|
||||
case "猜你喜欢采集":
|
||||
SetForm(caiNiXiHuanCollectForm.Value);
|
||||
break;
|
||||
}
|
||||
}));
|
||||
}).Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示隐藏层
|
||||
/// </summary>
|
||||
/// <param name="f"></param>
|
||||
private void SetForm(Form f)
|
||||
{
|
||||
if (f == null)
|
||||
{
|
||||
foreach (Control form in panel3.Controls)
|
||||
{
|
||||
form.Visible = false;
|
||||
if (form is Form)
|
||||
{
|
||||
panel3.Controls.Remove(form as Form);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
bool had = false;
|
||||
string sCurrentFormName = f.Name;
|
||||
for (int i = 0; i < panel3.Controls.Count; i++)
|
||||
{
|
||||
if (sCurrentFormName == panel3.Controls[i].Name)
|
||||
{
|
||||
had = true;
|
||||
panel3.Controls[i].Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
panel3.Controls[i].Visible = false;
|
||||
}
|
||||
}
|
||||
if (had)
|
||||
{
|
||||
f = null;
|
||||
return;
|
||||
}
|
||||
f.TopLevel = false;
|
||||
f.Left = 0;
|
||||
f.Top = 0;
|
||||
f.FormBorderStyle = FormBorderStyle.None;
|
||||
panel3.Controls.Add(f);
|
||||
f.AutoSize = true;
|
||||
f.Dock = DockStyle.Fill;
|
||||
f.Show();
|
||||
}
|
||||
|
||||
private void CollectForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
tv.SelectedNode = tv.Nodes[0].Nodes[0];
|
||||
tv.ExpandGroup(tv.Nodes[0].Name);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user