コード例 #1
0
 public void Show()
 {
     if (AuthenticationService.LoggedUser.IsAdmin)
     {
         FrontAdminView frontAdminView = new FrontAdminView();
         frontAdminView.Show();
     }
     else
     {
         PlaylistsView ordinaryUserView = new PlaylistsView();
         ordinaryUserView.Show();
     }
 }
コード例 #2
0
ファイル: FrontAdminView.cs プロジェクト: MitkoZ/BlackSound
        public void Show()
        {
            while (true)
            {
                FrontUserViewEnum choice = RenderMenu();
                try
                {
                    switch (choice)
                    {
                    case FrontUserViewEnum.AdminView:
                    {
                        SongsView songsView = new SongsView();
                        songsView.Show();
                        break;
                    }

                    case FrontUserViewEnum.OrdinaryUserView:
                    {
                        PlaylistsView playlistsView = new PlaylistsView();
                        playlistsView.Show();
                        break;
                    }

                    case FrontUserViewEnum.Exit:
                    {
                        return;
                    }
                    }
                }
                catch (Exception ex)
                {
                    Console.Clear();
                    Console.WriteLine(ex.Message);
                    Console.ReadKey(true);
                }
            }
        }