Example #1
0
 public ActiveConfiguredProjectsLoader(UnconfiguredProject project, IActiveConfigurationGroupService activeConfigurationGroupService, IUnconfiguredProjectTasksService tasksService)
     : base(synchronousDisposal: false)
 {
     _project = project;
     _activeConfigurationGroupService = activeConfigurationGroupService;
     _tasksService = tasksService;
     _targetBlock  = DataflowBlockFactory.CreateActionBlock <IProjectVersionedValue <IConfigurationGroup <ProjectConfiguration> > >(OnActiveConfigurationsChangedAsync, project, ProjectFaultSeverity.LimitedFunctionality);
 }
        public ConfiguredProjectImplicitActivationTracking(ConfiguredProject project, IActiveConfigurationGroupService activeConfigurationGroupService, [Import(ExportContractNames.Scopes.ConfiguredProject)] IProjectAsynchronousTasksService tasksService)
        {
            _project = project;
            _activeConfigurationGroupService = activeConfigurationGroupService;
            _tasksService = tasksService;
            _targetBlock  = DataflowBlockFactory.CreateActionBlock <IProjectVersionedValue <IConfigurationGroup <ProjectConfiguration> > >(OnActiveConfigurationsChanged, project.UnconfiguredProject, ProjectFaultSeverity.LimitedFunctionality);

            ImplicitlyActiveServices = new OrderPrecedenceImportCollection <IImplicitlyActiveService>(projectCapabilityCheckProvider: project);
        }
Example #3
0
        /// <summary>
        ///     Links the <see cref="ISourceBlock{TOutput}" /> to the specified <see cref="Func{T, TResult}" />
        ///     that can process messages, propagating completion and faults.
        /// </summary>
        /// <returns>
        ///     An <see cref="IDisposable"/> that, upon calling Dispose, will unlink the source from the target.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="source"/> is <see langword="null"/>.
        ///     <para>
        ///         -or-
        ///     </para>
        ///     <paramref name="target"/> is <see langword="null"/>.
        ///     <para>
        ///         -or-
        ///     </para>
        ///     <paramref name="project"/> is <see langword="null"/>.
        /// </exception>
        public static IDisposable LinkToAsyncAction <T>(
            this ISourceBlock <T> source,
            Func <T, Task> target,
            UnconfiguredProject project)
        {
            Requires.NotNull(source, nameof(source));
            Requires.NotNull(target, nameof(target));
            Requires.NotNull(project, nameof(project));

            return(source.LinkTo(DataflowBlockFactory.CreateActionBlock(target, project, ProjectFaultSeverity.Recoverable),
                                 DataflowOption.PropagateCompletion));
        }
Example #4
0
        /// <summary>
        ///     Links to the specified <see cref="Func{T, TResult}" /> to receive a cross-sectional slice of project
        ///     data,  including detailed descriptions of what changed between snapshots, as described by
        ///     specified rules.
        /// </summary>
        /// <param name="source">
        ///     The broadcasting block that produces the messages.
        /// </param>
        /// <param name="target">
        ///     The <see cref="Action{T}"/> to receive the broadcasts.
        /// </param>
        /// <param name="project">
        ///     The project related to the failure, if applicable.
        /// </param>
        /// <param name="suppressVersionOnlyUpdates">
        ///    A value indicating whether to prevent messages from propagating to the target
        ///     block if no project changes are include other than an incremented version number.
        /// </param>
        /// <param name="ruleNames">
        ///     The names of the rules that describe the project data the caller is interested in.
        /// </param>
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="source"/> is <see langword="null"/>.
        ///     <para>
        ///         -or-
        ///     </para>
        ///     <paramref name="target"/> is <see langword="null"/>.
        ///     <para>
        ///         -or-
        ///     </para>
        ///     <paramref name="project"/> is <see langword="null"/>.
        /// </exception>
        public static IDisposable LinkToAsyncAction(
            this ISourceBlock <IProjectVersionedValue <IProjectSubscriptionUpdate> > source,
            Func <IProjectVersionedValue <IProjectSubscriptionUpdate>, Task> target,
            UnconfiguredProject project,
            bool suppressVersionOnlyUpdates = true,
            params string[] ruleNames)
        {
            Requires.NotNull(source, nameof(source));
            Requires.NotNull(target, nameof(target));
            Requires.NotNull(project, nameof(project));

            return(source.LinkTo(DataflowBlockFactory.CreateActionBlock(target, project, ProjectFaultSeverity.Recoverable),
                                 DataflowOption.PropagateCompletion,
                                 initialDataAsNew: true,
                                 suppressVersionOnlyUpdates: suppressVersionOnlyUpdates,
                                 ruleNames: ruleNames));
        }