コード例 #1
0
ファイル: ResourceCache.cs プロジェクト: rajeshwarn/MochaNote
        // ========================================
        // constructor
        // ========================================
        public ResourceCache()
        {
            _keyToResourceCreatorPolicyTuple = new Dictionary <object, ResourceCreatorPolicyTuple>();
            _keyToResource          = new Dictionary <object, IDisposable>();
            _keyToImmediateResource = new Dictionary <object, IDisposable>();

            _context    = new ResourceUsingContext(this);
            _usingDepth = 0;

            _enabled = true;
        }
コード例 #2
0
ファイル: ResourceCache.cs プロジェクト: rajeshwarn/MochaNote
        // ========================================
        // method
        // ========================================
        // === IDisposable ==========
        public void Dispose()
        {
            DisposeResources();
            _keyToResourceCreatorPolicyTuple.Clear();

            _keyToResource                   = null;
            _keyToImmediateResource          = null;
            _keyToResourceCreatorPolicyTuple = null;

            _context = null;

            GC.SuppressFinalize(this);
        }