public MainWindow(WorkerView user) { InitializeComponent(); WorkerControl theUser = new WorkerControl(user); Pages.ProfilePage userProfile = new Pages.ProfilePage(user); StateChanged += TestWindow_StateChanged; close_btn.Click += (s, e) => Close(); max_btn.Click += (s, e) => WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized; min_btn.Click += (s, e) => WindowState = WindowState.Minimized; page_Frame.NavigationUIVisibility = System.Windows.Navigation.NavigationUIVisibility.Hidden; userBox.Child = theUser; Page[] pages; if (user.WorkerRank == WorkerView.Rank.Manager) { pages = new Page[] { new Pages.InventoryPage(), new Pages.MangeWorkersPage(), userProfile }; } else { pages = new Page[] { userProfile }; theUser.Click += (s, u) => menu.Change_Selection(0); } menu.ItemSourse = pages; Logic.Instance.WorkerUpdated += (s, e) => userBox.Child = new WorkerControl(Logic.Instance.GetUserView(user.Id)); }
// Use this for initialization void Start() { maxSpeed = 3; turnSpeed = 0.2f; rb3d = this.GetComponentInParent <Rigidbody>(); workerObject = GameObject.Find("WorkerControl"); workerControl = workerObject.GetComponentInChildren <WorkerControl>(); }
/// <summary> Constructs a thread to process IWaitAndContinue work items </summary> public WaitAndContinueWorker() { _control = new WorkerControl(); _work = new WaitAndContinueList(); _work.AddWork(_control); _worker = new Thread(Run); _worker.SetApartmentState(ApartmentState.MTA); _worker.IsBackground = true; _worker.Name = GetType().Name; _worker.Start(); }
/// <summary> Constructs a thread to process IWaitAndContinue work items </summary> public WaitAndContinueWorker() { _control = new WorkerControl(); _work = new WaitAndContinueList(); _work.AddWork(_control); _worker = new Thread(Run); _worker.SetApartmentState(ApartmentState.MTA); _worker.IsBackground = true; _worker.Name = GetType().Name; _worker.Start(); }