This class encapsulates the data and the operations presented by UI elements that enable editing of an ICondition.
Inheritance: IViewModel
コード例 #1
0
        /// <summary>
        /// Ensures that the install step name is valid.
        /// </summary>
        /// <remarks>
        /// An install step name is valid if it is not empty.
        /// </remarks>
        /// <returns><c>true</c> if the install step name is valid;
        /// <c>false</c> otherwise.</returns>
        protected bool ValidateVisibilityCondition()
        {
            bool booIsValid = ConditionEditorVM.Validate();

            OnInstallStepValidated();
            return(booIsValid);
        }
		/// <summary>
		/// A simple constructor that initializes the view model with its dependencies.
		/// </summary>
		/// <param name="p_vmlConditionEditor">The <see cref="ConditionEditorVM"/> that encapsulates the data
		/// and operations for diaplying the <see cref="ICondition"/> editor.</param>
		/// <param name="p_vmlFileList">The <see cref="FileListEditorVM"/> that encapsulates the data
		/// and operations for diaplying the file list editor.</param>
		/// <param name="p_cisConditionallyInstalledFileSet">The <see cref="ConditionallyInstalledFileSet"/> being edited.</param>
		public ConditionallyInstalledFileSetEditorVM(ConditionEditorVM p_vmlConditionEditor, FileListEditorVM p_vmlFileList, ConditionallyInstalledFileSet p_cisConditionallyInstalledFileSet)
		{
			ConditionEditorVM = p_vmlConditionEditor;
			FileListEditorVM = p_vmlFileList;
			ConditionallyInstalledFileSet = p_cisConditionallyInstalledFileSet;

			ConditionEditorVM.ConditionSaved += new EventHandler(ConditionSaved);
		}
        /// <summary>
        /// A simple constructor that initializes the view model with its dependencies.
        /// </summary>
        /// <param name="p_vmlConditionEditor">The <see cref="ConditionEditorVM"/> that encapsulates the data
        /// and operations for diaplying the <see cref="ICondition"/> editor.</param>
        /// <param name="p_vmlFileList">The <see cref="FileListEditorVM"/> that encapsulates the data
        /// and operations for diaplying the file list editor.</param>
        /// <param name="p_cisConditionallyInstalledFileSet">The <see cref="ConditionallyInstalledFileSet"/> being edited.</param>
        public ConditionallyInstalledFileSetEditorVM(ConditionEditorVM p_vmlConditionEditor, FileListEditorVM p_vmlFileList, ConditionallyInstalledFileSet p_cisConditionallyInstalledFileSet)
        {
            ConditionEditorVM             = p_vmlConditionEditor;
            FileListEditorVM              = p_vmlFileList;
            ConditionallyInstalledFileSet = p_cisConditionallyInstalledFileSet;

            ConditionEditorVM.ConditionSaved += new EventHandler(ConditionSaved);
        }
コード例 #4
0
        public InstallStepEditorVM(ConditionEditorVM p_vmlConditionEditor, InstallStep p_stpStep, InstallStepProperties p_ispEditableProperties)
        {
            NameVisible           = (p_ispEditableProperties & InstallStepProperties.Name) > 0;
            GroupSortOrderVisible = (p_ispEditableProperties & InstallStepProperties.GroupSortOrder) > 0;
            VisibilityVisible     = (p_ispEditableProperties & InstallStepProperties.Visibility) > 0;
            ConditionEditorVM     = p_vmlConditionEditor;
            InstallStep           = p_stpStep;

            SortOrders = Enum.GetValues(typeof(SortOrder));
            Errors     = new ErrorContainer();

            ConditionEditorVM.ConditionSaved += new EventHandler(ConditionSaved);
        }
コード例 #5
0
		/// <summary>
		/// Creates a <see cref="ConditionEditorVM"/>.
		/// </summary>
		/// <param name="p_lstModFiles">The list of files in the script's mod.</param>
		/// <param name="p_cvtConverter">A converter to use to convert CPL.</param>
		/// <returns>A <see cref="ConditionEditorVM"/>.</returns>
		protected virtual ConditionEditorVM CreateConditionEditorVM(IList<VirtualFileSystemItem> p_lstModFiles, CPLConverter p_cvtConverter)
		{
			CPLTextEditorVM vmlCplTextEditor = new CPLTextEditorVM(new FO3CplHighlightingStrategy(ScriptType.GetCplParserFactory()), ScriptType.GetCplParserFactory());
			
			List<CplConditionEditor> lstConditionEditors = new List<CplConditionEditor>();
			lstConditionEditors.Add(new CplPluginConditionEditor(p_lstModFiles));
			lstConditionEditors.Add(new CplFlagConditionEditor());
			CPLEditorVM vmlCplEditor = new CPLEditorVM(vmlCplTextEditor, lstConditionEditors, ConditionOperator.And | ConditionOperator.Or);


			ConditionEditorVM vmlConditionEditor = new ConditionEditorVM(vmlCplEditor, p_cvtConverter, null);
			return vmlConditionEditor;
		}
コード例 #6
0
		/// <summary>
		/// A simple constructor the initializes the object with the given dependencies.
		/// </summary>
		/// <param name="p_vmlViewModel">The view model that provides the data and operations for this view.</param>
		public ConditionEditor(ConditionEditorVM p_vmlViewModel)
			:this()
		{
			ViewModel = p_vmlViewModel;
		}
