Exemplo n.º 1
0
 /// <inheritdoc cref="IDisposable.Dispose" />
 public void Dispose()
 {
     TestStream?.Dispose();
     TestIn?.Dispose();
     TestOut?.Dispose();
     TestError?.Dispose();
 }
Exemplo n.º 2
0
 public TestClassE(int key, TestIn testIn)
 {
     TestIn.singleton.GetObj().Get().key = 123;
     TestIn.singleton.GetObjProp = null;
     this.key = Add(key);
     this.key = this.Add(this.key);
     this.key = AddStatic(Add(key));
     this.key = testIn.Add(key);
     testIn.SetMe(this);
     TestIn.singleton.SetMe(this);
 }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            //协变
            TestOut <Derived> OD = () =>
            {
                return(new Derived());
            };
            TestOut <Base> OB      = OD;
            Base           baseVar = OB();
            //逆变
            TestIn <Base> IB = (a) =>
            {
            };
            TestIn <Derived> ID = IB;

            ID(new Derived());
        }