protected override ValidationResult InnerValidate()
		{
			var result = new ValidationResult();

			if (AppPolicy == null)
			{
				result.AddMessage("AppPolicy Deleted.");
				return result;
			}

			if (false == AppPolicyManager.Security.IsAuthorized(AppPolicy.ApplicationPath))
			{
				result.AddMessage("AppPolicy is not Authorized.");
				return result;
			}

			if (Options.Count == 0)
			{
				result.AddMessage("Needed one or more Options");
				return result;
			}


			if (false == CanCreateSandbox())
			{
				result.AddMessage("AppLaunchReactiveAction:Invalid AppName:guid is " + AppGuid);
				return result;
			}


			var sandbox = CreateSandbox();

			if (false == sandbox.Validate(GenerateTempStreamContext()))
			{
				result.AddMessage("may be diffarent Reaction I/O type and Action Input Type.");
			}			

			return result;
		}
Ejemplo n.º 2
0
		protected override ValidationResult InnerValidate()
		{
			var result = new ValidationResult();

			if (IncludeFilter.Count == 0)
			{
				result.AddMessage("IncludeFilter can not Empty.");
				return result;
			}

			foreach (var fileFilterParttern in IncludeFilter)
			{
				if (false == IsValidFilterPatternText(fileFilterParttern))
				{
					result.AddMessage("invalid include filter pattern text: " + fileFilterParttern);
				}
			}

			foreach (var fileFilterParttern in ExcludeFilter)
			{
				if (false == IsValidFilterPatternText(fileFilterParttern))
				{
					result.AddMessage("invalid exclude filter pattern text: " + fileFilterParttern);
				}
			}

			return result;
		}
		protected override ValidationResult InnerValidate()
		{
			var result = new ValidationResult();

			var destFolder = GetDestinationFolder();
			if (destFolder == null)
			{
				result.AddMessage("出力先のフォルダの指定に問題があります。");
			}

			if (destFolder != null && false == destFolder.Exists)
			{
				result.AddMessage("出力先のフォルダが存在しません。");
			}


			try
			{
				var renamed = TestRename();

				if (String.IsNullOrWhiteSpace(renamed))
				{
					result.AddMessage("failed Rename process. empty OutputNamePattern ?");
				}
				else
				{
					var invalidChars = Path.GetInvalidFileNameChars();
					if (renamed.Intersect(invalidChars).DefaultIfEmpty() == Enumerable.Empty<char>())
					{
						result.AddMessage("変換後のRenameテキストにファイル名に使用できない文字列が含まれています。");
					}
				}

			}
			catch(Exception e)
			{
				result.AddMessage("出力名の評価に失敗しました。");
				result.AddMessage(e.Message);
			}
			

			return result;
		}