Beispiel #1
0
        public FileMapping([NotNull] ProjectOutputGroup projectOutputGroup, [NotNull] ObservableCollection <ProjectOutputGroup> allUnmappedProjectOutputs, [NotNull] WixProject wixProject, [NotNull] IList <UnmappedFile> allUnmappedFiles)
        {
            _projectOutputGroup        = projectOutputGroup;
            _allUnmappedProjectOutputs = allUnmappedProjectOutputs;
            _wixProject       = wixProject;
            _allUnmappedFiles = allUnmappedFiles;

            Id = wixProject.GetFileId(TargetName);

            MappedNode = wixProject.FileNodes.FirstOrDefault(node => node.Id == Id);

            _unmappedProjectOutputs = new ObservableFilteredCollection <ProjectOutputGroup>(_allUnmappedProjectOutputs, item => string.Equals(item?.FileName, DisplayName, StringComparison.OrdinalIgnoreCase));
            _unmappedProjectOutputs.CollectionChanged += UnmappedProjectOutputs_CollectionChanged;

            _unmappedFiles = new ObservableFilteredCollection <UnmappedFile>(allUnmappedFiles, item => string.Equals(item?.Node.Name, DisplayName, StringComparison.OrdinalIgnoreCase));
            _unmappedFiles.CollectionChanged += UnmappedNodes_CollectionChanged;

            UpdateMappingState();
        }
Beispiel #2
0
        public FileMapping([NotNull] ProjectOutput projectOutput, [NotNull] ObservableCollection <ProjectOutput> allUnmappedProjectOutputs, [NotNull] WixProject wixProject, [NotNull] ObservableCollection <UnmappedFile> allUnmappedFiles)
        {
            Contract.Requires(projectOutput != null);
            Contract.Requires(wixProject != null);
            Contract.Requires(allUnmappedFiles != null);

            _projectOutput             = projectOutput;
            _allUnmappedProjectOutputs = allUnmappedProjectOutputs;
            _wixProject       = wixProject;
            _allUnmappedFiles = allUnmappedFiles;

            _id = wixProject.GetFileId(TargetName);

            MappedNode = wixProject.FileNodes.FirstOrDefault(node => node.Id == _id);

            _unmappedProjectOutputs = new ObservableFilteredCollection <ProjectOutput>(_allUnmappedProjectOutputs, item => string.Equals(item.FileName, DisplayName, StringComparison.OrdinalIgnoreCase));
            _unmappedProjectOutputs.CollectionChanged += UnmappedProjectOutputs_CollectionChanged;

            _unmappedFiles = new ObservableFilteredCollection <UnmappedFile>(allUnmappedFiles, item => string.Equals(item.Node.Name, DisplayName, StringComparison.OrdinalIgnoreCase));
            _unmappedFiles.CollectionChanged += UnmappedNodes_CollectionChanged;

            UpdateMappingState();
        }