Beispiel #1
0
        private void OnSetupFile(object sender, RoutedEventArgs e)
        {
            var             curItem = ((ListBoxItem)StackWidget.ContainerFromElement((System.Windows.Controls.Button)sender)).Content;
            StackWidgetItem item    = (StackWidgetItem)curItem;

            item.InstallFile();
        }
Beispiel #2
0
        private void OnDownloadFile(object sender, RoutedEventArgs e)
        {
            //Thread.Sleep(100000);
            var             curItem = ((ListBoxItem)StackWidget.ContainerFromElement((System.Windows.Controls.Button)sender)).Content;
            StackWidgetItem item    = (StackWidgetItem)curItem;
            var             pkName  = item.packageName;

            item.OnClickDownloadBtn();
        }
Beispiel #3
0
 public DownLoadTask(StackWidgetItem _item)
 {
     item                = _item;
     url                 = _item.url_;
     stopped             = false;
     updateTime          = DateTime.Now;
     bytesTotal          = _item.bytesTotal_;
     bytesDownLastUpdate = _item.bytesDown_;
     bytesDown           = _item.bytesDown_;
     hasError            = false;
 }
Beispiel #4
0
        private void listItem_clicked(object sender, RoutedEventArgs e)
        {
            //var curItem = ((ListBoxItem)StackWidget.ContainerFromElement((System.Windows.Controls.StackPanel)sender)).Content;
            var             sd       = (System.Windows.Controls.ContextMenu)sender;
            var             curItem  = ((ListBoxItem)StackWidget.ContainerFromElement(sd)).Content;
            StackWidgetItem item     = (StackWidgetItem)curItem;
            var             menuItem = (System.Windows.Controls.MenuItem)e.OriginalSource;

            if (menuItem.Header.ToString() == "打开文件夹")
            {
                item.OpenFolder();
            }
            else if (menuItem.Header.ToString() == "删除文件")
            {
                item.DeleteFile();
            }
            else
            {
                item.InstallFile();
            }
        }