Ejemplo n.º 1
0
        public static void ReadWriteAccess()
        {
            Point3d newPoint = new Point3d(-19.121m, 0.2m, 199.96m);

            //FLAW: SHOULD NOT BE ABLE TO DO THIS .. .actually may not be a problem
            //can't call dispose on copy and it has scope lesser in extent to the scope of lck.
            {
                using Rwlkres lck = TheRwVault.Lock();
                var copy = lck; //Figure out why this isn't being flagged as an error
                using Rwlkres copy2 = copy;
                using (var cop3 = copy2)
                {
                    Console.WriteLine(cop3.Value.ToString());
                    Console.WriteLine(@"The value is: [" + lck.Value + @"].");
                    lck.Value.UpdatePoint(in newPoint);
                    Console.WriteLine(@"The value is: [" + lck.Value + @"].");
                }
            }

            //static void DoStuff(Rwlkres foo)
            //{
            //    Console.WriteLine(foo.Value.ToString());
            //}
        }