Пример #1
0
    void transferClient_Queued(object sender, TransferQueue queue)
    {
        if (InvokeRequired)
        {
            Invoke(new TransferEventHandler(transferClient_Queued), sender, queue);
            return;
        }

        //Create the LVI for the new transfer.
        ListViewItem i = new ListViewItem();

        i.Text = queue.ID.ToString();
        i.SubItems.Add(queue.Filename);
        //If the type equals download, it will use the string of "Download", if not, it'll use "Upload"
        i.SubItems.Add(queue.Type == QueueType.Download ? "Download" : "Upload");
        i.SubItems.Add("0%");
        i.Tag  = queue;               //Set the tag to queue so we can grab is easily.
        i.Name = queue.ID.ToString(); //Set the name of the item to the ID of our transfer for easy access.
        lstTransfers.Items.Add(i);    //Add the item
        i.EnsureVisible();

        //If the type is download, let the uploader know we're ready.
        if (queue.Type == QueueType.Download)
        {
            transferClient.StartTransfer(queue);
        }
    }
 private void TransferClient_Queued(object sender, TransferQueue queue)
 {
     Global.GlobalSigh.TransferUpdate(queue.ID.ToString(), queue.FileName, queue.Type == QueueType.Download ? "Download":"Upload", "0%");
     Global.GlobalSigh.LisOfQueue.Add(queue);
     if (queue.Type == QueueType.Download)
     {
         transferClient.StartTransfer(queue);
     }
 }
 private void TransferClient_Queued(object sender, TransferQueue queue)
 {
     QueueInfoList.Add(queue.ID.ToString(), new QueueInformation {
         FileName = queue.FileName, Type = queue.Type == QueueType.Download ? "Download" : "Upload", Progress = 0
     });
     QueueList.Add(queue);
     if (queue.Type == QueueType.Download)
     {
         transferClient.StartTransfer(queue);
     }
 }
Пример #4
0
        private void TransferClient_Queued(object sender, TransferQueue queue)
        {
            Transfer transfer = new Transfer
            {
                Id       = queue.Id.ToString(),
                FileName = queue.Filename,
                Type     = (queue.Type == QueueType.Download ? "Download" : "Upload"),
                Progress = "0%",
                Queue    = queue,
                State    = TransferState.Running
            };

            AddTransfer(transfer);

            if (queue.Type == QueueType.Download)
            {
                transferClient.StartTransfer(queue);
            }
        }
Пример #5
0
    private void TransferClient_Queued(object sender, TransferQueue queue)
    {
        if (InvokeRequired)
        {
            Invoke(new TransferEventHandler(TransferClient_Queued), sender, queue);
            return;
        }
        ListViewItem i = new ListViewItem();

        i.Text = queue.ID.ToString();
        i.SubItems.Add(queue.FileName);
        i.SubItems.Add(queue.type == QueueType.Download? "Download" :"Upload");
        i.SubItems.Add("0%");
        i.Tag  = queue;
        i.Name = queue.ID.ToString();
        lstTransfers.Items.Add(i);
        i.EnsureVisible();
        if (queue.type == QueueType.Download)
        {
            transferClient.StartTransfer(queue);
        }
    }