コード例 #1
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            //These are the little color indicator in the Right Panel which appears when clicking the top right side user status button.
            RightPanelAdminTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.ADMINSTATUS);
            RightPanelOwnerTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.OWNERSTATUS);
            RightPanelActiveStatusBorder.Background    = SlackConstants.getColor(SlackConstants.ACTIVESTATUS);
            RightPanelBotStatusBorder.Background       = SlackConstants.getColor(SlackConstants.BOTSSTATUS);
            RightPanelDeletedStatusBorder.Background   = SlackConstants.getColor(SlackConstants.DELETEDSTATUS);
            RightPanelAwayStatusBorder.Background      = SlackConstants.getColor(SlackConstants.AWAYSTATUS);

            RightPanelUserStatusTypeListBorder.Visibility = Visibility.Collapsed;


            //Network Connection Check
            bool hasNetworkConnection = NetworkInterface.GetIsNetworkAvailable();

            if (hasNetworkConnection == false)
            {
                var messageDialog = new MessageDialog("No Internet Connection.");
                messageDialog.Commands.Add(new UICommand("Ok", (command) =>
                {
                    return;
                }));
                messageDialog.DefaultCommandIndex = 1;
                await messageDialog.ShowAsync();
            }
        }
コード例 #2
0
        private void RightPanelUserStatusTypeStackItem_Tapped(object sender, TappedRoutedEventArgs e)
        {
            Border StatusTypeItem = (Border)sender;

            if (StatusTypeItem.Name == "RightPanelStatusTypeItemAllBorder")
            {
                teamuserlist.FilterTeamList(SlackConstants.ALLSTATUS);
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.ALLSTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.ALLSTATUS.CapitalizeFirstLetter();
                UserSearchTextBox.Text = SlackConstants.ALLSTATUS;
            }
            else if (StatusTypeItem.Name == "RightPanelStatusTypeItemAdminBorder")
            {
                teamuserlist.FilterTeamList(SlackConstants.ADMINSTATUS);
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.ADMINSTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.ADMINSTATUS.CapitalizeFirstLetter();
                UserSearchTextBox.Text = SlackConstants.ADMINSTATUS;
            }
            else if (StatusTypeItem.Name == "RightPanelStatusTypeItemOwnerBorder")
            {
                teamuserlist.FilterTeamList(SlackConstants.OWNERSTATUS);
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.OWNERSTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.OWNERSTATUS.CapitalizeFirstLetter();
                UserSearchTextBox.Text = SlackConstants.OWNERSTATUS;
            }
            else if (StatusTypeItem.Name == "RightPanelStatusTypeItemActiveBorder")
            {
                teamuserlist.FilterTeamList(SlackConstants.ACTIVESTATUS);
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.ACTIVESTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.ACTIVESTATUS;
                UserSearchTextBox.Text = SlackConstants.ACTIVESTATUS;
            }
            else if (StatusTypeItem.Name == "RightPanelStatusTypeItemBotsBorder")
            {
                teamuserlist.FilterTeamList(SlackConstants.BOTSSTATUS);
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.BOTSSTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.BOTSSTATUS.CapitalizeFirstLetter();
                UserSearchTextBox.Text = SlackConstants.BOTSSTATUS;
            }
            else if (StatusTypeItem.Name == "RightPanelStatusTypeItemDeletedBorder")
            {
                teamuserlist.FilterTeamList(SlackConstants.DELETEDSTATUS);
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.DELETEDSTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.DELETEDSTATUS.CapitalizeFirstLetter();
                UserSearchTextBox.Text = SlackConstants.DELETEDSTATUS;
            }
            else if (StatusTypeItem.Name == "RightPanelStatusTypeItemAwayBorder")
            {
                teamuserlist.FilterTeamList(SlackConstants.AWAYSTATUS);
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.AWAYSTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.AWAYSTATUS.CapitalizeFirstLetter();
                UserSearchTextBox.Text = SlackConstants.AWAYSTATUS;
            }

            RightPanelUserStatusTypeListBorder.Visibility = Visibility.Collapsed;
        }
コード例 #3
0
        /// This allows users to search a specific user by both profile name and first name as well as use some key words to quick filter large list
        /// KEY WORDS (admin, away, owner, bots, active, deleted, "" = all)
        /// ADDITION KEY WORDS (marketing, android, ios, customer, ceo, cfo, cto, wp, server, etc...) <- Excellent for larger teams
        private void UserSearchTextBox_KeyUp(object sender, KeyRoutedEventArgs e)
        {
            TextBox usersearchtextbox = (TextBox)sender;
            String  searchstring      = usersearchtextbox.Text.ToLower();

            teamuserlist.SearchTeamList(searchstring);

            //Update UI to reflect changes.
            if (searchstring == SlackConstants.ADMINSTATUS)
            {
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.ADMINSTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.ADMINSTATUS.CapitalizeFirstLetter();
            }
            else if (searchstring == SlackConstants.OWNERSTATUS)
            {
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.OWNERSTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.OWNERSTATUS.CapitalizeFirstLetter();
            }
            else if (searchstring == SlackConstants.BOTSSTATUS)
            {
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.BOTSSTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.BOTSSTATUS.CapitalizeFirstLetter();
            }
            else if (searchstring == SlackConstants.ACTIVESTATUS)
            {
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.ACTIVESTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.ACTIVESTATUS.CapitalizeFirstLetter();
            }
            else if (searchstring == SlackConstants.DELETEDSTATUS)
            {
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.DELETEDSTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.DELETEDSTATUS.CapitalizeFirstLetter();
            }
            else if (searchstring == SlackConstants.ALLSTATUS)
            {
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.ALLSTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.ALLSTATUS.CapitalizeFirstLetter();
            }
            else if (searchstring == SlackConstants.AWAYSTATUS)
            {
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.AWAYSTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.AWAYSTATUS.CapitalizeFirstLetter();
            }
            else if (searchstring.Trim().Length > 0)
            {
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.ALLSTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.ALLSTATUS.CapitalizeFirstLetter();
            }
            else
            {
                TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.ALLSTATUS);
                TitleMemberListTypeTextBlock.Text          = SlackConstants.ALLSTATUS.CapitalizeFirstLetter();
            }
        }
コード例 #4
0
        /// This is just a simple refresh button to force downloading of fresh data.
        private async void ReloadUserListBorder_Tapped(object sender, TappedRoutedEventArgs e)
        {
            //Network Connections Check
            bool hasNetworkConnection = NetworkInterface.GetIsNetworkAvailable();

            if (hasNetworkConnection == true)
            {
                await teamuserlist.PopulateUsers(false);

                UsersListLiveView.DataContext = teamuserlist;
                teamuserlist.FilterTeamList(SlackConstants.ALLSTATUS);
            }

            //Resets the search UI elements
            TitleMemberListTypeStatusBorder.Background = SlackConstants.getColor(SlackConstants.ALLSTATUS);
            TitleMemberListTypeTextBlock.Text          = SlackConstants.ALLSTATUS;
            UserSearchTextBox.Text = "search (name, firstname or role)";
        }