public ProcessingFileViewModel(InstantActionModel instantAction, InstantActionTargetFile targetFile)
		{
			InstantAction = instantAction;
			TargetFile = targetFile;

			FilePath = targetFile.FilePath;
			ProcessState = targetFile.ObserveProperty(x => x.ProcessState)
				.ToReactiveProperty();

			Message = TargetFile.ObserveProperty(x => x.ProcessMessage)
				.ToReactiveProperty();
		}
		public void RemoveTargetFile(InstantActionTargetFile targetFile)
		{
			_TargetFiles.Remove(targetFile);
		}
		public void Execute(InstantActionTargetFile targetFile)
		{
			lock (_OutputFolderPathLock)
			{
				var reaction = new FolderReactionModel();

				var dir = new DirectoryInfo(Path.GetDirectoryName(targetFile.FilePath));
				using (var context = new ReactiveStreamContext(dir, targetFile.FilePath))
				{
					var dest = new AbsolutePathReactiveDestination();

					if (false == String.IsNullOrEmpty(this.OutputFolderPath) &&
						Directory.Exists(this.OutputFolderPath)
						)
					{
						dest.AbsoluteFolderPath = this.OutputFolderPath;
					}
					else
					{
						targetFile.Failed("File process failed, due to OutputFolder not exist.");
						return;
					}


					var streams = _Actions.Cast<ReactiveStraightStreamBase>().ToList();
					streams.Add(dest);

					foreach (var action in streams)
					{
						if (false == context.IsRunnning)
						{
							break;
						}

						action.Execute(context);
					}



					if (context.IsCompleted)
					{
						targetFile.Complete(context.OutputPath);
					}
					else
					{
						if (context.FailedMessage.Count > 0)
						{
							targetFile.Failed("Failed due to " + context.FailedMessage[0]);
						}
						else
						{
							targetFile.Failed("Failed");
						}
					}

				}
			}

			
		}
		public void AddTargetFile(string path)
		{
			if (_TargetFiles.Any(x => x.FilePath == path))
			{
				return;
			}



			lock (_OutputFolderPathLock)
			{
				var targetFile = new InstantActionTargetFile(path);
				targetFile.OutputFolderPath = this.OutputFolderPath;
				_TargetFiles.Add(targetFile);
			}


		}