📄 groupconversationform.cs
字号:
if (handler == null)
{
handler = delegate (object sender, EventArgs e) {
this.CurrentUser.Configuration.UserSetting.ConversationSetting.GroupWindowState = (int) this._folderNavigator.State;
this.InitNavigaorSetup();
};
}
this._folderNavigator.Click += handler;
controls.Add(this._folderNavigator);
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
}
}
private void InitToolTipInfo()
{
string text = string.Empty;
if (((this._group.SuperManger == null) && this._group.GroupInfo.DestroyTime.get_HasValue()) && (this._group.GroupInfo.DestroyTime.get_Value() > DateTime.Now))
{
text = string.Format("超级管理员已注销飞信服务,该群将于{0}被删除,特此通知!", this._group.GroupInfo.DestroyTime.get_Value().ToString("yyyy年MM月dd日"));
}
if (!string.IsNullOrEmpty(text))
{
this.lblTooltip.BackColor = Color.FromArgb(0xf9, 0xf6, 0xdb);
this.lblTooltip.Visible = true;
this.lblTooltip.Text = text;
}
else
{
this.lblTooltip.Visible = false;
}
}
private void InitTopControl(bool sms)
{
try
{
this.topControl = new PGConversationTopControl(this._frameworkWnd, this.Group);
this.topControl.Dock = DockStyle.Fill;
this.topControl.SendSMS = sms;
this.pnlTop.Controls.Add(this.topControl);
this.topControl.SendSMSChanged += new EventHandler(this.topControl_SendSMSChanged);
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
}
}
internal void LoadWindowSetting()
{
try
{
Imps.Client.Core.ConversationSetting conversationSetting = this.CurrentUser.Configuration.UserSetting.ConversationSetting;
this._inputChatManager.SelectionFont = this.CurrentUser.Configuration.UserSetting.ConversationSetting.Font;
this._inputChatManager.ForeColor = this.CurrentUser.Configuration.UserSetting.ConversationSetting.Color;
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
}
}
protected override void OnFormClosed(FormClosedEventArgs e)
{
base.OnFormClosed(e);
try
{
this.SaveWindowSetting();
this.RemoveGlobalEvent();
this.RemoveConversationEvent();
if (this.CurrentConversation != null)
{
this.CurrentConversation.OwnerFormCreated = false;
this.CurrentConversation.CurrentDialog.MsgManager.SetNextNewLine();
}
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
}
}
protected override void OnKeyDown(KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
if (string.IsNullOrEmpty(this._inputChatManager.Text.Trim()))
{
base.Close();
}
}
else
{
base.OnKeyDown(e);
}
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.InitListControl();
this.InitTopControl(this._operation == ConversationOperation.SmsChat);
this.InitNavigatorControl();
this.InitConversation();
this.AddGlobalEvent();
this.FormatSMSOrMessageDisplay();
this.InitCommonControls();
this.InitToolTipInfo();
ComponentResourceManager manager = new ComponentResourceManager(typeof(GroupConversationForm));
base.Icon = (Icon) manager.GetObject("$this.Icon");
ControlHelper.SetDoubleBuffered(this.pnlNav);
}
private void opEmotionDown_ImpsError(object sender, ImpsErrorEventArgs e)
{
try
{
AsyncBizOperation operation = sender as AsyncBizOperation;
OleKey key = operation.ContextForUi as OleKey;
Image loadingFailed = ImpsIcons.LoadingFailed;
this._historyChatManager.UpdateCustomEmotion(key, loadingFailed);
operation.Successed -= new EventHandler(this.opEmotionDown_Successed);
operation.ImpsError -= new EventHandler<ImpsErrorEventArgs>(this, (IntPtr) this.opEmotionDown_ImpsError);
}
catch (Exception exception)
{
this.HandleException(exception);
}
}
private void opEmotionDown_Successed(object sender, EventArgs e)
{
try
{
AsyncBizOperation operation = sender as AsyncBizOperation;
OleKey key = operation.ContextForUi as OleKey;
Imps.Client.Core.CustomEmotion.CustomEmotion emotion = operation.ContextForBiz as Imps.Client.Core.CustomEmotion.CustomEmotion;
Image customEmotionImage = this.GetCustomEmotionImage(emotion.Id);
if (customEmotionImage != null)
{
this._historyChatManager.UpdateCustomEmotion(key, customEmotionImage);
}
operation.Successed -= new EventHandler(this.opEmotionDown_Successed);
operation.ImpsError -= new EventHandler<ImpsErrorEventArgs>(this, (IntPtr) this.opEmotionDown_ImpsError);
}
catch (Exception exception)
{
this.HandleException(exception);
}
}
private void PersonalGroupManager_GroupDeleted(object sender, PersonalGroupEventArgs e)
{
try
{
if (e.PersonalGroup == this.Group)
{
this.lblGroupMembersInfo.Visible = false;
this._historyChatManager.AppentString(string.Format("<font size=10.5 color=#a31515>{0}({1})已经被删除!</font>", StringHelper.EncodString((string) e.PersonalGroup.GroupInfo.Name), e.PersonalGroup.GroupInfo.Id));
this._historyChatManager.AppendCRLF();
this._historyChatManager.ScrollToEnd();
this.pnlContainer.Enabled = false;
this.topControl.Disable();
}
}
catch (Exception exception)
{
this.HandleException(exception);
}
}
private void PersonalGroupManager_GroupInfoChanged(object sender, PersonalGroupEventArgs e)
{
if (e.PersonalGroup == this._group)
{
this.InitGroupCaption();
}
}
private void PersonalGroupManager_GroupRemoved(object sender, PersonalGroupEventArgs e)
{
try
{
if (e.PersonalGroup == this.Group)
{
this.lblGroupMembersInfo.Visible = false;
if (((UserIdentity) e.PersonalGroup.UserInfo.GroupUserIdentity.Value) == UserIdentity.SuperManager)
{
this._historyChatManager.AppentString(string.Format("<font size=10.5 color=#a31515>{0}({1})已经被删除!</font>", StringHelper.EncodString((string) e.PersonalGroup.GroupInfo.Name), e.PersonalGroup.GroupInfo.Id));
this._historyChatManager.AppendCRLF();
this._historyChatManager.ScrollToEnd();
}
else
{
this._historyChatManager.AppentString(string.Format("<font size=10.5 color=#a31515>您已经退出了群 {0}({1})!</font>", StringHelper.EncodString((string) e.PersonalGroup.GroupInfo.Name), e.PersonalGroup.GroupInfo.Id));
this._historyChatManager.AppendCRLF();
this._historyChatManager.ScrollToEnd();
}
this.pnlContainer.Enabled = false;
this.topControl.Disable();
}
}
catch (Exception exception)
{
this.HandleException(exception);
}
}
private void PersonalGroupManager_MeBeDeleted(object sender, PersonalGroupEventArgs e)
{
try
{
if (e.PersonalGroup == this.Group)
{
this._historyChatManager.AppentString(string.Format("<font size=10.5 color=#a31515>您已经被{0}({1})的管理员或超级管理员移除!</font>", StringHelper.EncodString((string) e.PersonalGroup.GroupInfo.Name), e.PersonalGroup.GroupInfo.Id));
this._historyChatManager.AppendCRLF();
this._historyChatManager.ScrollToEnd();
this.pnlContainer.Enabled = false;
this.topControl.Disable();
}
}
catch (Exception exception)
{
this.HandleException(exception);
}
}
private void PersonalGroupManager_MemberDeleted(object sender, GroupMemberDeletedEventArgs e)
{
this.InitGroupMembersLable();
}
private void PersonalGroupManager_MemberDestroyed(object sender, MemberDestroyedEventArgs e)
{
UserIdentity local1 = e.Member.GroupMemeberInfo.GroupUserIdentity.Value;
this.InitToolTipInfo();
this.InitGroupMembersLable();
}
private void PersonalGroupManager_MemberExited(object sender, PersonalGroupMemberEventArgs e)
{
this.InitGroupMembersLable();
}
private void PersonalGroupManager_MemberJoined(object sender, PersonalGroupMemberEventArgs e)
{
this.InitGroupMembersLable();
}
private void PersonalGroupManager_MembersInfoChanged(object sender, GroupMembersInfoChangedEventArgs e)
{
this.InitGroupMembersLable();
}
private void RemoveConversationEvent()
{
try
{
if (this.CurrentDialog != null)
{
this.CurrentDialog.MessageRecieved -= new EventHandler<MessageEventArgs>(this, (IntPtr) this.dialog_MessageRecieved);
this.CurrentDialog.SendMessageFailed -= ne
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -