⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exportform.cs

📁 飞信的收发使用csharp进行开发
💻 CS
📖 第 1 页 / 共 2 页
字号:
            this.dicFields.Add("Gender", "性别");
            this.dicFields.Add("BirthDate", "出生日期");
            this.dicFields.Add("UserNationality", "国家");
            this.dicFields.Add("Province", "省份");
            this.dicFields.Add("City", "城市");
            this.dicFields.Add("LunarAnimal", "生肖");
            this.dicFields.Add("Horoscope", "星座");
            this.dicFields.Add("BloodType", "血型");
            this.dicFields.Add("HomePhone", "家庭电话");
            this.dicFields.Add("WorkPhone", "工作电话");
            this.dicFields.Add("OtherPhone", "其他电话");
            this.dicFields.Add("PersonalEmail", "个人电子邮件");
            this.dicFields.Add("WorkEmail", "工作电子邮件");
            this.dicFields.Add("OtherEmail", "其他电子邮件");
            this.dicFields.Add("Company", "公司名称");
            this.dicFields.Add("CompanyWebsite", "公司主页");
            this.dicFields.Add("JobTitle", "职位");
            this.dicFields.Add("Notes", "个人简介");
            foreach (string str in this.dicFields.Keys)
            {
                ListViewItem item = new ListViewItem(this.dicFields[str]);
                item.Name = str;
                item.Checked = true;
                this.lstContactFields.Items.Add(item);
            }
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(ExportForm));
            this.btnBrowse = new XButton();
            this.btnPrevious = new XButton();
            this.btnNext = new XButton();
            this.btnCancel = new XButton();
            this.pnlContainer = new Panel();
            this.pnlStep2 = new Panel();
            this.treeContacts = new TreeView();
            this.lblSelectControls = new XLabel();
            this.pnlStep1 = new Panel();
            this.lblSelectPlugin = new XLabel();
            this.lblDescription = new XLabel();
            this.lstPlugins = new ListBox();
            this.pnlStep3 = new Panel();
            this.lstContactFields = new ListView();
            this.lblSelectContactFields = new XLabel();
            this.pnlStep4 = new Panel();
            this.progressBarExport = new ProgressBar();
            this.lblExportProgress = new XLabel();
            this.txtFilePath = new TextBox();
            this.lblSelectSavePath = new XLabel();
            this.label1 = new Label();
            this.saveFileDialog = new SaveFileDialog();
            this.pbExportImport = new PictureBox();
            this.pnlMain = new Panel();
            this.pnlContainer.SuspendLayout();
            this.pnlStep2.SuspendLayout();
            this.pnlStep1.SuspendLayout();
            this.pnlStep3.SuspendLayout();
            this.pnlStep4.SuspendLayout();
            ((ISupportInitialize) this.pbExportImport).BeginInit();
            this.pnlMain.SuspendLayout();
            base.SuspendLayout();
            base.menubar.Location = new Point(3, 30);
            this.btnBrowse.Location = new Point(0xdb, 0x22);
            this.btnBrowse.Name = "btnBrowse";
            this.btnBrowse.Size = new Size(0x4b, 0x17);
            this.btnBrowse.TabIndex = 2;
            this.btnBrowse.Text = "浏览...";
            this.btnBrowse.UseVisualStyleBackColor = true;
            this.btnBrowse.Click += new EventHandler(this.btnBrowse_Click);
            this.btnPrevious.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btnPrevious.Location = new Point(240, 0x15d);
            this.btnPrevious.Name = "btnPrevious";
            this.btnPrevious.Size = new Size(0x4b, 0x17);
            this.btnPrevious.TabIndex = 2;
            this.btnPrevious.Text = "上一步(&B)";
            this.btnPrevious.UseVisualStyleBackColor = true;
            this.btnPrevious.Click += new EventHandler(this.btnPrevious_Click);
            this.btnNext.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btnNext.Location = new Point(0x141, 0x15d);
            this.btnNext.Name = "btnNext";
            this.btnNext.Size = new Size(0x4b, 0x17);
            this.btnNext.TabIndex = 3;
            this.btnNext.Text = "下一步(&N)";
            this.btnNext.UseVisualStyleBackColor = true;
            this.btnNext.Click += new EventHandler(this.btnNext_Click);
            this.btnCancel.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btnCancel.DialogResult = DialogResult.Cancel;
            this.btnCancel.Location = new Point(0x192, 0x15d);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new Size(0x4b, 0x17);
            this.btnCancel.TabIndex = 4;
            this.btnCancel.Text = "取消";
            this.btnCancel.UseVisualStyleBackColor = true;
            this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
            this.pnlContainer.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.pnlContainer.Controls.Add(this.pnlStep2);
            this.pnlContainer.Controls.Add(this.pnlStep1);
            this.pnlContainer.Controls.Add(this.pnlStep3);
            this.pnlContainer.Controls.Add(this.pnlStep4);
            this.pnlContainer.Location = new Point(0x89, 4);
            this.pnlContainer.Name = "pnlContainer";
            this.pnlContainer.Size = new Size(0x158, 0x148);
            this.pnlContainer.TabIndex = 0;
            this.pnlStep2.Controls.Add(this.treeContacts);
            this.pnlStep2.Controls.Add(this.lblSelectControls);
            this.pnlStep2.Location = new Point(0x9f, 8);
            this.pnlStep2.Name = "pnlStep2";
            this.pnlStep2.Size = new Size(0x97, 0x69);
            this.pnlStep2.TabIndex = 2;
            this.treeContacts.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.treeContacts.CheckBoxes = true;
            this.treeContacts.Location = new Point(7, 0x1a);
            this.treeContacts.Name = "treeContacts";
            this.treeContacts.Size = new Size(0x7f, 0x43);
            this.treeContacts.TabIndex = 1;
            this.treeContacts.AfterCheck += new TreeViewEventHandler(this.treeContacts_AfterCheck);
            this.lblSelectControls.AutoSize = true;
            this.lblSelectControls.BorderColor = Color.Empty;
            this.lblSelectControls.ButtonBorderStyle = ButtonBorderStyle.None;
            this.lblSelectControls.Location = new Point(10, 9);
            this.lblSelectControls.Name = "lblSelectControls";
            this.lblSelectControls.Size = new Size(0x8e, 13);
            this.lblSelectControls.TabIndex = 0;
            this.lblSelectControls.Text = "第二步:选择导出的联系人";
            this.pnlStep1.Controls.Add(this.lblSelectPlugin);
            this.pnlStep1.Controls.Add(this.lblDescription);
            this.pnlStep1.Controls.Add(this.lstPlugins);
            this.pnlStep1.Location = new Point(3, 8);
            this.pnlStep1.Name = "pnlStep1";
            this.pnlStep1.Size = new Size(0x93, 0x65);
            this.pnlStep1.TabIndex = 0;
            this.lblSelectPlugin.AutoSize = true;
            this.lblSelectPlugin.BorderColor = Color.Empty;
            this.lblSelectPlugin.ButtonBorderStyle = ButtonBorderStyle.None;
            this.lblSelectPlugin.Location = new Point(10, 9);
            this.lblSelectPlugin.Name = "lblSelectPlugin";
            this.lblSelectPlugin.Size = new Size(130, 13);
            this.lblSelectPlugin.TabIndex = 0;
            this.lblSelectPlugin.Text = "第一步:选择导出的格式";
            this.lblDescription.BorderColor = Color.Empty;
            this.lblDescription.ButtonBorderStyle = ButtonBorderStyle.None;
            this.lblDescription.Location = new Point(10, 0xf1);
            this.lblDescription.Name = "lblDescription";
            this.lblDescription.Size = new Size(0x12f, 0x45);
            this.lblDescription.TabIndex = 2;
            this.lblDescription.Text = "lblPluginDescription";
            this.lstPlugins.FormattingEnabled = true;
            this.lstPlugins.Location = new Point(7, 0x22);
            this.lstPlugins.Name = "lstPlugins";
            this.lstPlugins.Size = new Size(0x12f, 0xc7);
            this.lstPlugins.TabIndex = 1;
            this.lstPlugins.SelectedIndexChanged += new EventHandler(this.lstPlugins_SelectedIndexChanged);
            this.pnlStep3.Controls.Add(this.lstContactFields);
            this.pnlStep3.Controls.Add(this.lblSelectContactFields);
            this.pnlStep3.Location = new Point(3, 0x77);
            this.pnlStep3.Name = "pnlStep3";
            this.pnlStep3.Size = new Size(0x8d, 0x8b);
            this.pnlStep3.TabIndex = 1;
            this.lstContactFields.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.lstContactFields.CheckBoxes = true;
            this.lstContactFields.Location = new Point(13, 0x1a);
            this.lstContactFields.Name = "lstContactFields";
            this.lstContactFields.Size = new Size(0x6f, 0x5c);
            this.lstContactFields.TabIndex = 1;
            this.lstContactFields.UseCompatibleStateImageBehavior = false;
            this.lstContactFields.View = View.List;
            this.lblSelectContactFields.AutoSize = true;
            this.lblSelectContactFields.BorderColor = Color.Empty;
            this.lblSelectContactFields.ButtonBorderStyle = ButtonBorderStyle.None;
            this.lblSelectContactFields.Location = new Point(7, 9);
            this.lblSelectContactFields.Name = "lblSelectContactFields";
            this.lblSelectContactFields.Size = new Size(0xa6, 13);
            this.lblSelectContactFields.TabIndex = 0;
            this.lblSelectContactFields.Text = "第三步:选择导出的联系人资料";
            this.pnlStep4.Controls.Add(this.progressBarExport);
            this.pnlStep4.Controls.Add(this.lblExportProgress);
            this.pnlStep4.Controls.Add(this.btnBrowse);
            this.pnlStep4.Controls.Add(this.txtFilePath);
            this.pnlStep4.Controls.Add(this.lblSelectSavePath);
            this.pnlStep4.Location = new Point(0x9f, 0x77);
            this.pnlStep4.Name = "pnlStep4";
            this.pnlStep4.Size = new Size(0x91, 0x8b);
            this.pnlStep4.TabIndex = 3;
            this.progressBarExport.Location = new Point(13, 0xa9);
            this.progressBarExport.Name = "progressBarExport";
            this.progressBarExport.Size = new Size(0x116, 20);
            this.progressBarExport.TabIndex = 3;
            this.progressBarExport.Visible = false;
            this.lblExportProgress.AutoSize = true;
            this.lblExportProgress.BorderColor = Color.Empty;
            this.lblExportProgress.ButtonBorderStyle = ButtonBorderStyle.None;
            this.lblExportProgress.Location = new Point(10, 0x8d);
            this.lblExportProgress.Name = "lblExportProgress";
            this.lblExportProgress.Size = new Size(0x37, 13);
            this.lblExportProgress.TabIndex = 2;
            this.lblExportProgress.Text = "导出进度";
            this.lblExportProgress.Visible = false;
            this.txtFilePath.Location = new Point(10, 0x25);
            this.txtFilePath.Name = "txtFilePath";
            this.txtFilePath.Size = new Size(0xca, 20);
            this.txtFilePath.TabIndex = 1;
            this.txtFilePath.TextChanged += new EventHandler(this.txtFilePath_TextChanged);
            this.lblSelectSavePath.AutoSize = true;
            this.lblSelectSavePath.BorderColor = Color.Empty;
            this.lblSelectSavePath.ButtonBorderStyle = ButtonBorderStyle.None;
            this.lblSelectSavePath.Location = new Point(10, 9);
            this.lblSelectSavePath.Name = "lblSelectSavePath";
            this.lblSelectSavePath.Size = new Size(0xb2, 13);
            this.lblSelectSavePath.TabIndex = 0;
            this.lblSelectSavePath.Text = "第三步:选择导出文件的保存位置";
            this.label1.BorderStyle = BorderStyle.Fixed3D;
            this.label1.Location = new Point(4, 340);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x1da, 2);
            this.label1.TabIndex = 1;
            this.pbExportImport.Location = new Point(4, 8);
            this.pbExportImport.Name = "pbExportImport";
            this.pbExportImport.Size = new Size(0x7f, 0x141);
            this.pbExportImport.TabIndex = 4;
            this.pbExportImport.TabStop = false;
            this.pnlMain.BackColor = Color.Transparent;
            this.pnlMain.Controls.Add(this.pbExportImport);
            this.pnlMain.Controls.Add(this.btnCancel);
            this.pnlMain.Controls.Add(this.btnNext);
            this.pnlMain.Controls.Add(this.btnPrevious);
            this.pnlMain.Controls.Add(this.label1);
            this.pnlMain.Controls.Add(this.pnlContainer);
            this.pnlMain.Dock = DockStyle.Fill;
            this.pnlMain.Location = new Point(6, 0x1f);
            this.pnlMain.Name = "pnlMain";
            this.pnlMain.Size = new Size(0x1e9, 0x184);
            this.pnlMain.TabIndex = 0;
            base.AcceptButton = this.btnNext;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.CancelButton = this.btnCancel;
            base.ClientSize = new Size(0x202, 0x1ab);
            base.Controls.Add(this.pnlMain);
            base.Icon = (Icon) manager.GetObject("$this.Icon");
            this.MaximumSize = new Size(520, 0x1c5);
            base.MinimizeBox = false;
            this.MinimumSize = new Size(520, 0x1c5);
            base.Name = "ExportForm";
            base.Padding = new Padding(6, 0x1f, 0x13, 8);
            base.ShowIcon = false;
            base.ShowInTaskbar = false;
            base.StartPosition = FormStartPosition.CenterScreen;
            base.Text = "导出联系人";
            base.Load += new EventHandler(this.ExportForm_Load);
            base.Controls.SetChildIndex(this.pnlMain, 0);
            base.Controls.SetChildIndex(base.menubar, 0);
            this.pnlContainer.ResumeLayout(false);
            this.pnlStep2.ResumeLayout(false);
            this.pnlStep2.PerformLayout();
            this.pnlStep1.ResumeLayout(false);
            this.pnlStep1.PerformLayout();
            this.pnlStep3.ResumeLayout(false);
            this.pnlStep3.PerformLayout();
            this.pnlStep4.ResumeLayout(false);
            this.pnlStep4.PerformLayout();
            ((ISupportInitialize) this.pbExportImport).EndInit();
            this.pnlMain.ResumeLayout(false);
            base.ResumeLayout(false);
        }

        private void lstPlugins_DoubleClick(object sender, EventArgs e)
        {
            this.DoNext();
        }

        private void lstPlugins_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.lstPlugins.SelectedItem != null)
            {
                this.lblDescription.Text = (this.lstPlugins.SelectedItem as ImportExportManager.ImportExportPlugin).Description;
            }
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            UiErrorHelper.HandEventSafely(this._frameworkWin, delegate {
                this.lstPlugins.DisplayMember = "Name";
                this.lstPlugins.DataSource = this._manager.GetExportPlugins();
                this.FormatForm();
                this.InitData();
            });
        }

        private void treeContacts_AfterCheck(object sender, TreeViewEventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWin, delegate {
                if (e.Node.Tag is Imps.Client.Core.ContactGroup)
                {
                    foreach (TreeNode node in e.Node.Nodes)
                    {
                        node.Checked = e.Node.Checked;
                    }
                }
            });
        }

        private void txtFilePath_TextChanged(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(this._frameworkWin, delegate {
                this.btnNext.Enabled = this.CanExport();
            });
        }

        private class ContactCompare : IComparer<Imps.Client.Core.Contact>
        {
            public int Compare(Imps.Client.Core.Contact x, Imps.Client.Core.Contact y)
            {
                return x.DisplayName.CompareTo(y.DisplayName);
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -