public override void OnWireReceived(UnsafeReader stream) { var kind = (AddRemove)stream.ReadInt(); var value = ReadValueDelegate(SerializationContext, stream); ReceiveTrace?.Log($"{this} :: {kind} :: {value.PrintToString()}"); using (UsingDebugInfo()) { switch (kind) { case AddRemove.Add: mySet.Add(value); break; case AddRemove.Remove: mySet.Remove(value); break; default: throw new ArgumentOutOfRangeException(); } } }
public bool Add(T item) { using (myCookieFactory()) return(myBackingSet.Add(item)); }