Beispiel #1
0
 private void viewBtn_Click(object sender, RoutedEventArgs e)
 {
     if (enableComponent)
     {
         if (helper.checkInternetConnection())
         {
             files file = (files)list.SelectedItem;
             if (file.IsImage())
             {
                 Frame.Navigate(typeof(ImageView), file);
             }
         }
         else
         {
             helper.popup("Check your internet connection", "NO INTERNET");
         }
     }
 }
Beispiel #2
0
        private void list_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (list.SelectedItems.Count == 1)
            {
                download.Visibility      = Visibility.Visible;
                deleteFileBtn.Visibility = Visibility.Visible;
                plotBtn.Visibility       = Visibility.Visible;
                share.Visibility         = Visibility.Visible;
                files file = (files)list.SelectedItem;
                if (file.IsImage())
                {
                    viewBtn.Visibility = Visibility.Visible;
                }
                else
                {
                    viewBtn.Visibility = Visibility.Collapsed;
                }
            }

            else if (list.SelectedItems.Count > 1)
            {
                download.Visibility      = Visibility.Visible;
                deleteFileBtn.Visibility = Visibility.Visible;
                plotBtn.Visibility       = Visibility.Visible;
                share.Visibility         = Visibility.Visible;
                viewBtn.Visibility       = Visibility.Collapsed;
            }
            else
            {
                download.Visibility      = Visibility.Collapsed;
                deleteFileBtn.Visibility = Visibility.Collapsed;
                share.Visibility         = Visibility.Collapsed;
                plotBtn.Visibility       = Visibility.Collapsed;
                viewBtn.Visibility       = Visibility.Collapsed;
            }
        }
Beispiel #3
0
        private void list_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (list.SelectedItems.Count == 1)
            {
                files file = (files)list.SelectedItem;
                if (file.IsImage())
                {
                    viewFile.Visibility = Visibility.Visible;
                }
                if (isAdmin)
                {
                    dePlotBtn.Visibility = Visibility.Visible;
                }
                else
                {
                    if (file.getHost() == helper.getUsername())
                    {
                        dePlotBtn.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        dePlotBtn.Visibility = Visibility.Collapsed;
                    }
                }

                download.Visibility = Visibility.Visible;
            }
            else if (list.SelectedItems.Count > 1)
            {
                if (isAdmin)
                {
                    dePlotBtn.Visibility = Visibility.Visible;
                }
                else
                {
                    bool          isHost = true;
                    List <object> temp   = list.SelectedItems.ToList <object>();
                    foreach (files file in temp)
                    {
                        if (file.getHost() != helper.getUsername())
                        {
                            isHost = false;
                        }
                    }
                    if (isHost)
                    {
                        dePlotBtn.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        dePlotBtn.Visibility = Visibility.Collapsed;
                    }
                }
                viewFile.Visibility = Visibility.Collapsed;
                download.Visibility = Visibility.Visible;
            }
            else
            {
                dePlotBtn.Visibility = Visibility.Collapsed;
                download.Visibility  = Visibility.Collapsed;
                viewFile.Visibility  = Visibility.Collapsed;
            }
        }