コード例 #1
0
        /// <summary>
        /// Gets the editor to use to edit <see cref="XmlScript"/>'s required install files.
        /// </summary>
        /// <param name="p_lstFiles">The list of required install files 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 <see cref="XmlScript"/>'s required install files. <c>null</c> is returned if the
        /// current <see cref="XmlScript"/> does not support editing the required install files.</returns>
        public virtual NodeEditor GetRequiredInstallFilesEditor(IList <InstallableFile> p_lstFiles, IList <VirtualFileSystemItem> p_lstModFiles)
        {
            InstallableFileEditorVM vmlInstallableFile = new InstallableFileEditorVM(null, p_lstModFiles);
            FileListEditorVM        vmlFileList        = new FileListEditorVM(vmlInstallableFile, p_lstFiles);

            return(new FileListEditor(vmlFileList));
        }
コード例 #2
0
        /// <summary>
        /// The editor to use to edit a <see cref="ConditionallyInstalledFileSet"/>.
        /// </summary>
        /// <param name="p_cisFileSet">The <see cref="ConditionallyInstalledFileSet"/> 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="ConditionallyInstalledFileSet"/>. <c>null</c> is returned if the
        /// current <see cref="XmlScript"/> does not support editing <see cref="ConditionallyInstalledFileSet"/>s.</returns>
        public virtual NodeEditor GetConditionallyInstalledFileSetEditor(ConditionallyInstalledFileSet p_cipPattern, IList <VirtualFileSystemItem> p_lstModFiles)
        {
            CPLConverter      cvtConverter       = new CPLConverter(ScriptType.GetCplParserFactory());
            ConditionEditorVM vmlConditionEditor = CreateConditionEditorVM(p_lstModFiles, cvtConverter);

            InstallableFileEditorVM vmlInstallableFile = new InstallableFileEditorVM(null, p_lstModFiles);
            FileListEditorVM        vmlFileList        = new FileListEditorVM(vmlInstallableFile, p_cipPattern.Files);

            ConditionallyInstalledFileSetEditorVM vmlFileInstall = new ConditionallyInstalledFileSetEditorVM(vmlConditionEditor, vmlFileList, p_cipPattern);

            return(new ConditionallyInstalledFileSetEditor(vmlFileInstall));
        }
コード例 #3
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);

            CPLConverter      cvtConverter       = new CPLConverter(ScriptType.GetCplParserFactory());
            ConditionEditorVM vmlConditionEditor = CreateConditionEditorVM(p_lstModFiles, cvtConverter);

            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));
        }
コード例 #4
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 override 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);

			FO3CplConverter cvtConverter = new FO3CplConverter(ScriptType.GetCplParserFactory());
			ConditionEditorVM vmlConditionEditor = CreateConditionEditorVM(p_lstModFiles, cvtConverter);
			
			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);
		}
コード例 #5
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));
        }
コード例 #6
0
		/// <summary>
		/// Gets the editor to use to edit <see cref="XmlScript"/>'s required install files.
		/// </summary>
		/// <param name="p_lstFiles">The list of required install files 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 <see cref="XmlScript"/>'s required install files. <c>null</c> is returned if the
		/// current <see cref="XmlScript"/> does not support editing the required install files.</returns>
		public virtual NodeEditor GetRequiredInstallFilesEditor(IList<InstallableFile> p_lstFiles, IList<VirtualFileSystemItem> p_lstModFiles)
		{
			InstallableFileEditorVM vmlInstallableFile = new InstallableFileEditorVM(null, p_lstModFiles);
			FileListEditorVM vmlFileList = new FileListEditorVM(vmlInstallableFile, p_lstFiles);
			return new FileListEditor(vmlFileList);
		}
コード例 #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>
		/// The editor to use to edit a <see cref="ConditionallyInstalledFileSet"/>.
		/// </summary>
		/// <param name="p_cisFileSet">The <see cref="ConditionallyInstalledFileSet"/> 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="ConditionallyInstalledFileSet"/>. <c>null</c> is returned if the
		/// current <see cref="XmlScript"/> does not support editing <see cref="ConditionallyInstalledFileSet"/>s.</returns>
		public virtual NodeEditor GetConditionallyInstalledFileSetEditor(ConditionallyInstalledFileSet p_cipPattern, IList<VirtualFileSystemItem> p_lstModFiles)
		{
			CPLConverter cvtConverter = new CPLConverter(ScriptType.GetCplParserFactory());
			ConditionEditorVM vmlConditionEditor = CreateConditionEditorVM(p_lstModFiles, cvtConverter);

			InstallableFileEditorVM vmlInstallableFile = new InstallableFileEditorVM(null, p_lstModFiles);
			FileListEditorVM vmlFileList = new FileListEditorVM(vmlInstallableFile, p_cipPattern.Files);

			ConditionallyInstalledFileSetEditorVM vmlFileInstall = new ConditionallyInstalledFileSetEditorVM(vmlConditionEditor, vmlFileList, p_cipPattern);
			return new ConditionallyInstalledFileSetEditor(vmlFileInstall);
		}
コード例 #9
0
		/// <summary>
		/// A simple constructor that initializes the view model with its dependencies.
		/// </summary>
		/// <param name="p_femInstallableFileEditorVM">The <see cref="InstallableFileEditorVM"/> that encapsulates the data
		/// and operations for editing an <see cref="InstallableFile"/>.</param>
		/// <param name="p_lstFiles">The list of <see cref="InstallableFile"/>s that is being edited.</param>
		public FileListEditorVM(InstallableFileEditorVM p_femInstallableFileEditorVM, IList<InstallableFile> p_lstFiles)
		{
			InstallableFileEditorVM=p_femInstallableFileEditorVM;
			InstallableFiles = p_lstFiles;

			EditCommand = new Command<InstallableFile>("Edit", "Edit the selected installable file.", EditInstallableFile, false);
			AddCommand = new Command<InstallableFile>("Add", "Add an installable file.", AddInstallableFile);
			DeleteCommand = new Command<InstallableFile>("Delete", "Delete the selected installable file.", DeleteInstallableFile, false);
		}