コード例 #1
0
ファイル: ImageView.xaml.cs プロジェクト: logaprakash/PLoT
        /// The methods provided in this section are simply used to allow
        /// NavigationHelper to respond to the page's navigation methods.
        ///
        /// Page specific logic should be placed in event handlers for the
        /// <see cref="Common.NavigationHelper.LoadState"/>
        /// and <see cref="Common.NavigationHelper.SaveState"/>.
        /// The navigation parameter is available in the LoadState method
        /// in addition to page state preserved during an earlier session.

        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            files file = e.Parameter as files;

            pageTitle.Text  = file.getFilename();
            enableComponent = false;
            image.Source    = await users.downloadImage(file.getFilename(), file.getHost());

            enableComponent = true;
            navigationHelper.OnNavigatedTo(e);
        }
コード例 #2
0
ファイル: viewPlot.xaml.cs プロジェクト: logaprakash/PLoT
        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;
            }
        }