📄 ssstatusreplaycontrol.cs
字号:
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new Size(0x19e, 0xa3);
this.groupBox2.TabIndex = 0x1a;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "自定义状态";
this.lstCustomizedPresence.Columns.AddRange(new ColumnHeader[] { this.columnHeader1 });
this.lstCustomizedPresence.FullRowSelect = true;
this.lstCustomizedPresence.HeaderStyle = ColumnHeaderStyle.None;
this.lstCustomizedPresence.HideSelection = false;
this.lstCustomizedPresence.LargeImageList = this.imageList;
this.lstCustomizedPresence.Location = new System.Drawing.Point(13, 0x20);
this.lstCustomizedPresence.MultiSelect = false;
this.lstCustomizedPresence.Name = "lstCustomizedPresence";
this.lstCustomizedPresence.Size = new Size(0x182, 0x61);
this.lstCustomizedPresence.SmallImageList = this.imageList;
this.lstCustomizedPresence.StateImageList = this.imageList;
this.lstCustomizedPresence.TabIndex = 20;
this.lstCustomizedPresence.set_UseCompatibleStateImageBehavior(false);
this.lstCustomizedPresence.View = View.Details;
this.columnHeader1.Text = "";
this.columnHeader1.Width = 390;
this.imageList.ColorDepth = ColorDepth.Depth8Bit;
this.imageList.ImageSize = new Size(0x10, 0x10);
this.imageList.TransparentColor = Color.Transparent;
this.groupBox3.Controls.Add(this.chkAutoReply);
this.groupBox3.Controls.Add(this.txtReply);
this.groupBox3.Controls.Add(this.dlReply);
this.groupBox3.Location = new System.Drawing.Point(3, 0x116);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new Size(0x19e, 0x8e);
this.groupBox3.TabIndex = 0x1b;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "自动回复";
base.set_AutoScaleDimensions(new SizeF(6f, 12f));
base.set_AutoScaleMode(1);
base.Controls.Add(this.groupBox3);
base.Controls.Add(this.groupBox2);
base.Controls.Add(this.groupBox1);
base.Name = "SsStatusReplayControl";
base.Size = new Size(420, 480);
base.Load += new EventHandler(this.SsStatusReplayControl_Load);
this.nudAway.EndInit();
this.numAutoOffline.EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
base.ResumeLayout(false);
}
private void InitPresences()
{
MainPresence[] presenceArray = new MainPresence[] { MainPresence.Online, MainPresence.Busy, MainPresence.BeRightBack, MainPresence.Away, MainPresence.InTheMeeting, MainPresence.OnThePhone, MainPresence.OutToLunch };
ValueNameDescList<MainPresence> list = new ValueNameDescList<MainPresence>(presenceArray.Length);
foreach (MainPresence presence in presenceArray)
{
list.Add(presence, MainPresenceHelper.MainPresence2Str(presence));
}
}
private void lstCustomizedPresence_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
this.EnableControls();
}
catch
{
}
}
private void PressencesChanged()
{
if (this.lstCustomizedPresence.Items.Count < 5)
{
this.btnAdd.Enabled = true;
}
else
{
this.btnAdd.Enabled = false;
}
}
private void SetLimitation()
{
}
private void SsStatusReplayControl_Load(object sender, EventArgs e)
{
}
private void txtReply_TextChanged(object sender, EventArgs e)
{
int selectedIndex = this.dlReply.SelectedIndex;
this._autoReply.set_Item(selectedIndex, this.txtReply.Text);
}
private void uiData_Changed(object sender, EventArgs e)
{
UiErrorHelper.HandEventSafely(this._frameworkWnd, delegate {
base.Modified = true;
});
}
public override bool UpdateData(bool update)
{
try
{
if (update)
{
if (!this.CheckUserInput())
{
return false;
}
Suspender suspender = new Suspender(this.CurrentUser.Configuration.UserSetting);
try
{
string[] textArray = new string[5];
for (int i = 0; i < this._autoReply.get_Count(); i++)
{
textArray[i] = this._autoReply.get_Item(i).ToString();
}
this.CurrentUser.Configuration.UserSetting.AutoReplies = textArray;
}
finally
{
suspender.Dispose();
}
Suspender suspender2 = new Suspender(this.CurrentUser.Configuration.UserSetting.ConversationSetting);
try
{
this.CurrentUser.Configuration.UserSetting.ConversationSetting.AutoReplyIndex.ProposedValue = this.dlReply.SelectedIndex;
this.CurrentUser.Configuration.UserSetting.ConversationSetting.AutoReplyEnabled.ProposedValue = this.chkAutoReply.Checked;
if (FuncLimitedSetting.SmsSendOfLeavingLimited)
{
this.CurrentUser.Configuration.UserSetting.ConversationSetting.MessageToSMS.ProposedValue = false;
}
else
{
this.CurrentUser.Configuration.UserSetting.ConversationSetting.MessageToSMS.ProposedValue = this.cbMessageToSMS.Checked;
}
}
finally
{
suspender2.Dispose();
}
Suspender suspender3 = new Suspender(this.CurrentUser.Configuration.UserSetting.SensorSetting);
try
{
this.CurrentUser.Configuration.UserSetting.SensorSetting.BusyOnFullScreen.ProposedValue = this.chkFullScreen.Checked;
this.CurrentUser.Configuration.UserSetting.SensorSetting.AwayOnScreenSaver.ProposedValue = this.chkLock.Checked;
this.CurrentUser.Configuration.UserSetting.SensorSetting.AwayOnIdle.ProposedValue = this.chkNoAction.Checked;
this.CurrentUser.Configuration.UserSetting.SensorSetting.AwayOnIdleMinutes.ProposedValue = Convert.ToInt32(this.nudAway.Value);
this.CurrentUser.Configuration.UserSetting.SensorSetting.OfflineOnIdle.ProposedValue = this.chkAutoOffline.Checked;
this.CurrentUser.Configuration.UserSetting.SensorSetting.OfflineOnIdleHours.ProposedValue = (int) this.numAutoOffline.Value;
}
finally
{
suspender3.Dispose();
}
if (this._customizedPresencesChanged)
{
this.CurrentUser.Configuration.UserSetting.CustomPresences.Clear();
foreach (ListViewItem item in this.lstCustomizedPresence.Items)
{
ValueNameDesc<MainPresence> desc = item.Tag as ValueNameDesc<MainPresence>;
if (desc != null)
{
this.CurrentUser.Configuration.UserSetting.CustomPresences.TryAdd(desc.Name, desc.Value);
}
}
}
}
else
{
this.chkAutoReply.Checked = (bool) this.CurrentUser.Configuration.UserSetting.ConversationSetting.AutoReplyEnabled;
this.dlReply.SelectedIndex = (int) this.CurrentUser.Configuration.UserSetting.ConversationSetting.AutoReplyIndex;
this.chkFullScreen.Checked = (bool) this.CurrentUser.Configuration.UserSetting.SensorSetting.BusyOnFullScreen;
this.chkLock.Checked = (bool) this.CurrentUser.Configuration.UserSetting.SensorSetting.AwayOnScreenSaver;
this.chkNoAction.Checked = (bool) this.CurrentUser.Configuration.UserSetting.SensorSetting.AwayOnIdle;
if (FuncLimitedSetting.SmsSendOfLeavingLimited)
{
this.cbMessageToSMS.Checked = false;
this.cbMessageToSMS.Visible = false;
}
else
{
this.cbMessageToSMS.Checked = (bool) this.CurrentUser.Configuration.UserSetting.ConversationSetting.MessageToSMS;
this.cbMessageToSMS.Visible = true;
}
this.nudAway.Value = (decimal) this.CurrentUser.Configuration.UserSetting.SensorSetting.AwayOnIdleMinutes;
this.chkAutoOffline.Checked = (bool) this.CurrentUser.Configuration.UserSetting.SensorSetting.OfflineOnIdle;
this.numAutoOffline.Value = (decimal) this.CurrentUser.Configuration.UserSetting.SensorSetting.OfflineOnIdleHours;
this.dlReply.Enabled = this.chkAutoReply.Checked;
this.txtReply.Enabled = this.chkAutoReply.Checked;
this.nudAway.Enabled = this.chkNoAction.Checked;
this.FillCustomizedPresences(this.CurrentUser.Configuration.UserSetting.CustomPresences);
}
base.Modified = false;
this._customizedPresencesChanged = false;
this.EnableControls();
return true;
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
return false;
}
}
private Imps.Client.Core.User CurrentUser
{
get
{
return this._frameworkWnd.AccountManager.CurrentUser;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -