private void EnsureFriends() { if (m_friends == null || DateTime.Now.Subtract(m_FriendsRetrieved).TotalMinutes > 30) { try { m_friends = m_provider.GetFriends(); } catch (COMException cex) { if (Helpers.IsOSCException(cex)) { throw; } else { throw new OSCException(@"GetFriends call failed.", OSCExceptions.OSC_E_INTERNAL_ERROR, cex); } } catch (ApplicationException ex) { throw new OSCException(@"GetFriends call failed.", OSCExceptions.OSC_E_INTERNAL_ERROR, ex); } PersonCache.AddRange(m_friends.People); } }
private void EnsureFriends() { if (s_friends == null) { try { s_friends = m_provider.GetFriends(); } catch (COMException cex) { if (Helpers.IsOSCException(cex)) { throw; } else { throw new OSCException(@"GetFriends call failed.", OSCExceptions.OSC_E_INTERNAL_ERROR, cex); } } catch (ApplicationException ex) { throw new OSCException(@"GetFriends call failed.", OSCExceptions.OSC_E_INTERNAL_ERROR, ex); } PersonCache.AddRange(s_friends.People); } }
internal void InvalidateFriends() { Monitor.Enter(m_friendsLock); try { m_friends = null; m_FriendsRetrieved = DateTime.MinValue; } finally { Monitor.Exit(m_friendsLock); } }