Beispiel #1
0
        public IUserConfiguration Clone()
        {
            var configuration = new UserApiConfiguration();

            configuration.FtpInterval       = this.FtpInterval;
            configuration.HasDeleteFtp      = this.HasDeleteFtp;
            configuration.Name              = this.Name;
            configuration.UserGMT           = this.UserGMT;
            configuration.AttachmentsFolder = this.AttachmentsFolder;

            if (this.Errors != null)
            {
                configuration.Errors = Errors.Clone();
            }

            if (this.Results != null)
            {
                configuration.Results = this.Results.Clone();
            }

            if (this.AdminEmail != null)
            {
                configuration.AdminEmail = this.AdminEmail.Clone();
            }

            if (this.DownloadFolders != null)
            {
                configuration.DownloadFolders = new List <string>();

                foreach (string downloadFolder in this.DownloadFolders)
                {
                    configuration.DownloadFolders.Add(downloadFolder);
                }
            }

            if (this.FileExtensions != null)
            {
                configuration.FileExtensions = new List <string>();
                foreach (string fileExtension in this.FileExtensions)
                {
                    configuration.FileExtensions.Add(fileExtension);
                }
            }

            if (this.Templates != null)
            {
                configuration.Templates = new List <ITemplateConfiguration>();
                foreach (ITemplateConfiguration template in this.Templates)
                {
                    configuration.Templates.Add(template.Clone());
                }
            }

            if (this.Ack != null)
            {
                configuration.Ack = this.Ack.Clone();
            }

            if (this.Credentials != null)
            {
                configuration.Credentials = this.Credentials.Clone();
            }

            if (this.Ftp != null)
            {
                configuration.Ftp = this.Ftp.Clone();
            }

            if (this.Reports != null)
            {
                configuration.Reports = this.Reports.Clone();
            }

            return(configuration);
        }