title: Event subscription changed - InvalidOperationException
body: <p>UI Elements can subscribe events like press, hold or release. Therefore, I created an object variable to store those information</p>
  
  <pre><code>        private Dictionary&lt;TouchListenerType, List&lt;Action&lt;int, float, Vector2&gt;&gt;&gt; touchData = new Dictionary&lt;TouchListenerType, List&lt;Action&lt;int, float, Vector2&gt;&gt;&gt;();
  </code></pre>
  
  <p>Every update cycle I iterate over every provided input and delegate it to the subscribers.</p>
  
  <pre><code>        try
          {
              for (int currentTouchIndex = touchCollections.Count - 1; currentTouchIndex &gt;= 0; currentTouchIndex--)
              {
                  Vector2 position = MapInput(touchCollections[currentTouchIndex].Position);
                  if (touchCollections[currentTouchIndex].State == TouchLocationState.Moved &amp;&amp;
                      touchData[TouchListenerType.Move].Count &gt; 0)
                      touchData[TouchListenerType.Move].ForEach(d =&gt; d.Invoke(touchCollections[currentTouchIndex].Id, touchCollections[currentTouchIndex].Pressure, position));
                  else if (touchCollections[currentTouchIndex].State == TouchLocationState.Pressed &amp;&amp;
                      touchData[TouchListenerType.Press].Count &gt; 0)
                      touchData[TouchListenerType.Press].ForEach(d =&gt; d.Invoke(touchCollections[currentTouchIndex].Id, touchCollections[currentTouchIndex].Pressure, position));
                  else if (touchCollections[currentTouchIndex].State == TouchLocationState.Released &amp;&amp;
                      touchData[TouchListenerType.Release].Count &gt; 0)
                      touchData[TouchListenerType.Release].ForEach(d =&gt; d.Invoke(touchCollections[currentTouchIndex].Id, touchCollections[currentTouchIndex].Pressure, position));
              }
          } catch { } //Enumeration could have been changed
  </code></pre>
  
  <p>If a subscriber decides to unsubscribe or to add another subscription based on the provided input, the exception <strong>System.InvalidOperationException</strong> will be thrown, because the event subscriber count has been changed. Till now I just put a try-catch around the block. But I would like to avoid the original problem.</p>
  
  <p>Based on the fact that every subscriber is able to unsubscribe/subscribe in the delegate, I can't work with semaphores. Also I would like to avoid to create a copy of the event every update cycle, since this application is running on mobile devices. How am I able to solve this problem?</p>