コード例 #1
0
		public AppOptionInstanceViewModel(AppLaunchReactiveAction action, AppOptionInstance instance)
		{
			Action = action;
			OptionInstance = instance;


			OptionName = OptionInstance.OptionDeclaration.Name;

			OptionValues = OptionInstance.FromAppOptionInstance()
				.ToList();
		}
コード例 #2
0
		public AppLaunchActionViewModel(ActionsEditViewModel editVM, FolderReactionModel reactionModel, AppLaunchReactiveAction appAction)
			 : base(reactionModel)
		{
			EditVM = editVM;
			Action = appAction;

			AppPolicy = appAction.AppPolicy;
			if (AppPolicy != null)
			{
				AppName = AppPolicy.AppName;
				AppGuid = AppPolicy.Guid;

				UsingOptions = Action.Options.ToReadOnlyReactiveCollection(x =>
					new AppOptionInstanceViewModel(Action, x)
					);

				Action.Options.ObserveElementPropertyChanged()
					.Subscribe(x => Action.Validate());
			}
			else
			{
				AppName = "<App not found>";
			}
		}
コード例 #3
0
		public AppLaunchActionInstanceViewModel(ActionsSelectInstantActionStepViewModel parentVM, AppLaunchReactiveAction action)
		{
			ActionSelectStepVM = parentVM;

			AppLaunchAction = action;
			
			var appPolicy = action.AppPolicy;


			AppName = appPolicy.AppName;
			AppGuid = appPolicy.Guid;

			UsingOptions = AppLaunchAction.Options
				.ToReadOnlyReactiveCollection(x => new AppOptionInstanceViewModel(AppLaunchAction, x));
		}
コード例 #4
0
		internal void RemoveAction(AppLaunchReactiveAction action)
		{
			var vm = ActionVMs.Single(x => x.AppLaunchAction == action);
			ActionVMs.Remove(vm);
			InstantAction.RemoveAction(action);

			RaiseCanGoNextChanged();
		}
コード例 #5
0
		internal void AddAction(AppLaunchReactiveAction action)
		{
			InstantAction.AddAction(action);
			ActionVMs.Add(new AppLaunchActionInstanceViewModel(this, action));

			RaiseCanGoNextChanged();
		}
コード例 #6
0
		/// <summary>
		/// 一つのオプションだけを扱うアプリ起動アクションを作成する。
		/// </summary>
		/// <param name="appGuid"></param>
		/// <param name="decl"></param>
		/// <returns></returns>
		public static AppLaunchReactiveAction CreateOneOptionAppLaunchAction(Guid appGuid)
		{
			var actionModel = new AppLaunchReactiveAction();
			actionModel.AppGuid = appGuid;

			return actionModel;
		}
コード例 #7
0
		public void RemoveAction(AppLaunchReactiveAction action)
		{
			_Actions.Remove(action);

			ResetTargetFileProcessState();
		}
コード例 #8
0
		public void AddAction(AppLaunchReactiveAction action)
		{
			_Actions.Add(action);

			ResetTargetFileProcessState();
		}
コード例 #9
0
		public HistoryActionViewModel(HistoryDataViewModel parentVM, AppLaunchReactiveAction action)
		{
			ParentVM = parentVM;
			Action = action;

			AppName = action.AppPolicy?.AppName ?? "<Deleted AppPolicy>";
			OptionsText = String.Join("+", action.Options.Select(x => x.OptionDeclaration?.Name ?? ""));

			OptionInstances = action.Options
				.Select(x => new AppOptionInstanceViewModel(Action, x))
				.ToList();
		}