コード例 #1
0
 internal bool GetSwoop(int index, out Swoop indicator)
 {
     lock (Swoops)
     {
         return(Swoops.TryGetValue(index, out indicator));
     }
 }
コード例 #2
0
 internal void RemoveAllSwoops()
 {
     lock (Swoops)
     {
         Swoops.Clear();
     }
     IsDirty = true;
     Refresh();
 }
コード例 #3
0
        internal bool RemoveSwoop(int index)
        {
            lock (Swoops)
            {
                if (!Swoops.ContainsKey(index))
                {
                    return(false);
                }
                Swoops.Remove(index);
            }

            // forece a refresh
            IsDirty = true;
            Refresh();

            return(true);
        }
コード例 #4
0
        internal int AddSwoop(Swoop indicator)
        {
            var index = 0;

            lock (Swoops)
            {
                // get a new counter
                index = System.Threading.Interlocked.Increment(ref SwoopCount);

                // add a new swoop
                Swoops.Add(index, indicator);
            }

            // force a refresh
            IsDirty = true;
            Refresh();

            return(index);
        }