Пример #1
0
        /// <summary>
        /// Create File Distribution request
        /// </summary>
        /// <param name="prequestID">Request id</param>
        /// <param name="pstrFolderName">The folder’s name to be uploaded/downloaded</param>
        /// <param name="pdtExpiration">The date and time when the distribution task will expire and the file will be deleted from the T2G product. </param>
        /// <param name="plstFilePathList">A list of relative file paths </param>
        /// <param name="pbCompression">If true, the files will be compressed before being transferred from train to the ground or vice-versa. false, otherwise</param>
        /// <param name="plstRecipient">The lists of targeted T2G systems and the list of T2G applications to be notified once the files are uploaded.</param>
        /// <param name="pstartDate">The date and time when the distribution of the specified files should start</param>
        /// <param name="pstrDescription">A description of the file transfer task.</param>
        /// <param name="ptransferMode">File transfer mode</param>
        /// <param name="ipriority">The priority of the transfer: a number between 0 and 32 (0 being the highest priority).</param>
        /// <param name="pOnFileDistributeNotification">Event handler for notification on file distribute</param>
        /// <param name="pOnTaskCreatedNotification">Event handler to be notified when transfer task is created.</param>
        public FileDistributionRequest(Guid prequestID, string pstrFolderName, DateTime pdtExpiration, List <string> plstFilePathList, bool pbCompression, List <RecipientId> plstRecipient, DateTime pstartDate, string pstrDescription, FileTransferMode ptransferMode, sbyte ipriority, EventHandler <FileDistributionStatusArgs> pOnFileDistributeNotification, EventHandler <FileDistributionTaskCreatedArgs> pOnTaskCreatedNotification)
        {
            this.requestID      = prequestID;
            this.expirationDate = pdtExpiration;
            this.compression    = pbCompression;
            this.lstRecipient   = plstRecipient;
            this.startDate      = pstartDate;
            this.strDescription = pstrDescription;
            this.transferMode   = ptransferMode;
            this.priority       = ipriority;
            this.OnFileDistributeNotification = pOnFileDistributeNotification;
            this._onTaskCreatedNotification   = pOnTaskCreatedNotification;

            //create RemoteFolderClass
            this.folder = new RemoteFolderClass(pstrFolderName);

            //Fill the folder with files. This will automatically generate CRC for each file and CRCGuid for the folder
            foreach (string lFilePath in plstFilePathList)
            {
                //CRC Calculation is long. Developer can initialize file when required.
                this.folder.AddFileToFolder(new RemoteFileClass(lFilePath, false));
            }

            this.folder.ExpirationDate = pdtExpiration;
        }
Пример #2
0
        /// <summary>
        /// Create Download Folder Request
        /// </summary>
        /// <param name="prequestID">Request id</param>
        /// <param name="pstrFolderName">The folder’s name to be uploaded/downloaded</param>
        /// <param name="pdtExpiration">The date and time when the distribution task will expire and the file will be deleted from the T2G product. </param>
        /// <param name="pDownloadFolderPath">Download folder path</param>
        /// <param name="plstRecipient">The lists of targeted T2G systems and the list of T2G applications to be notified once the files are uploaded.</param>
        /// <param name="pstartDate">The date and time when the distribution of the specified files should start</param>
        /// <param name="pstrDescription">A description of the file transfer task.</param>
        /// <param name="ptransferMode">File transfer mode</param>
        /// <param name="ipriority">The priority of the transfer: a number between 0 and 32 (0 being the highest priority).</param>
        /// <param name="pOnFileDistributeNotification">File Transfer notification event handler</param>
        /// <param name="pfolderId">folder id to be downloaded</param>
        /// <param name="pOnFileDistributeNotification">Event handler for notification on file distribute</param>
        /// <param name="pOnTaskCreatedNotification">Event handler to be notified when transfer task is created.</param>
        public FileDistributionRequest(Guid prequestID, DateTime pdtExpiration, List <RecipientId> plstRecipient, DateTime pstartDate, string pstrDescription, FileTransferMode ptransferMode, sbyte ipriority, EventHandler <FileDistributionStatusArgs> pOnFileDistributeNotification, int pfolderId, EventHandler <FileDistributionTaskCreatedArgs> pOnTaskCreatedNotification)
        {
            this.requestID      = prequestID;
            this.expirationDate = pdtExpiration;
            //this.compression = pbCompression;
            this.lstRecipient   = plstRecipient;
            this.startDate      = pstartDate;
            this.strDescription = pstrDescription;
            this.priority       = ipriority;
            this.onFileDistributeNotification = pOnFileDistributeNotification;
            this._onTaskCreatedNotification   = pOnTaskCreatedNotification;
            this.transferMode = ptransferMode;

            //create RemoteFolderClass
            this.folder                = new RemoteFolderClass();
            this.folder.FolderId       = pfolderId;
            this.folder.ExpirationDate = pdtExpiration;
        }
 public FileTransferBase(IContact recipient, string filename)
 {
     _transferMode = FileTransferMode.Sending;
     _contact = recipient;
     _fileName = filename;
 }
 public FileTransferBase(IContact from)
 {
     _transferMode = FileTransferMode.Recieving;
     _contact = from;
 }
