/// <summary>
        /// Adds the specified handle to the cache
        /// </summary>
        /// <param name="hWnd">The handle to add to the cache</param>
        public void AddWindow(IntPtr hWnd, BovadaTable table)
        {
            cacheLock.EnterUpgradeableReadLock();

            try
            {
                if (windowsHandles.ContainsKey(hWnd))
                {
                    return;
                }

                cacheLock.EnterWriteLock();

                try
                {
                    if (!windowsHandles.ContainsKey(hWnd))
                    {
                        windowsHandles.Add(hWnd, table);
                    }
                }
                finally
                {
                    cacheLock.ExitWriteLock();
                }
            }
            finally
            {
                cacheLock.ExitUpgradeableReadLock();
            }
        }
Example #2
0
 /// <summary>
 /// Adds new table to tables dictionary
 /// </summary>
 /// <param name="tableUid">Unique identifier of table</param>
 protected virtual void AddTable(uint tableUid)
 {
     lock (openedTables)
     {
         if (openedTables != null && !openedTables.ContainsKey(tableUid))
         {
             var catcherTable = new BovadaTable(eventAggregator);
             openedTables.Add(tableUid, catcherTable);
         }
     }
 }