📄 pshistroycontrol.cs
字号:
this.lbMsgHistory.Size = new Size(0x69, 14);
this.lbMsgHistory.TabIndex = 0;
this.lbMsgHistory.Text = "消息历史保存设置";
this.lbMsgHistory.TextAlign = ContentAlignment.TopLeft;
this.lbMsgHistory.UseMnemonic = false;
this.lbQuestion.AutoEllipsis = false;
this.lbQuestion.AutoSize = true;
this.lbQuestion.BorderColor = Color.Black;
this.lbQuestion.BorderStyle = BorderStyle.None;
this.lbQuestion.ButtonBorderStyle = ButtonBorderStyle.Solid;
this.lbQuestion.Location = new Point(0x11, 0x22);
this.lbQuestion.Name = "lbQuestion";
this.lbQuestion.Size = new Size(60, 14);
this.lbQuestion.TabIndex = 2;
this.lbQuestion.Text = "lbQuestion";
this.lbQuestion.TextAlign = ContentAlignment.TopLeft;
this.lbQuestion.UseMnemonic = false;
this.chkSaveHistory.AutoSize = true;
this.chkSaveHistory.Location = new Point(0x20, 0x39);
this.chkSaveHistory.Name = "chkSaveHistory";
this.chkSaveHistory.Size = new Size(0x65, 0x11);
this.chkSaveHistory.TabIndex = 3;
this.chkSaveHistory.Text = "chkSaveHistory";
this.chkSaveHistory.UseVisualStyleBackColor = true;
this.chkRecentHistory.AutoSize = true;
this.chkRecentHistory.Location = new Point(0x20, 0x56);
this.chkRecentHistory.Name = "chkRecentHistory";
this.chkRecentHistory.Size = new Size(0x6f, 0x11);
this.chkRecentHistory.TabIndex = 4;
this.chkRecentHistory.Text = "chkRecentHistory";
this.chkRecentHistory.UseVisualStyleBackColor = true;
this.btnViewHistory.Location = new Point(0x20, 0x76);
this.btnViewHistory.Name = "btnViewHistory";
this.btnViewHistory.Size = new Size(0x8a, 0x19);
this.btnViewHistory.TabIndex = 5;
this.btnViewHistory.UseVisualStyleBackColor = true;
this.btnViewHistory.Click += new EventHandler(this.btnViewHistory_Click);
this.btnClearHistory.Location = new Point(0xb0, 0x76);
this.btnClearHistory.Name = "btnClearHistory";
this.btnClearHistory.Size = new Size(0x7b, 0x19);
this.btnClearHistory.TabIndex = 6;
this.btnClearHistory.UseVisualStyleBackColor = true;
this.btnClearHistory.Click += new EventHandler(this.btnClearHistory_Click);
this.txtDir.BackColor = Color.FromArgb(240, 240, 240);
this.txtDir.BorderStyle = BorderStyle.FixedSingle;
this.txtDir.Location = new Point(0x1f, 190);
this.txtDir.Name = "txtDir";
this.txtDir.ReadOnly = true;
this.txtDir.Size = new Size(0xdb, 20);
this.txtDir.TabIndex = 9;
this.lbMsgHistoryDirTip.AutoEllipsis = false;
this.lbMsgHistoryDirTip.AutoSize = true;
this.lbMsgHistoryDirTip.BorderColor = Color.Black;
this.lbMsgHistoryDirTip.BorderStyle = BorderStyle.None;
this.lbMsgHistoryDirTip.ButtonBorderStyle = ButtonBorderStyle.Solid;
this.lbMsgHistoryDirTip.Location = new Point(0x11, 0xa3);
this.lbMsgHistoryDirTip.Name = "lbMsgHistoryDirTip";
this.lbMsgHistoryDirTip.Size = new Size(0xa8, 14);
this.lbMsgHistoryDirTip.TabIndex = 10;
this.lbMsgHistoryDirTip.Text = "将消息历史保存到如下目录:";
this.lbMsgHistoryDirTip.TextAlign = ContentAlignment.TopLeft;
this.lbMsgHistoryDirTip.UseMnemonic = false;
this.xbtnBrowse.Location = new Point(0x100, 0xbd);
this.xbtnBrowse.Name = "xbtnBrowse";
this.xbtnBrowse.Size = new Size(0x4b, 0x19);
this.xbtnBrowse.TabIndex = 11;
this.xbtnBrowse.Text = "修改……";
this.xbtnBrowse.UseVisualStyleBackColor = true;
this.xbtnBrowse.Click += new EventHandler(this.xbtnBrowse_Click);
this.fbMsgHistoryDir.Description = "将消息历史保存到如下目录:";
this.chkKeepOldDir.AutoSize = true;
this.chkKeepOldDir.Location = new Point(0x1f, 0xe1);
this.chkKeepOldDir.Name = "chkKeepOldDir";
this.chkKeepOldDir.Size = new Size(230, 0x11);
this.chkKeepOldDir.TabIndex = 12;
this.chkKeepOldDir.Text = "更改目录的同时保留原有消息历史目录";
this.chkKeepOldDir.UseVisualStyleBackColor = true;
this.lbTip.AutoEllipsis = false;
this.lbTip.BorderColor = Color.Black;
this.lbTip.BorderStyle = BorderStyle.None;
this.lbTip.ButtonBorderStyle = ButtonBorderStyle.Solid;
this.lbTip.Location = new Point(30, 0xfc);
this.lbTip.Name = "lbTip";
this.lbTip.Size = new Size(0x12d, 0x52);
this.lbTip.TabIndex = 13;
this.lbTip.Text = "* 为了您的隐私安全,修改消息历史保存目录会将原有消息历史文件拷贝到新目录下,同时删除旧目录及该目录下的所有文件。如果您确信需要保留旧目录,请选中上面的复选框。\r\n* 如果您需要备份您的消息历史,请直接备份上面的目录即可。";
this.lbTip.TextAlign = ContentAlignment.TopLeft;
this.lbTip.UseMnemonic = false;
base.AutoScaleDimensions = new SizeF(6f, 13f);
base.AutoScaleMode = AutoScaleMode.Font;
base.Controls.Add(this.lbTip);
base.Controls.Add(this.chkKeepOldDir);
base.Controls.Add(this.xbtnBrowse);
base.Controls.Add(this.lbMsgHistoryDirTip);
base.Controls.Add(this.txtDir);
base.Controls.Add(this.btnClearHistory);
base.Controls.Add(this.btnViewHistory);
base.Controls.Add(this.chkRecentHistory);
base.Controls.Add(this.chkSaveHistory);
base.Controls.Add(this.lbQuestion);
base.Controls.Add(this.lbMsgHistory);
base.Controls.Add(label);
base.Name = "PsHistroyControl";
base.Size = new Size(0x16b, 0x1b1);
base.Load += new EventHandler(this.PsHistroyControl_Load);
base.ResumeLayout(false);
base.PerformLayout();
}
private void InitUiEventHandler()
{
foreach (Control control in base.Controls)
{
if ((control is CheckBox) && (control.Name != this.chkSaveHistory.Name))
{
control.Click += new EventHandler(this.c_Click);
continue;
}
if (control is TextBox)
{
control.TextChanged += new EventHandler(this.c_Click);
}
}
}
private void PsHistroyControl_Load(object sender, EventArgs e)
{
this.lbMsgHistory.Text = StringTable.MessageHistory.MessageSetting;
this.lbQuestion.Text = StringTable.MessageHistory.SaveHistoryQuestion;
this.chkSaveHistory.Text = StringTable.MessageHistory.ChkSaveHistory;
this.chkRecentHistory.Text = StringTable.MessageHistory.ChkAutoShowRecentHistory;
this.btnViewHistory.Text = StringTable.MessageHistory.BtnViewAllHistory;
this.btnClearHistory.Text = StringTable.MessageHistory.BtnClearAllHistory;
}
public override bool UpdateData(bool update)
{
Imps.Client.Core.ConversationSetting conversationSetting = this._user.Configuration.UserSetting.ConversationSetting;
try
{
if (update)
{
conversationSetting.SaveMessages = this.chkSaveHistory.Checked;
conversationSetting.ShowLatestMessages.ProposedValue = this.chkRecentHistory.Checked;
if (!string.Equals(this._frameworkWindow.PersistentManager.BaseDirForHistory, this.txtDir.Text))
{
this.ChangeMsgHistoryDir(this._frameworkWindow.PersistentManager.BaseDirForHistory, this.txtDir.Text, this.chkKeepOldDir.Checked);
}
}
else
{
this.chkSaveHistory.Checked = conversationSetting.SaveMessages;
this.chkRecentHistory.Checked = conversationSetting.ShowLatestMessages.Value;
this.chkRecentHistory.Enabled = this.chkSaveHistory.Checked;
this.txtDir.Text = this._frameworkWindow.PersistentManager.BaseDirForHistory;
}
base.Modified = false;
return true;
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
return false;
}
}
private void xbtnBrowse_Click(object sender, EventArgs e)
{
if (this.fbMsgHistoryDir.ShowDialog() == DialogResult.OK)
{
this.txtDir.Text = this.fbMsgHistoryDir.SelectedPath;
}
}
private Imps.Client.Core.User _user
{
get
{
return this._frameworkWindow.AccountManager.CurrentUser;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -