Example #1
0
 public void QueryTransmissionFile(TransFileKind kind, string[] files)
 {
     if (TransmissionChannel != null && files != null && files.Length > 0)
     {
         TransmissionChannel.QueryTransmission(DownloadTransmissionService.ServicePort, kind, files);
     }
 }
Example #2
0
 public void QueryTransmissionFile(TransFileKind kind, string file)
 {
     if (!String.IsNullOrEmpty(file))
     {
         QueryTransmissionFile(kind, new string[] { file });
     }
 }
Example #3
0
 public void QueryTransmission(string ip, int transPort, TransFileKind kind, string[] files)
 {
     m_Files.Clear();
     foreach (var file in files)
     {
         string resFile;
         if (kind == TransFileKind.ResourceFile)
         {
             resFile = Options.UserResourceRootPath + file;
         }
         else if (kind == TransFileKind.ProjectFile)
         {
             resFile = Options.DefaultProjectsRootPath + file;
         }
         else
         {
             continue;
         }
         if (File.Exists(resFile))
         {
             var fi  = new FileInfo(resFile);
             var md5 = CommonMethods.GetFileMD5(resFile);
             m_Files[resFile] = new TransferFileInfo(Guid.NewGuid(), kind, file, fi.Length, md5);
         }
     }
     StartTransmission(ip, transPort);
 }
Example #4
0
 public TransferFileInfo(Guid guid, TransFileKind kind, string file, long length, string md5)
 {
     GUID       = guid;
     Kind       = kind;
     FileName   = file;
     FileLength = length;
     MD5Code    = md5;
 }
Example #5
0
 protected virtual string GetFileDirectory(TransFileKind kind)
 {
     if (kind == TransFileKind.ProjectFile)
     {
         return(Options.DefaultProjectsRootPath);
     }
     else if (kind == TransFileKind.ResourceFile)
     {
         return(Options.UserResourceRootPath);
     }
     return(System.Windows.Forms.Application.StartupPath.TrimEnd('\\') + "\\");
 }
Example #6
0
        public void QueryTransmission(int transPort, TransFileKind kind, string[] files)
        {
            var imp = OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;

            QueryTransmission(imp.Address, transPort, kind, files);
        }