Exemplo n.º 1
0
 /// <summary>
 /// Default Constructor, inicializa los valores por omisión de la configuración.
 /// </summary>
 public FileData()
 {
     PartSize            = 1024 * 1024 / 8;
     DownloadDir         = createDownloadDir();
     FileTimeOut         = 10;
     FileRiseUp          = 5;
     TimeIntervalTimer   = 1000;
     SimulteneusUpload   = 1;
     SimulteneusDownload = 1;
     fileList            = new FileInformationList();
 }
 /// <summary>
 /// Agrega una lista de archivos de un usuario de la red a la ventana 
 /// </summary>
 /// <param name="netUser">El usuario dueño de la lista de archivo</param>
 /// <param name="fileList">La lista de archivos</param>
 public void addFileList(NetUser netUser, FileInformationList fileList)
 {
     if (treeView.InvokeRequired)
     {
         NetUserFilesCallback d = new NetUserFilesCallback(addFileList);
         this.Invoke(d, new object[] { netUser, fileList });
     }
     else
     {
         removeFileList(netUser);
         FileInformation[] fileListArray = fileList.toArray();
         lock (thisLock)
         {
             foreach (FileInformation file in fileListArray)
             {
                 TreeNode fileNode = new TreeNode(file.Name + " (" + (file.Size / 1024) + " KB) " + " [" + netUser.Name + "]");
                 fileNode.ImageIndex = 0;
                 fileNode.SelectedImageIndex = 0;
                 NetUserFile netUserFile = new NetUserFile();
                 netUserFile.NetUser = netUser;
                 netUserFile.FileInformation = file;
                 fileNode.Tag = netUserFile;
                 treeView.Nodes.Add(fileNode);
             }
         }
     }
 }
 /// <summary>
 /// Default Constructor, inicializa los valores por omisión de la configuración.
 /// </summary>
 public FileData()
 {
     PartSize = 1024 * 1024 / 8;
     DownloadDir = createDownloadDir();
     FileTimeOut = 10;
     FileRiseUp = 5;
     TimeIntervalTimer = 1000;
     SimulteneusUpload = 1;
     SimulteneusDownload = 1;
     fileList = new FileInformationList();
 }