Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/Common/WeakReference.cs @ 13808

Last change on this file since 13808 was 12503, checked in by aballeit, 9 years ago

#2283 added GUI and charts; fixed MCTS

File size: 602 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5
6namespace Microsoft.Research.DynamicDataDisplay.Common
7{
8  internal sealed class WeakReference<T>
9  {
10    private readonly WeakReference reference;
11
12    public WeakReference(WeakReference reference)
13    {
14      this.reference = reference;
15    }
16
17    public WeakReference(T referencedObject)
18    {
19      this.reference = new WeakReference(referencedObject);
20    }
21
22    public bool IsAlive
23    {
24      get { return reference.IsAlive; }
25    }
26
27    public T Target
28    {
29      get { return (T)reference.Target; }
30    }
31  }
32}
Note: See TracBrowser for help on using the repository browser.