/// <summary> /// Remove the stored items. /// </summary> /// <param name="storeKey">The store key value.</param> public void RemoveStoredContactsOnline(ActionStoreKey storeKey) { lock (_lockContactsOnlineStore) { try { string[] item = _contactsOnline[storeKey.ToString()]; item = null; _contactsOnline.Remove(storeKey.ToString()); } catch { } } }
/// <summary> /// Store the contacts online. /// </summary> /// <param name="storeKey">The store key value.</param> /// <param name="contactsOnline">The contacts online list; else null to get contacts online.</param> /// <param name="context">The server context sending the data.</param> public void StoreContactsOnline(ActionStoreKey storeKey, string[] contactsOnline, Nequeo.Net.Sockets.ServerContext context = null) { lock (_lockContactsOnlineStore) { if (contactsOnline != null) { // Assign the list. _contactsOnline[storeKey.ToString()] = contactsOnline; } else { switch (storeKey) { case ActionStoreKey.ASK1: ExecuteRequest(context, "A1CO", true, ""); break; case ActionStoreKey.ASK2: ExecuteRequest(context, "A2CO", true, ""); break; } } } }
/// <summary> /// Store the contacts online hosts. /// </summary> /// <param name="storeKey">The store key value.</param> /// <param name="contactsOnlineHosts">The contacts online list; else null to get contacts online.</param> /// <param name="context">The server context sending the data.</param> /// <param name="uniqueIdentifiers">The unique client identifiers.</param> public void StoreContactsOnlineHosts(ActionStoreKey storeKey, string[] contactsOnlineHosts, Nequeo.Net.Sockets.ServerContext context = null, string[] uniqueIdentifiers = null) { lock (_lockContactsOnlineHostsStore) { if (contactsOnlineHosts != null) { // Assign the list. _contactsOnlineHosts[storeKey.ToString()] = contactsOnlineHosts; } else { switch (storeKey) { case ActionStoreKey.ASK1: ExecuteRequest(context, "Z1GS", true, String.Join(";", uniqueIdentifiers)); break; case ActionStoreKey.ASK2: ExecuteRequest(context, "Z2GS", true, String.Join(";", uniqueIdentifiers)); break; } } } }
/// <summary> /// Get the stored items. /// </summary> /// <param name="storeKey">The store key value.</param> /// <returns>The collection of stored items; else null.</returns> public string[] GetStoredContactsOnline(ActionStoreKey storeKey) { lock (_lockContactsOnlineStore) { try { return(_contactsOnline[storeKey.ToString()]); } catch { return(null); } } }