예제 #1
0
파일: STMObjects.cs 프로젝트: markvx/STMNet
        public object Clone()
        {
            var c = new MyCloneableClass {
                I = I, S = S
            };

            return(c);
        }
예제 #2
0
파일: STMObjects.cs 프로젝트: markvx/STMNet
        public void TestCloneClass()
        {
            var c = new MyCloneableClass {
                I = 1, S = "hello"
            };
            var oC = StmTransaction.CreateObject(c);

            using (var tx = StmTransaction.BeginTransaction())
            {
                var c2 = oC.Read(StmReadOption.ReadWrite);
                Assert.AreNotEqual(c, c2);
                Assert.AreEqual(c.I, c2.I);
                Assert.AreEqual(c.S, c2.S);
            }

            using (var tx = StmTransaction.BeginTransaction())
            {
                var c2 = oC.Read();                 // the default read option is "ReadWrite"
                Assert.AreNotEqual(c, c2);
            }
        }
예제 #3
0
		public void TestCloneClass()
		{
			var c = new MyCloneableClass {I = 1, S = "hello"};
			var oC = StmTransaction.CreateObject(c);
			using (var tx = StmTransaction.BeginTransaction())
			{
				var c2 = oC.Read(StmReadOption.ReadWrite);
				Assert.AreNotEqual(c, c2);
				Assert.AreEqual(c.I, c2.I);
				Assert.AreEqual(c.S, c2.S);
			}

			using (var tx = StmTransaction.BeginTransaction())
			{
				var c2 = oC.Read(); // the default read option is "ReadWrite"
				Assert.AreNotEqual(c, c2);
			}
		}
예제 #4
0
		public object Clone()
		{
			var c = new MyCloneableClass {I = I, S = S};
			return c;
		}