Ejemplo n.º 1
0
		private string GetTargetLocation(ActionCopyFiles copyFiles)
		{
			if (copyFiles == null ||
				copyFiles.TargetRoot == null ||
				copyFiles.TargetDirectory == null)
			{
				return "";
			}

			string root = StaticShared.GetSpecialFolder(copyFiles.TargetRoot);
			return Path.Combine(root, copyFiles.TargetDirectory);
		}
Ejemplo n.º 2
0
		public CopyFilesAction(ActionCopyFiles copyFiles)
		{
			try
			{
				m_sourceLocation = GetSourceLocation(copyFiles);
				m_targetLocation = GetTargetLocation(copyFiles);
				m_includeFiles = GetIncludeFiles(copyFiles);
				m_excludeFiles = GetExcludeFiles(copyFiles);
			}
			catch (Exception ex)
			{
				Logger.LogError(ex, "Exception in setting CopyFilesAction members.");
			}
		}
Ejemplo n.º 3
0
		private List<string> GetIncludeFiles(ActionCopyFiles copyFiles)
		{
			if (copyFiles == null ||
				copyFiles.Include == null)
			{
				return new List<string>();
			}

			List<string> includes = new List<string>();
			foreach (ActionCopyFilesInclude include in copyFiles.Include)
			{
				if (include == null ||
					string.IsNullOrEmpty(include.Name))
				{
					break;
				}

				includes.Add(include.Name);
			}

			return includes;
		}
Ejemplo n.º 4
0
		private List<string> GetExcludeFiles(ActionCopyFiles copyFiles)
		{
			if (copyFiles == null ||
				copyFiles.Exclude == null)
			{
				return new List<string>();
			}

			List<string> excludes = new List<string>();
			foreach (ActionCopyFilesExclude exclude in copyFiles.Exclude)
			{
				if (exclude == null ||
					string.IsNullOrEmpty(exclude.Name))
				{
					break;
				}

				excludes.Add(exclude.Name);
			}
			return excludes;
		}
Ejemplo n.º 5
0
		private ActionCopyFiles GetActionCopyFiles(string sourceRoot, string sourceDirectory, string targetRoot,
		                                           string targetDirectory, string[] includes, string[] excludes)
		{
			ActionCopyFiles action = new ActionCopyFiles
			                         	{
			                         		Include = GetActionCopyFilesIncludes(includes),
			                         		Exclude = GetActionCopyFilesExcludes(excludes),
			                         		SourceRoot = sourceRoot,
			                         		SourceDirectory = sourceDirectory,
			                         		TargetRoot = targetRoot,
			                         		TargetDirectory = targetDirectory
			                         	};
			return action;
		}