示例#1
0
        private async void Window_Activated(object sender, EventArgs e)
        {
            if (flag)
            {
                Back.Background = new ImageBrush(new BitmapImage(new Uri(path)));
                Back.Foreground = new ImageBrush(new BitmapImage(new Uri(path)));

                ProjectCommands pc  = new ProjectCommands();
                DataCommands    dc  = new DataCommands();
                List <string>   lst = await dc.GiveOwnersProjects(user);

                List <Project> prlst = await pc.GiveAllProjects();

                try
                {
                    for (int i = 0; i < prlst.Count; i++)
                    {
                        for (int j = 0; j < lst.Count; j++)
                        {
                            if (lst[j] == prlst[i].Name)
                            {
                                listBox.Items.Add(prlst[i]);
                            }
                        }
                    }
                }
                catch (NullReferenceException)
                {
                    MessageBox.Show("You havent projects and risks");
                }
                flag = false;
            }
        }
示例#2
0
        private async void Window_Activated(object sender, EventArgs e)
        {
            if (flagApearing)
            {
                Back.Background = new ImageBrush(new BitmapImage(new Uri(path)));
                Back.Foreground = new ImageBrush(new BitmapImage(new Uri(path)));
                ProjectCommands pc   = new ProjectCommands();
                List <Project>  list = await pc.GiveAllProjects();

                for (int i = 0; i < list.Count; i++)
                {
                    listBox.Items.Add(list[i]);
                    listBox.Items.ToString();
                }
                flagApearing = false;
            }
        }