Пример #5
0
 public static extern int navigator_invoke_invocation_set_file_transfer_mode(
     IntPtr invoke,
     FileTransferMode transfer_mode);
Пример #6
0
        /*
         * /// <summary>Builds service list.</summary>
         * /// <param name="pServiceStructList">List of service structures.</param>
         * /// <param name="pServiceList">The List of services [out].</param>
         * /// <returns>True if it succeeds, false if it fails.</returns>
         * internal static bool BuildServiceList(PIS.Ground.Core.T2G.WebServices.VehicleInfo.serviceList pServiceStructList, out List<ServiceInfo> pServiceList)
         * {
         *      bool lResult = false;
         *      pServiceList = new List<ServiceInfo>();
         *
         *      if (pServiceStructList != null)
         *      {
         *              foreach (PIS.Ground.Core.T2G.WebServices.VehicleInfo.serviceStruct lServiceStruct in pServiceStructList)
         *              {
         *                      ServiceInfo lService;
         *                      if (BuildService(lServiceStruct, out lService))
         *                      {
         *                              pServiceList.Add(lService);
         *                      }
         *              }
         *
         *              lResult = true;
         *      }
         *
         *      return lResult;
         * }
         * */

        /// <summary>Build LinkTypeEnum of T2G from Ground.</summary>
        /// <param name="objFileTransferMode">FileTransferMode of PIS ground.</param>
        /// <returns>LinkTypeEnum of T2G.</returns>
        internal static PIS.Ground.Core.T2G.WebServices.FileTransfer.linkTypeEnum BuildLinkTypeEnum(FileTransferMode objFileTransferMode)
        {
            PIS.Ground.Core.T2G.WebServices.FileTransfer.linkTypeEnum lnkTypeEnum;

            switch (objFileTransferMode)
            {
            case FileTransferMode.LowBandwidth:
                lnkTypeEnum = PIS.Ground.Core.T2G.WebServices.FileTransfer.linkTypeEnum.lowBandwidth;
                break;

            case FileTransferMode.HighBandwidth:
                lnkTypeEnum = PIS.Ground.Core.T2G.WebServices.FileTransfer.linkTypeEnum.highBandwidth;
                break;

            case FileTransferMode.AnyBandwidth:
                lnkTypeEnum = PIS.Ground.Core.T2G.WebServices.FileTransfer.linkTypeEnum.anyBandwidth;
                break;

            default:
                lnkTypeEnum = PIS.Ground.Core.T2G.WebServices.FileTransfer.linkTypeEnum.lowBandwidth;
                break;
            }

            return(lnkTypeEnum);
        }