コード例 #7
0
		/// <summary>
		/// The editor to use to edit an <see cref="Option"/>.
		/// </summary>
		/// <param name="p_optOption">The <see cref="Option"/> to edit.</param>
		/// <param name="p_lstModFiles">The list of files in the mod to which the <see cref="XmlScript"/>
		/// being edited belongs.</param>
		/// <returns>The editor to use to edit an <see cref="Option"/>. <c>null</c> is returned if the
		/// current <see cref="XmlScript"/> does not support editing <see cref="Option"/>s.</returns>
		public virtual NodeEditor GetOptionEditor(Option p_optOption, IList<VirtualFileSystemItem> p_lstModFiles)
		{
			OptionInfoEditorVM vmlOptionInfo = new OptionInfoEditorVM(p_optOption, p_lstModFiles);
			
			InstallableFileEditorVM vmlInstallableFile = new InstallableFileEditorVM(null, p_lstModFiles);
			FileListEditorVM vmlFileList = new FileListEditorVM(vmlInstallableFile, p_optOption.Files);

			CPLTextEditorVM vmlCplTextEditor = new CPLTextEditorVM(new FO3CplHighlightingStrategy(ScriptType.GetCplParserFactory()), ScriptType.GetCplParserFactory());

			List<CplConditionEditor> lstConditionEditors = new List<CplConditionEditor>();
			lstConditionEditors.Add(new CplPluginConditionEditor(p_lstModFiles));			
			CPLEditorVM vmlCplEditor = new CPLEditorVM(vmlCplTextEditor, lstConditionEditors, ConditionOperator.And | ConditionOperator.Or);

			FO3CplConverter cvtConverter = new FO3CplConverter(ScriptType.GetCplParserFactory());
			ConditionEditorVM vmlConditionEditor = new ConditionEditorVM(vmlCplEditor, cvtConverter, null);
			ConditionalTypePatternEditorVM vmlPatternEditor = new ConditionalTypePatternEditorVM(vmlConditionEditor, null);
			ConditionalTypeEditorVM vmlTypeEditor = new ConditionalTypeEditorVM(vmlPatternEditor, cvtConverter, null);
			OptionTypeResolverEditorVM vmlTypeResolverEditor = new OptionTypeResolverEditorVM(vmlTypeEditor, p_optOption);

			OptionEditorVM vmlOptionEditor = new OptionEditorVM(vmlOptionInfo, vmlFileList, vmlTypeResolverEditor);

			return new OptionEditor(vmlOptionEditor);
		}
コード例 #8
0
		/// <summary>
		/// Creates a <see cref="ConditionEditorVM"/>.
		/// </summary>
		/// <param name="p_lstModFiles">The list of files in the script's mod.</param>
		/// <param name="p_cvtConverter">A converter to use to convert CPL.</param>
		/// <returns>A <see cref="ConditionEditorVM"/>.</returns>
		protected virtual ConditionEditorVM CreateConditionEditorVM(IList<VirtualFileSystemItem> p_lstModFiles, CPLConverter p_cvtConverter)
		{
			CPLEditorVM vmlCplEditor = CreateCPLEditorVM(p_lstModFiles);
			ConditionEditorVM vmlConditionEditor = new ConditionEditorVM(vmlCplEditor, p_cvtConverter, null);
			return vmlConditionEditor;
		}
コード例 #9
0
		public InstallStepEditorVM(ConditionEditorVM p_vmlConditionEditor, InstallStep p_stpStep, InstallStepProperties p_ispEditableProperties)
		{
			NameVisible = (p_ispEditableProperties & InstallStepProperties.Name) > 0;
			GroupSortOrderVisible = (p_ispEditableProperties & InstallStepProperties.GroupSortOrder) > 0;
			VisibilityVisible = (p_ispEditableProperties & InstallStepProperties.Visibility) > 0;
			ConditionEditorVM = p_vmlConditionEditor;
			InstallStep = p_stpStep;

			SortOrders = Enum.GetValues(typeof(SortOrder));
			Errors = new ErrorContainer();

			ConditionEditorVM.ConditionSaved += new EventHandler(ConditionSaved);
		}
コード例 #10
0
		/// <summary>
		/// A simple constructor that initializes the view model with its dependencies.
		/// </summary>
		/// <param name="p_cemConditionEditorVM">The <see cref="NodeEditors.ConditionEditorVM"/> that encapsulates the data
		/// and operations for diaplying the <see cref="ICondition"/> editor.</param>
		/// <param name="p_ctpConditionalTypePattern">The <see cref="ConditionalTypePattern"/> being edited.</param>
		public ConditionalTypePatternEditorVM(ConditionEditorVM p_cemConditionEditorVM, ConditionalTypePattern p_ctpConditionalTypePattern)
		{
			ConditionEditorVM = p_cemConditionEditorVM;
			ConditionalTypePattern = p_ctpConditionalTypePattern;
			OptionTypes = Enum.GetValues(typeof(OptionType));
		}
コード例 #11
0
 /// <summary>
 /// A simple constructor the initializes the object with the given dependencies.
 /// </summary>
 /// <param name="p_vmlViewModel">The view model that provides the data and operations for this view.</param>
 public ConditionEditor(ConditionEditorVM p_vmlViewModel)
     : this()
 {
     ViewModel = p_vmlViewModel;
 }
 /// <summary>
 /// A simple constructor that initializes the view model with its dependencies.
 /// </summary>
 /// <param name="p_cemConditionEditorVM">The <see cref="NodeEditors.ConditionEditorVM"/> that encapsulates the data
 /// and operations for diaplying the <see cref="ICondition"/> editor.</param>
 /// <param name="p_ctpConditionalTypePattern">The <see cref="ConditionalTypePattern"/> being edited.</param>
 public ConditionalTypePatternEditorVM(ConditionEditorVM p_cemConditionEditorVM, ConditionalTypePattern p_ctpConditionalTypePattern)
 {
     ConditionEditorVM      = p_cemConditionEditorVM;
     ConditionalTypePattern = p_ctpConditionalTypePattern;
     OptionTypes            = Enum.GetValues(typeof(OptionType));
 }