示例#1
0
 internal void SetSession(Session session)
 {
     Session = session;
 }
示例#2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            dGridTasks.AutoGenerateColumns = false;
            dGridTasks.ItemsSource = TaskList;
            callbacker = new Callbacker(CallBack);
            Session = new Session(@"data source=Grind.db", "http://*****:*****@"ws://localhost:8080/", callbacker);
            ttfrmControl.SetSession(Session);
            userMaintenanceControl1.SetSession(Session);
            ChatsControl.SetSession(Session);

            //Controllers("http://*****:*****@"data source=J:\Root\Grind\GrindClient\Grind.Common\Grind.db");
            //Person x1 = new Person { created_at = DateTime.Now, updated_at = DateTime.Now, id = 3 };
            //Cache.AddObject<Person>(x1);
            //Person x2 = Cache.GetObject<Person>(3);
            Session.ReadPeople();
            if (Globals.People.Count == 0)
            {
                Globals.People.Add(new Person { id = 0, name = "DummyUser", level = eLevel.Master, trigram = "DummyUser" });
            }
            Session.Controllers.ReadTasks(ref TaskList);
            Session.User = new Person { active = false, id = -1, name = "OfflineUser", trigram = "0x0" };
            //cobExecutor.Items.AddRange(Globals.People.Select(x => x.name).ToArray());
            //cobReviewer.Items.AddRange(Globals.People.Select(x => x.name).ToArray());
            ttfrmControl.FillPeopleDropDown(Globals.People);
            dGridTasks.ItemsSource = TaskList;
            SetMode(ViewMode.Normal);
        }