Beispiel #1
0
        public void LoadScripts()
        {
            _Delegates.Clear();
            Logger.Global.SystemMessage(LogType.Information, "Loading scripts", string.Empty);
            if (!string.IsNullOrEmpty(_RuleDirectory))
            {
                foreach (string file in Directory.GetFiles(_RuleDirectory, "*.rule", SearchOption.AllDirectories))
                {
                    try
                    {
                        ServerRule rule = RuleEditorPresenter.LoadRule <ServerRule>(file);

                        if (rule.Script.Length > 0)
                        {
                            if (!_Delegates.ContainsKey(rule.ServerEvent))
                            {
                                _Delegates.Add(rule.ServerEvent, new ThreadSafeDictionary <ServerRule, ScriptObject>());
                            }
                            _Delegates[rule.ServerEvent].Add(rule, null);
                        }
                    }
                    catch (Exception e)
                    {
                        Logger.Global.SystemException(string.Empty, e);
                    }
                }
            }
        }
Beispiel #2
0
 protected override void CleanupManagedResources()
 {
     Parent = null;
     DictChildren.Values.DisposeListObjects();
     DictChildren.Clear();
     base.CleanupManagedResources();
 }
Beispiel #3
0
 public void Clear()
 {
     if (ShouldDisposeImages)
     {
         m_Images.Values.DisposeListObjects();
     }
     m_Images.Clear();
 }
        public void Clear_should_get_rid_of_all_items()
        {
            var dict = new ThreadSafeDictionary <string, string>(new Dictionary <string, string>());

            dict.Add(new KeyValuePair <string, string>("AnyKey", "AnyValue"));

            dict.Clear();

            Assert.That(dict.Count, Is.EqualTo(0));
        }
 private void InitializeEscapePodsByPlayerId()
 {
     escapePodsByPlayerId.Clear();
     foreach (EscapePodModel pod in EscapePods)
     {
         foreach (ushort playerId in pod.AssignedPlayers)
         {
             escapePodsByPlayerId[playerId] = pod;
         }
     }
 }
Beispiel #6
0
 private void Release()
 {
     foreach (var resource in ReadLog)
     {
         resource.Key.Release();
     }
     foreach (var resource in WriteLog)
     {
         resource.Key.Release();
     }
     ReadLog.Clear();
     WriteLog.Clear();
 }
 public void UnsubscribeAll()
 {
     lock (SyncObject)
     {
         try
         {
             m_DictObservables.Values.OfType <Unsubscriber <T> >().ForEach(o => o.Dispose());
             m_DictObservables.Clear();
         }
         catch (Exception e)
         {
             e.LogError();
         }
     }
 }
 public IHttpActionResult Get()
 {
     try
     {
         if (_streams?.Count > 0)
         {
             var diffMap = DiffChecker.GetDiff(_streams[LeftKey], _streams[RightKey]);
             _streams.Clear();
             return(Ok(diffMap));
         }
         return(BadRequest());
     }
     catch
     {
         return(BadRequest());
     }
 }
        /// <summary>
        /// removes all items from the cache
        /// </summary>
        public static void Reset()
        {
            // first, remove all type registrations in Mvc's binder registry
            foreach (var type in _typeCache)
            {
                ModelBinders.Binders.Remove(type.Key);
            }

            _hashToTypeDictionary.Clear();
            _typeToHashDictionary.Clear();

            // clear the cache
            _typeCache.Clear();

            // reset salt value
            _activeEncryptionSalt = _originalEncryptionSalt;
        }
Beispiel #10
0
        private void Clear()
        {
            try {
                if (Font != null)
                {
                    Font.Dispose();
                    Font = null;
                }

                GL.BindTexture(TextureTarget.Texture2D, 0);

                if (GlyphCount > 0)
                {
                    if (m_ListBase > 0)
                    {
                        GL.DeleteLists(m_ListBase, GlyphCount);
                    }
                    else if (!CharMap.IsNullOrEmpty())
                    {
                        CharMap.Values.Select(val => val.ListID).ForEach(lid => GL.DeleteLists(lid, 1));
                        CharMap.Clear();
                    }
                }
                if (!m_Textures.IsNullOrEmpty())
                {
                    GL.DeleteTextures(m_Textures.Length, m_Textures);
                }
            } catch (Exception ex) {
                ex.LogError();
            } finally {
                GlyphCount           = 0;
                m_ListBase           = 0;
                m_Textures           = null;
                Height               = 0;
                Count                = 0;
                m_EllipsisGlyphIndex = GlyphInfo.Empty;
            }
        }
 public virtual void Clear()
 {
     validators.Clear();
 }
 public static void ResetDurations()
 {
     taskInfos.Clear();
 }
Beispiel #13
0
 public void Clear()
 {
     _callCount = 0;
     _allReceivedCalls.Clear();
     _stopped = false;
 }
Beispiel #14
0
 public void Clear()
 {
     // This should be an snapshot operation
     _wrapped.Clear();
 }
Beispiel #15
0
 public void Dispose()
 {
     _streams.Clear();
 }
 public void Clear()
 {
     entities.Clear();
 }
Beispiel #17
0
 // For testing only
 public void ClearCache()
 {
     cache.Clear();
 }
Beispiel #18
0
 /// <summary>
 /// removes all items from the cache
 /// </summary>
 public static void Reset()
 {
     typeCache.Clear();
 }
Beispiel #19
0
 internal void Clear()
 {
     _queues.Clear();
     _topics.Clear();
     _messageQueues.Clear();
 }
Beispiel #20
0
 public void Dispose()
 {
     components.Clear();
     GC.SuppressFinalize(this);
 }
Beispiel #21
0
 public void Dispose()
 {
     _container.Clear();
 }