/// <inheritdoc cref="IDisposable.Dispose" /> public void Dispose() { TestStream?.Dispose(); TestIn?.Dispose(); TestOut?.Dispose(); TestError?.Dispose(); }
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); }
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()); }