📄 tree_widget_buddy.cs
字号:
}
public void update_contact_info(ContactEventType event_type, bool fRepaint)
{
switch (event_type)
{
case ContactEventType.PropertiesChanged:
this.name = this.m_contact.PersonalInfo.DisplayName;
this.head_icon = this.m_contact.PersonalInfo.Portrait;
this.relation_status = this.m_contact.RelationStatus;
break;
case ContactEventType.PresenceChanged:
this.personal_message = this.m_contact.Presence.MoodPhrase;
this.status = this.m_contact.Presence.Text;
this.online = this.contact.Presence.IsDisplayOnline(this.contact.Presence.MainPresence);
this.m_crbt_to_me_changed = true;
break;
case ContactEventType.BelongGroupChanged:
return;
case ContactEventType.BlockChanged:
this.status = this.m_contact.Presence.Text;
break;
case ContactEventType.InfoChanged:
this.name = this.m_contact.PersonalInfo.DisplayName;
this.personal_message = this.m_contact.Presence.MoodPhrase;
this.head_icon = this.m_contact.PersonalInfo.Portrait;
this.status = this.m_contact.Presence.Text;
this.online = this.contact.Presence.IsDisplayOnline(this.contact.Presence.MainPresence);
this.m_crbt_to_me_changed = true;
this.relation_status = this.m_contact.RelationStatus;
break;
default:
return;
}
if (fRepaint && (((base.host != null) && base.host.IsHandleCreated) && !base.host.IsDisposed))
{
base.host.Invalidate(base.bounds);
}
}
public void update_contact_info(Imps.Client.Core.Contact contact, ContactEventType event_type, bool fRepaint)
{
if (contact == null)
{
throw new ArgumentNullException("contact");
}
this.m_contact = contact;
this.update_contact_info(event_type, fRepaint);
}
internal bool can_drag
{
get
{
if ((this.last_leftdown_area != area_type.normal) && (area_type.outside != this.last_leftdown_area))
{
return (area_type.name == this.last_leftdown_area);
}
return true;
}
}
public Imps.Client.Core.Contact contact
{
get
{
return this.m_contact;
}
}
protected CrbtToBuddy crbt_to_contact
{
get
{
return this.contact.Presence.CrbtToBuddy;
}
}
protected Crbt crbt_to_me
{
get
{
return this.contact.Presence.CrbtToMe;
}
}
public bool doulle_lines_mode
{
get
{
if (base.host == null)
{
return false;
}
return (((buddytree_widget) base.host).DisplayMode == BuddyTreeDisplayMode.DoubleLine);
}
}
public Image head_icon
{
get
{
return this.m_head_icon;
}
set
{
this.m_head_icon = value;
}
}
public override int height
{
get
{
if (base.host != null)
{
switch (((buddytree_widget) base.host).DisplayMode)
{
case BuddyTreeDisplayMode.DoubleLine:
return 40;
case BuddyTreeDisplayMode.Icon:
return 0x4a;
case BuddyTreeDisplayMode.LargeIcon:
return 0x80;
}
}
return 20;
}
}
public int inner_space
{
get
{
return this.m_inner_space;
}
set
{
this.m_inner_space = value;
}
}
protected area_type last_leftdown_area
{
get
{
return this.m_last_leftdown_area;
}
set
{
if (value != this.m_last_leftdown_area)
{
this.m_last_leftdown_area = value;
}
}
}
protected area_type mouse_location_area
{
get
{
return this.m_mouse_location_area;
}
set
{
if (((area_type.icon == value) || (area_type.crbt_to_me == value)) || (area_type.crbt_to_buddy == value))
{
base.host.Cursor = Cursors.Hand;
}
else
{
base.host.Cursor = base.host.NormalCursor;
}
if (value != this.m_mouse_location_area)
{
bool flag = false;
if (this.m_hover)
{
if (value == area_type.crbt_to_buddy)
{
flag = area_type.crbt_to_buddy != this.m_mouse_location_area;
}
else if ((value != area_type.crbt_to_buddy) && (area_type.crbt_to_buddy == this.m_mouse_location_area))
{
flag = true;
}
else if (value == area_type.crbt_to_me)
{
flag = area_type.crbt_to_me != this.m_mouse_location_area;
}
else if ((value != area_type.crbt_to_me) && (area_type.crbt_to_me == this.m_mouse_location_area))
{
flag = true;
}
}
this.m_mouse_location_area = value;
if (flag)
{
base.host.Invalidate(base.bounds);
}
}
}
}
public string name
{
get
{
return base.text;
}
set
{
base.text = value;
this.m_rich_name.plane_text = value;
}
}
public bool online
{
get
{
return this.m_online;
}
set
{
this.m_online = value;
}
}
public string personal_message
{
get
{
return this.m_rich_personal_message.plane_text;
}
set
{
if (value == null)
{
this.m_rich_personal_message.plane_text = string.Empty;
}
else
{
this.m_rich_personal_message.plane_text = value.Replace("\n", string.Empty).Replace("\r", string.Empty);
}
}
}
public int? relation_status
{
get
{
return this.m_relation_status;
}
set
{
int? nullable = value;
int? nullable2 = this.m_relation_status;
if ((nullable.GetValueOrDefault() != nullable2.GetValueOrDefault()) || (nullable.get_HasValue() != nullable2.get_HasValue()))
{
this.m_relation_status = value;
this.m_relation_status_changed = true;
}
}
}
public string status
{
get
{
return this.m_status;
}
set
{
this.m_status = value;
this.m_status_changed = true;
try
{
this.m_status_img = this.m_contact.PresenceIcon;
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
}
}
}
public override int width
{
get
{
if (base.host != null)
{
switch (((buddytree_widget) base.host).DisplayMode)
{
case BuddyTreeDisplayMode.Icon:
return 0x3b;
case BuddyTreeDisplayMode.LargeIcon:
return 0x73;
}
}
return 0;
}
}
public enum area_type
{
crbt_to_buddy = 4,
crbt_to_me = 3,
icon = 1,
name = 2,
normal = 0,
outside = -1
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -