コード例 #1
0
        internal static void Demo()
        {
            //using (var src = new ResourceHog("source"))
            //{
            //    using (var dest = new ResourceHog("destination"))
            //    {
            //        dest.CopyFrom(src);
            //    }
            //    Console.WriteLine("After closing destination block");
            //}
            //Console.WriteLine("After closing the source block");

            // you can refactor to:
            using (var src = new ResourceHog("source"))
                using (var dest = new ResourceHog("destination"))
                    dest.CopyFrom(src);
            Console.WriteLine("After closing destination block");
            Console.WriteLine("After closing the source block");
        }
コード例 #2
0
 internal void CopyFrom(ResourceHog source)
 {
 }