Пример #7
0
 /// <summary>
 /// Create Download Folder Request
 /// </summary>
 /// <param name="prequestID">Request id</param>
 /// <param name="pstrFolderName">The folder’s name to be uploaded/downloaded</param>
 /// <param name="pdtExpiration">The date and time when the distribution task will expire and the file will be deleted from the T2G product. </param>
 /// <param name="pDownloadFolderPath">Download folder path</param>
 /// <param name="plstRecipient">The lists of targeted T2G systems and the list of T2G applications to be notified once the files are uploaded.</param>
 /// <param name="pstartDate">The date and time when the distribution of the specified files should start</param>
 /// <param name="pstrDescription">A description of the file transfer task.</param>
 /// <param name="ptransferMode">File transfer mode</param>
 /// <param name="ipriority">The priority of the transfer: a number between 0 and 32 (0 being the highest priority).</param>
 /// <param name="pOnFileDistributeNotification">File Transfer notification event handler</param>
 /// <param name="pfolderId">folder id to be downloaded</param>
 public DownloadFolderRequest(Guid prequestID, DateTime pdtExpiration, string pDownloadFolderPath, List <RecipientId> plstRecipient, DateTime pstartDate, string pstrDescription, FileTransferMode ptransferMode, sbyte ipriority, EventHandler <FileDistributionStatusArgs> pOnFileDistributeNotification, int pfolderId)
     : base(prequestID, pdtExpiration, plstRecipient, pstartDate, pstrDescription, ptransferMode, ipriority, pOnFileDistributeNotification, pfolderId, null)
 {
     //this.requestID = prequestID;
     //this.expirationDate = pdtExpiration;
     this.downloadFolderPath = pDownloadFolderPath;
     ////this.compression = pbCompression;
     //this.lstRecipient = plstRecipient;
     //this.startDate = pstartDate;
     //this.strDescription = pstrDescription;
     //this.priority = ipriority;
     //this.onFileDistributeNotification = pOnFileDistributeNotification;
     //lstError = new List<string>();
     //this.dicFileOperationStatus = new Dictionary<string, FtpStatus>();
     //folderId = pfolderId;
     //this.transferMode = ptransferMode;
 }
 /// <summary>
 /// Create File Distribution request
 /// </summary>
 /// <param name="prequestID">Request id</param>
 /// <param name="pstrFolderName">The folder to be uploaded</param>
 /// <param name="pdtExpiration">The date and time when the distribution task will expire and the file will be deleted from the T2G product. </param>
 /// <param name="pbCompression">If true, the files will be compressed before being transferred from train to the ground or vice-versa. false, otherwise</param>
 /// <param name="plstRecipient">The lists of targeted T2G systems and the list of T2G applications to be notified once the files are uploaded.</param>
 /// <param name="pstartDate">The date and time when the distribution of the specified files should start</param>
 /// <param name="pstrDescription">A description of the file transfer task.</param>
 /// <param name="ptransferMode">File transfer mode</param>
 /// <param name="ipriority">The priority of the transfer: a number between 0 and 32 (0 being the highest priority).</param>
 /// <param name="pOnFileDistributeNotification">Event handler to be notified on file distribution progress.</param>
 /// <param name="pOnTaskCreatedNotification">Event handler to be notified when transfer task is created.</param>
 public UploadFileDistributionRequest(Guid prequestID, IRemoteFolderClass pFolder, DateTime pdtExpiration, bool pbCompression, List <RecipientId> plstRecipient, DateTime pstartDate, string pstrDescription, FileTransferMode ptransferMode, sbyte ipriority, EventHandler <FileDistributionStatusArgs> pOnFileDistributeNotification, EventHandler <FileDistributionTaskCreatedArgs> pOnTaskCreatedNotification)
     : base(prequestID, pFolder, pdtExpiration, pbCompression, plstRecipient, pstartDate, pstrDescription, ptransferMode, ipriority, pOnFileDistributeNotification, pOnTaskCreatedNotification)
 {
     this.associatedRequestId = new List <Guid>();
 }
Пример #9
0
 /// <summary>
 /// Initializes a new instance of the DownloadFileDistributionRequest class
 /// </summary>
 /// <param name="prequestID">Request id</param>
 /// <param name="pstrFolderName">The folder’s name to be uploaded/downloaded</param>
 /// <param name="pdtExpiration">The date and time when the distribution task will expire and the file will be deleted from the T2G product. </param>
 /// <param name="plstFilePathList">A list of relative file paths </param>
 /// <param name="pbCompression">If true, the files will be compressed before being transferred from train to the ground or vice-versa. false, otherwise</param>
 /// <param name="pftpServerIP">The IP address of the FTP server hosting the files to be downloaded.</param>
 /// <param name="pftpPortNumber">The FTP server port number.</param>
 /// <param name="pftpUserName">The login that should be used to log on to the FTP server.</param>
 /// <param name="pftpPassword">The password that should be used to log on to the FTP server.</param>
 /// <param name="pftpDirectory">The FTP directory of the files to be downloaded. The path specified must be relative to the FTP user’s root path. If this parameter is empty, the FTP user’s root directory is used (“.”).</param>
 /// <param name="plstRecipient">The lists of targeted T2G systems and the list of T2G applications to be notified once the files are uploaded.</param>
 /// <param name="pstartDate">The date and time when the distribution of the specified files should start</param>
 /// <param name="pstrDescription">A description of the file transfer task.</param>
 /// <param name="ptransferMode">File transfer mode</param>
 /// <param name="ipriority">The priority of the transfer: a number between 0 and 32 (0 being the highest priority).</param>
 public DownloadFileDistributionRequest(Guid prequestID, string pstrFolderName, DateTime pdtExpiration, List <string> plstFilePathList, bool pbCompression, string pftpServerIP, ushort pftpPortNumber, string pftpUserName, string pftpPassword, string pftpDirectory, List <RecipientId> plstRecipient, DateTime pstartDate, string pstrDescription, FileTransferMode ptransferMode, sbyte ipriority, EventHandler <FileDistributionStatusArgs> pOnFileDistributeNotification)
     : base(prequestID, pstrFolderName, pdtExpiration, plstFilePathList, pbCompression, plstRecipient, pstartDate, pstrDescription, ptransferMode, ipriority, pOnFileDistributeNotification, null)
 {
     this.ftpServerIP   = pftpServerIP;
     this.ftpPortNumber = pftpPortNumber;
     this.ftpUserName   = pftpUserName;
     this.ftpPassword   = pftpPassword;
     this.ftpDirectory  = pftpDirectory;
 }