📄 pgsearchsteptwocontrol.cs
字号:
namespace Imps.Client.Pc
{
using Imps.Client.Core;
using Imps.Client.Pc.Controls;
using Imps.Client.Resource;
using Imps.Client.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class PGSearchStepTwoControl : UserControl
{
private AsyncBizOperation _bz;
private IFrameworkWindow _framework;
private List<PersonalGroup> _groupList;
private SearchPersonalGroupForm _hostForm;
private AsyncBizOperation _joinBz;
private int _pageCount;
private int _pageNo;
private int _pageSize;
private int _totalCount;
private DataGridViewTextBoxColumn colGroupCategory;
private DataGridViewTextBoxColumn colGroupID;
private DataGridViewTextBoxColumn colGroupIntroduce;
private DataGridViewTextBoxColumn colJoinMethod;
private DataGridViewTextBoxColumn colMemberCount;
private IContainer components;
private DataGridView dgSearchResult;
private Panel pnlSearchResult;
private List<PersonalGroupSearchResultView> viewList;
private XButton xbtnMore;
private XLabel xlblSearchResult;
private XLinkLabel xlnkSeeDetail;
public PGSearchStepTwoControl(IFrameworkWindow wnd, AsyncBizOperation bz, SearchPersonalGroupForm SearchForm)
{
this._hostForm = SearchForm;
this._framework = wnd;
this._bz = bz;
this.InitializeComponent();
this.UpdateColumns();
this.xbtnMore.Enabled = false;
this.PageSize = 10;
this.TotalCount = 0;
this.GroupList = new List<PersonalGroup>();
this._joinBz = new AsyncBizOperation();
this._joinBz.ImpsError += new EventHandler<ImpsErrorEventArgs>(this, (IntPtr) this._joinBz_ImpsError);
}
private void _joinBz_ImpsError(object sender, ImpsErrorEventArgs e)
{
this._framework.UnifiedMessageBox.ShowInfo(this, e.Summary);
(sender as AsyncBizOperation).IsImpsErrorHandled = true;
}
private void dgSearchResult_DoubleClick(object sender, MouseEventArgs e)
{
if ((this.dgSearchResult.HitTest(e.X, e.Y).get_Type() == 1) && (e.Button == MouseButtons.Left))
{
this.ShowApplyJoinForm(true);
}
}
private void dgSearchResult_KeyDown(object sender, KeyEventArgs e)
{
if (!e.Handled && (e.KeyCode == Keys.Return))
{
e.Handled = true;
this.ShowApplyJoinForm(false);
}
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private string getCategoryString(string categoryID)
{
Dictionary<PersonalGroupCategory.Category, List<PersonalGroupCategory.Category>>.KeyCollection.Enumerator enumerator = this.CurrentUser.PersonalGroupManager.GroupCategory.Categorys.get_Keys().GetEnumerator();
try
{
while (enumerator.MoveNext())
{
PersonalGroupCategory.Category category = enumerator.get_Current();
if (category.Id == categoryID)
{
return category.Name;
}
List<PersonalGroupCategory.Category>.Enumerator enumerator2 = this.CurrentUser.PersonalGroupManager.GroupCategory.Categorys.get_Item(category).GetEnumerator();
try
{
while (enumerator2.MoveNext())
{
PersonalGroupCategory.Category category2 = enumerator2.get_Current();
if (category2.Id == categoryID)
{
return string.Format("{0}/{1}", category.Name, category2.Name);
}
}
continue;
}
finally
{
enumerator2.Dispose();
}
}
}
finally
{
enumerator.Dispose();
}
return string.Empty;
}
private void InitializeComponent()
{
DataGridViewCellStyle style = new DataGridViewCellStyle();
DataGridViewCellStyle style2 = new DataGridViewCellStyle();
this.dgSearchResult = new DataGridView();
this.colJoinMethod = new DataGridViewTextBoxColumn();
this.colMemberCount = new DataGridViewTextBoxColumn();
this.colGroupID = new DataGridViewTextBoxColumn();
this.colGroupIntroduce = new DataGridViewTextBoxColumn();
this.colGroupCategory = new DataGridViewTextBoxColumn();
this.pnlSearchResult = new Panel();
this.xlnkSeeDetail = new XLinkLabel();
this.xbtnMore = new XButton();
this.xlblSearchResult = new XLabel();
this.dgSearchResult.BeginInit();
this.pnlSearchResult.SuspendLayout();
base.SuspendLayout();
this.dgSearchResult.set_AllowUserToAddRows(false);
this.dgSearchResult.set_AllowUserToDeleteRows(false);
this.dgSearchResult.set_AllowUserToResizeRows(false);
this.dgSearchResult.set_BackgroundColor(Color.White);
this.dgSearchResult.set_BorderStyle(BorderStyle.None);
this.dgSearchResult.set_ColumnHeadersBorderStyle(4);
style.set_Alignment(0x20);
style.set_BackColor(SystemColors.ControlLight);
style.set_Font(new Font("SimSun", 9f, FontStyle.Bold, GraphicsUnit.Point, 0x86));
style.set_ForeColor(Color.Black);
style.set_SelectionBackColor(SystemColors.Highlight);
style.set_SelectionForeColor(SystemColors.HighlightText);
style.set_WrapMode(1);
this.dgSearchResult.set_ColumnHeadersDefaultCellStyle(style);
this.dgSearchResult.set_ColumnHeadersHeightSizeMode(2);
this.dgSearchResult.get_Columns().AddRange(new DataGridViewColumn[] { this.colJoinMethod, this.colMemberCount, this.colGroupID, this.colGroupIntroduce, this.colGroupCategory });
style2.set_Alignment(0x20);
style2.set_BackColor(Color.White);
style2.set_Font(new Font("SimSun", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86));
style2.set_ForeColor(SystemColors.ControlText);
style2.set_SelectionBackColor(SystemColors.Highlight);
style2.set_SelectionForeColor(SystemColors.HighlightText);
style2.set_WrapMode(2);
this.dgSearchResult.set_DefaultCellStyle(style2);
this.dgSearchResult.Dock = DockStyle.Fill;
this.dgSearchResult.set_GridColor(Color.White);
this.dgSearchResult.Location = new System.Drawing.Point(1, 1);
this.dgSearchResult.set_Margin(new Padding(0));
this.dgSearchResult.set_MultiSelect(false);
this.dgSearchResult.Name = "dgSearchResult";
this.dgSearchResult.set_ReadOnly(true);
this.dgSearchResult.set_RowHeadersBorderStyle(4);
this.dgSearchResult.set_RowHeadersVisible(false);
this.dgSearchResult.get_RowTemplate().get_DefaultCellStyle().set_Alignment(0x20);
this.dgSearchResult.get_RowTemplate().set_Height(0x17);
this.dgSearchResult.set_SelectionMode(1);
this.dgSearchResult.Size = new Size(0x1d7, 250);
this.dgSearchResult.TabIndex = 6;
this.dgSearchResult.KeyDown += new KeyEventHandler(this.dgSearchResult_KeyDown);
this.dgSearchResult.add_MouseDoubleClick(new MouseEventHandler(this.dgSearchResult_DoubleClick));
this.colJoinMethod.set_DataPropertyName("VerifyMethod");
this.colJoinMethod.set_HeaderText("需要验证");
this.colJoinMethod.set_Name("colJoinMethod");
this.colJoinMethod.set_ReadOnly(true);
this.colJoinMethod.set_SortMode(0);
this.colJoinMethod.set_Width(80);
this.colMemberCount.set_DataPropertyName("GroupMemberCount");
this.colMemberCount.set_HeaderText("成员数");
this.colMemberCount.set_Name("colMemberCount");
this.colMemberCount.set_ReadOnly(true);
this.colMemberCount.set_SortMode(0);
this.colMemberCount.set_Width(70);
this.colGroupID.set_DataPropertyName("GroupID");
this.colGroupID.set_HeaderText("群号码");
this.colGroupID.set_Name("colGroupID");
this.colGroupID.set_ReadOnly(true);
this.colGroupID.set_SortMode(0);
this.colGroupID.set_Width(70);
this.colGroupIntroduce.set_DataPropertyName("GroupName");
this.colGroupIntroduce.set_HeaderText("群名称");
this.colGroupIntroduce.set_Name("colGroupIntroduce");
this.colGroupIntroduce.set_ReadOnly(true);
this.colGroupIntroduce.set_SortMode(0);
this.colGroupIntroduce.set_Width(130);
this.colGroupCategory.set_DataPropertyName("GroupCategory");
this.colGroupCategory.set_HeaderText("群分类");
this.colGroupCategory.set_Name("colGroupCategory");
this.colGroupCategory.set_ReadOnly(true);
this.colGroupCategory.set_SortMode(0);
this.colGroupCategory.set_Width(120);
this.pnlSearchResult.BackColor = Color.LightGray;
this.pnlSearchResult.Controls.Add(this.dgSearchResult);
this.pnlSearchResult.Location = new System.Drawing.Point(6, 0x1b);
this.pnlSearchResult.Name = "pnlSearchResult";
this.pnlSearchResult.set_Padding(new Padding(1));
this.pnlSearchResult.Size = new Size(0x1d9, 0xfc);
this.pnlSearchResult.TabIndex = 7;
this.xlnkSeeDetail.AutoEllipsis = false;
this.xlnkSeeDetail.BorderColor = Color.Black;
this.xlnkSeeDetail.BorderStyle = BorderStyle.None;
this.xlnkSeeDetail.ButtonBorderStyle = ButtonBorderStyle.Solid;
this.xlnkSeeDetail.Cursor = Cursors.Hand;
this.xlnkSeeDetail.Font = new Font("SimSun", 9f, FontStyle.Underline);
this.xlnkSeeDetail.ForeColor = Color.Green;
this.xlnkSeeDetail.LinkBehavior = LinkBehavior.AlwaysUnderline;
this.xlnkSeeDetail.LinkColor = Color.Green;
this.xlnkSeeDetail.Location = new System.Drawing.Point(0x193, 0x11d);
this.xlnkSeeDetail.Name = "xlnkSeeDetail";
this.xlnkSeeDetail.Size = new Size(0x4f, 0x19);
this.xlnkSeeDetail.TabIndex = 5;
this.xlnkSeeDetail.Text = "查看详细资料";
this.xlnkSeeDetail.TextAlign = ContentAlignment.TopLeft;
this.xlnkSeeDetail.UseMnemonic = false;
this.xlnkSeeDetail.Visible = false;
this.xlnkSeeDetail.LinkClicked += new LinkLabelLinkClickedEventHandler(this.xlnkSeeDetail_LinkClicked);
this.xbtnMore.AutoArrangementX = false;
this.xbtnMore.AutoSizeToImage = false;
this.xbtnMore.BackColor = Color.Transparent;
this.xbtnMore.BackgroundImageDisable = null;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -