private static ArrayList GetAllSharedAccounts()
{
Hashtable table = new Hashtable();
ArrayList list;
foreach ( Account acct in Accounts.GetAccounts() )
{
IPAddress[] theirAddresses = acct.LoginIPs;
for ( int i = 0; i < theirAddresses.Length; ++i )
{
list = (ArrayList)table[theirAddresses[i]];
if ( list == null )
table[theirAddresses[i]] = list = new ArrayList();
list.Add( acct );
}
}
list = new ArrayList( table );
for ( int i = 0; i < list.Count; ++i )
{
DictionaryEntry de = (DictionaryEntry)list[i];
ArrayList accts = (ArrayList)de.Value;
if ( accts.Count == 1 )
list.RemoveAt( i-- );
else
accts.Sort( AccountComparer.Instance );
}
list.Sort( SharedAccountComparer.Instance );
return list;
}