コード例 #1
0
 public void SaveLayoutData()
 {
     Assert.IsTrue(LayoutManager.Current.Login(ReferenceData.AdministratorString, string.Empty, Session));
     TestLayoutData1.GetLayoutData().Data1 = 1;
     TestLayoutData2.GetLayoutData().Data2 = 2;
     LayoutManager.Current.Logout();
     Assert.IsTrue(LayoutManager.Current.Login(ReferenceData.AdministratorString, string.Empty, Session));
     Assert.AreEqual(1, TestLayoutData1.GetLayoutData().Data1);
     Assert.AreEqual(2, TestLayoutData2.GetLayoutData().Data2);
     LayoutManager.Current.Logout();
 }
コード例 #2
0
        public static TestLayoutData1 GetLayoutData()
        {
            XPCollection <TestLayoutData1> layoutDataCollection = LayoutManager.Current.GetLayoutData <TestLayoutData1>();

            if (layoutDataCollection.Count != 0)
            {
                return(layoutDataCollection[0]);
            }
            TestLayoutData1 layoutData = new TestLayoutData1(VideoRentCurrentUser.GetCurrentUser(LayoutManager.Current.Session));

            LayoutManager.Current.LayoutData.Add(layoutData);
            return(layoutData);
        }