/// <summary>
 ///     Register an uploader.
 /// </summary>
 /// <param name="uploader">uploader</param>
 public void Register(IReportUploader uploader)
 {
     if (uploader == null)
     {
         throw new ArgumentNullException("uploader");
     }
     uploader.UploadFailed += OnUploadFailed;
     _uploaders.Add(uploader);
 }
示例#2
0
        ///// <summary>
        /////     Max number of items that may wait in queue to get uploaded.
        ///// </summary>
        //public int MaxQueueSize
        //{
        //    get => _reportQueue.MaxQueueSize;
        //    set => _reportQueue.MaxQueueSize = value;
        //}

        /// <summary>
        ///     Register an uploader.
        /// </summary>
        /// <param name="uploader">uploader</param>
        /// <exception cref="ArgumentNullException">uploader</exception>
        public void Register(IReportUploader uploader)
        {
            if (uploader == null)
            {
                throw new ArgumentNullException("uploader");
            }


            // For cases where a custom uploader is used instead of (Err.Configuration.Credentials)
#if NETSTANDARD2_0
            if (_configuration.ApplicationVersion == null && Assembly.GetCallingAssembly() != Assembly.GetExecutingAssembly())
            {
                _configuration.AssignAssemblyVersion(Assembly.GetCallingAssembly());
            }
#else
            if (_configuration.ApplicationVersion == null && Assembly.GetEntryAssembly() != Assembly.GetEntryAssembly())
            {
                _configuration.AssignAssemblyVersion(Assembly.GetEntryAssembly());
            }
#endif

            //uploader.UploadFailed += OnUploadFailed;
            _uploaders.Add(uploader);
        }
        public UploadFilesProcess()
        {
            AutomationFactory factory = new AutomationFactory();

            uploader = factory.CreateReportFTPUploader();
        }