From: Latif Khalifa Date: Sat, 31 Oct 2009 14:04:32 +0000 (+0000) Subject: Close group and profile windows on disconnect. X-Git-Tag: release-1.12~50 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=759d7c41de647b8b2cc53b6b1a2781aab2611f46;p=radegast%2Fradegast.git Close group and profile windows on disconnect. git-svn-id: https://radegast.googlecode.com/svn/trunk@402 f7a694da-4d33-11de-9ad6-1127a62b9fcd --- diff --git a/Radegast/GUI/Dialogs/GroupInfo.cs b/Radegast/GUI/Dialogs/GroupInfo.cs index e34a9a0..4257a6f 100644 --- a/Radegast/GUI/Dialogs/GroupInfo.cs +++ b/Radegast/GUI/Dialogs/GroupInfo.cs @@ -36,6 +36,8 @@ namespace Radegast { public partial class frmGroupInfo : RadegastForm { + private RadegastInstance instance; + public Group Group { get; set; } public GroupDetails GroupDetails { get; set; } @@ -46,6 +48,7 @@ namespace Radegast Disposed += new System.EventHandler(frmGroupInfo_Disposed); AutoSavePosition = true; + this.instance = instance; this.Group = group; GroupDetails = new GroupDetails(instance, group); @@ -54,11 +57,18 @@ namespace Radegast MinimumSize = Size; Controls.Add(GroupDetails); Text = group.Name + " - Group information"; + instance.Netcom.ClientDisconnected += new System.EventHandler(Netcom_ClientDisconnected); } void frmGroupInfo_Disposed(object sender, System.EventArgs e) { GroupDetails.Dispose(); + instance.Netcom.ClientDisconnected -= new System.EventHandler(Netcom_ClientDisconnected); + } + + void Netcom_ClientDisconnected(object sender, DisconnectedEventArgs e) + { + Close(); } } } diff --git a/Radegast/GUI/Dialogs/Profile.cs b/Radegast/GUI/Dialogs/Profile.cs index 6163885..7d201c5 100644 --- a/Radegast/GUI/Dialogs/Profile.cs +++ b/Radegast/GUI/Dialogs/Profile.cs @@ -82,7 +82,7 @@ namespace Radegast client.Avatars.AvatarPicksReply += new EventHandler(Avatars_AvatarPicksReply); client.Avatars.PickInfoReply += new EventHandler(Avatars_PickInfoReply); client.Parcels.ParcelInfoReply += new EventHandler(Parcels_ParcelInfoReply); - netcom.ClientLoggedOut += new EventHandler(netcom_ClientLoggedOut); + netcom.ClientDisconnected += new EventHandler(netcom_ClientDisconnected); InitializeProfile(); } @@ -93,7 +93,7 @@ namespace Radegast client.Avatars.AvatarPicksReply -= new EventHandler(Avatars_AvatarPicksReply); client.Avatars.PickInfoReply -= new EventHandler(Avatars_PickInfoReply); client.Parcels.ParcelInfoReply -= new EventHandler(Parcels_ParcelInfoReply); - netcom.ClientLoggedOut -= new EventHandler(netcom_ClientLoggedOut); + netcom.ClientDisconnected -= new EventHandler(netcom_ClientDisconnected); } void Avatars_AvatarPicksReply(object sender, AvatarPicksReplyEventArgs e) @@ -234,7 +234,7 @@ namespace Radegast ); } - private void netcom_ClientLoggedOut(object sender, EventArgs e) + void netcom_ClientDisconnected(object sender, DisconnectedEventArgs e) { Close(); }