📄 exportform.cs
字号:
}
}
finally
{
enumerator.Dispose();
}
builder.Append("</Contacts>");
((this.lstPlugins.SelectedItem as ImportExportManager.ImportExportPlugin).ImportExportObject as IExportContacts).ExportContacts(this, this.txtFilePath.Text, builder.ToString());
this.progressBarExport.Value = this.progressBarExport.Maximum;
this.panelOK.Dock = DockStyle.Fill;
this.panelOK.BringToFront();
this.labelOK.Text = string.Format("成功导出{0}人", selectedContacts.get_Count());
this.btnNext.Text = "完成(&F)";
this.btnPrevious.Enabled = false;
this.btnCancel.Enabled = false;
this._finished = true;
}
else
{
this._frameworkWin.UnifiedMessageBox.ShowInfo(this, "不能导出,文件路径错误!");
}
}
catch (IOException exception)
{
this._frameworkWin.UnifiedMessageBox.ShowInfo(this, "导出失败,确认文件是否正在被使用!");
ClientLogger.WriteException(exception);
}
catch (Exception exception2)
{
this._frameworkWin.UnifiedMessageBox.ShowInfo(this, "导出失败!");
ClientLogger.WriteException(exception2);
}
}
private void ExportForm_Load(object sender, EventArgs e)
{
}
private void FormatForm()
{
this.btnPrevious.Visible = this._step != 1;
if (this._step == this._maxStep)
{
this.btnNext.Text = "导出(&E)";
this.btnNext.Enabled = this.CanExport();
}
else
{
this.btnNext.Enabled = true;
this.btnNext.Text = "下一步(&N)";
}
for (int i = 1; i <= this._maxStep; i++)
{
Panel panel = this.pnlContainer.Controls.Find("pnlStep" + i, false)[0] as Panel;
panel.Visible = this._step == i;
if (panel.Dock != DockStyle.Fill)
{
panel.Dock = DockStyle.Fill;
panel.BringToFront();
}
}
}
private List<Contact> GetSelectedContacts()
{
List<Contact> list = new List<Contact>();
foreach (TreeNode node in this.treeContacts.Nodes)
{
if (node.Tag is Contact)
{
if (node.Checked)
{
Contact contact = node.Tag as Contact;
if (!list.Contains(contact))
{
list.Add(contact);
}
}
}
else
{
foreach (TreeNode node2 in node.Nodes)
{
if (node2.Checked)
{
Contact contact2 = node2.Tag as Contact;
if (!list.Contains(contact2))
{
list.Add(contact2);
}
}
}
}
}
return list;
}
private void InitData()
{
this.BindGroupContacts();
this.BindNoneGroupContacts();
}
private void InitializeComponent()
{
ComponentResourceManager manager = new ComponentResourceManager(typeof(ExportForm));
this.btnPrevious = new XButton();
this.btnNext = new XButton();
this.btnCancel = new XButton();
this.pnlContainer = new Panel();
this.pnlStep1 = new Panel();
this.treeContacts = new TreeView();
this.lblSelectControls = new XLabel();
this.pnlStep2 = new Panel();
this.groupBox1 = new GroupBox();
this.txtFilePath = new TextBox();
this.btnBrowse = new XButton();
this.lblSelectPlugin = new XLabel();
this.lblDescription = new XLabel();
this.lstPlugins = new ListBox();
this.pnlStep4 = new Panel();
this.progressBarExport = new ProgressBar();
this.lblSelectSavePath = new XLabel();
this.panelOK = new Panel();
this.xLabel1 = new XLabel();
this.linkLabel1 = new LinkLabel();
this.labelOK = new Label();
this.pbOK = new PictureBox();
this.saveFileDialog = new SaveFileDialog();
this.pbExportImport = new PictureBox();
this.pnlMain = new Panel();
this.pnlContainer.SuspendLayout();
this.pnlStep1.SuspendLayout();
this.pnlStep2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.pnlStep4.SuspendLayout();
this.panelOK.SuspendLayout();
this.pbOK.BeginInit();
this.pbExportImport.BeginInit();
this.pnlMain.SuspendLayout();
base.SuspendLayout();
this.btnPrevious.AutoSizeToImage = false;
this.btnPrevious.BackColor = Color.Transparent;
this.btnPrevious.BackgroundImageDisable = null;
this.btnPrevious.BackgroundImageDown = null;
this.btnPrevious.BackgroundImageHover = null;
this.btnPrevious.ChangeSkin = true;
this.btnPrevious.Location = new System.Drawing.Point(0xf7, 360);
this.btnPrevious.Name = "btnPrevious";
this.btnPrevious.Size = new Size(0x4b, 0x17);
this.btnPrevious.TabIndex = 2;
this.btnPrevious.Text = "上一步(&B)";
this.btnPrevious.set_UseVisualStyleBackColor(false);
this.btnPrevious.Click += new EventHandler(this.btnPrevious_Click);
this.btnNext.AutoSizeToImage = false;
this.btnNext.BackColor = Color.Transparent;
this.btnNext.BackgroundImageDisable = null;
this.btnNext.BackgroundImageDown = null;
this.btnNext.BackgroundImageHover = null;
this.btnNext.ChangeSkin = true;
this.btnNext.Location = new System.Drawing.Point(0x148, 360);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new Size(0x4b, 0x17);
this.btnNext.TabIndex = 3;
this.btnNext.Text = "下一步(&N)";
this.btnNext.set_UseVisualStyleBackColor(false);
this.btnNext.Click += new EventHandler(this.btnNext_Click);
this.btnCancel.AutoSizeToImage = false;
this.btnCancel.BackColor = Color.Transparent;
this.btnCancel.BackgroundImageDisable = null;
this.btnCancel.BackgroundImageDown = null;
this.btnCancel.BackgroundImageHover = null;
this.btnCancel.ChangeSkin = true;
this.btnCancel.DialogResult = DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(0x199, 360);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new Size(0x4b, 0x17);
this.btnCancel.TabIndex = 4;
this.btnCancel.Text = "取消(&C)";
this.btnCancel.set_UseVisualStyleBackColor(false);
this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
this.pnlContainer.Controls.Add(this.pnlStep1);
this.pnlContainer.Controls.Add(this.pnlStep2);
this.pnlContainer.Controls.Add(this.pnlStep4);
this.pnlContainer.Controls.Add(this.panelOK);
this.pnlContainer.Location = new System.Drawing.Point(0x97, 0);
this.pnlContainer.Name = "pnlContainer";
this.pnlContainer.Size = new Size(0x157, 0x13c);
this.pnlContainer.TabIndex = 0;
this.pnlStep1.Controls.Add(this.treeContacts);
this.pnlStep1.Controls.Add(this.lblSelectControls);
this.pnlStep1.Location = new System.Drawing.Point(0xc0, 8);
this.pnlStep1.Name = "pnlStep1";
this.pnlStep1.Size = new Size(0x97, 0xb8);
this.pnlStep1.TabIndex = 2;
this.pnlStep1.Paint += new PaintEventHandler(this.pnlStep1_Paint);
this.treeContacts.CheckBoxes = true;
this.treeContacts.Location = new System.Drawing.Point(10, 0x20);
this.treeContacts.Name = "treeContacts";
this.treeContacts.Size = new Size(0x143, 0x112);
this.treeContacts.TabIndex = 1;
this.treeContacts.AfterCheck += new TreeViewEventHandler(this.treeContacts_AfterCheck);
this.lblSelectControls.set_AutoSize(true);
this.lblSelectControls.BorderColor = Color.Empty;
this.lblSelectControls.ButtonBorderStyle = ButtonBorderStyle.None;
this.lblSelectControls.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
this.lblSelectControls.Location = new System.Drawing.Point(6, 8);
this.lblSelectControls.Name = "lblSelectControls";
this.lblSelectControls.Size = new Size(0x6f, 13);
this.lblSelectControls.TabIndex = 0;
this.lblSelectControls.Text = "选择导出的联系人";
this.pnlStep2.Controls.Add(this.groupBox1);
this.pnlStep2.Controls.Add(this.lblSelectPlugin);
this.pnlStep2.Controls.Add(this.lblDescription);
this.pnlStep2.Controls.Add(this.lstPlugins);
this.pnlStep2.Location = new System.Drawing.Point(7, 8);
this.pnlStep2.Name = "pnlStep2";
this.pnlStep2.Size = new Size(0x99, 0x12d);
this.pnlStep2.TabIndex = 0;
this.groupBox1.Controls.Add(this.txtFilePath);
this.groupBox1.Controls.Add(this.btnBrowse);
this.groupBox1.Location = new System.Drawing.Point(0x12, 0xad);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new Size(0x130, 100);
this.groupBox1.TabIndex = 5;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "选择文件位置";
this.txtFilePath.Location = new System.Drawing.Point(12, 0x2b);
this.txtFilePath.Name = "txtFilePath";
this.txtFilePath.Size = new Size(0xca, 20);
this.txtFilePath.TabIndex = 3;
this.txtFilePath.TextChanged += new EventHandler(this.txtFilePath_TextChanged);
this.btnBrowse.AutoSizeToImage = false;
this.btnBrowse.BackColor = Color.Transparent;
this.btnBrowse.BackgroundImage = (Image) manager.GetObject("btnBrowse.BackgroundImage");
this.btnBrowse.BackgroundImageDisable = (Image) manager.GetObject("btnBrowse.BackgroundImageDisable");
this.btnBrowse.BackgroundImageDown = (Image) manager.GetObject("btnBrowse.BackgroundImageDown");
this.btnBrowse.BackgroundImageHover = (Image) manager.GetObject("btnBrowse.BackgroundImageHover");
this.btnBrowse.ChangeSkin = false;
this.btnBrowse.Location = new System.Drawing.Point(220, 0x2b);
this.btnBrowse.Name = "btnBrowse";
this.btnBrowse.Size = new Size(0x4b, 0x15);
this.btnBrowse.TabIndex = 4;
this.btnBrowse.Text = "浏览...";
this.btnBrowse.set_UseVisualStyleBackColor(false);
this.btnBrowse.Click += new EventHandler(this.btnBrowse_Click);
this.lblSelectPlugin.set_AutoSize(true);
this.lblSelectPlugin.BorderColor = Color.Empty;
this.lblSelectPlugin.ButtonBorderStyle = ButtonBorderStyle.None;
this.lblSelectPlugin.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
this.lblSelectPlugin.Location = new System.Drawing.Point(6, 8);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -