Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectService"/> class.
        /// </summary>
        /// <param name="timelineBuilder">The function that returns a new <see cref="ITimeline"/> object each time it is called.</param>
        /// <param name="dataStorageProxyBuilder">The function which returns a storage proxy for a newly loaded dataset.</param>
        /// <param name="datasetDistributor">The object that handles the distribution of datasets.</param>
        /// <param name="notifications">The object that stores the notifications for the user interface.</param>
        /// <param name="diagnostics">The object that provides the diagnostics methods for the application.</param>
        /// <param name="projectBuilder">The object that builds new projects.</param>
        /// <exception cref="ArgumentNullException">
        /// Thrown if <paramref name="timelineBuilder"/> is <see langword="null"/>.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// Thrown if <paramref name="dataStorageProxyBuilder"/> is <see langword="null"/>.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// Thrown if <paramref name="datasetDistributor"/> is <see langword="null"/>.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// Thrown if <paramref name="notifications"/> is <see langword="null"/>.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown when <paramref name="diagnostics"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// Thrown if <paramref name="projectBuilder"/> is <see langword="null"/>.
        /// </exception>
        public ProjectService(
            Func <ITimeline> timelineBuilder,
            Func <DatasetOnlineInformation, DatasetStorageProxy> dataStorageProxyBuilder,
            IHelpDistributingDatasets datasetDistributor,
            ICollectNotifications notifications,
            SystemDiagnostics diagnostics,
            IBuildProjects projectBuilder)
            : base(diagnostics)
        {
            {
                Lokad.Enforce.Argument(() => timelineBuilder);
                Lokad.Enforce.Argument(() => dataStorageProxyBuilder);
                Lokad.Enforce.Argument(() => datasetDistributor);
                Lokad.Enforce.Argument(() => notifications);
                Lokad.Enforce.Argument(() => diagnostics);
                Lokad.Enforce.Argument(() => projectBuilder);
            }

            // No locks are necessary because we're in the constructor, no other
            // methods have been called or can be called.
            m_TimelineBuilder         = timelineBuilder;
            m_DataStorageProxyBuilder = dataStorageProxyBuilder;
            m_DatasetDistributor      = datasetDistributor;
            m_Notifications           = notifications;
            m_Diagnostics             = diagnostics;
            m_Builder = projectBuilder;
        }
Exemplo n.º 2
0
 public ProgramRunner(IBuildProjects project)
 {
     _project = project;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectService"/> class.
        /// </summary>
        /// <param name="timelineBuilder">The function that returns a new <see cref="ITimeline"/> object each time it is called.</param>
        /// <param name="dataStorageProxyBuilder">The function which returns a storage proxy for a newly loaded dataset.</param>
        /// <param name="datasetDistributor">The object that handles the distribution of datasets.</param>
        /// <param name="notifications">The object that stores the notifications for the user interface.</param>
        /// <param name="diagnostics">The object that provides the diagnostics methods for the application.</param>
        /// <param name="projectBuilder">The object that builds new projects.</param>
        /// <exception cref="ArgumentNullException">
        /// Thrown if <paramref name="timelineBuilder"/> is <see langword="null"/>.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// Thrown if <paramref name="dataStorageProxyBuilder"/> is <see langword="null"/>.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// Thrown if <paramref name="datasetDistributor"/> is <see langword="null"/>.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// Thrown if <paramref name="notifications"/> is <see langword="null"/>.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown when <paramref name="diagnostics"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// Thrown if <paramref name="projectBuilder"/> is <see langword="null"/>.
        /// </exception>
        public ProjectService(
            Func<ITimeline> timelineBuilder,
            Func<DatasetOnlineInformation, DatasetStorageProxy> dataStorageProxyBuilder,
            IHelpDistributingDatasets datasetDistributor,
            ICollectNotifications notifications,
            SystemDiagnostics diagnostics,
            IBuildProjects projectBuilder)
            : base(diagnostics)
        {
            {
                Lokad.Enforce.Argument(() => timelineBuilder);
                Lokad.Enforce.Argument(() => dataStorageProxyBuilder);
                Lokad.Enforce.Argument(() => datasetDistributor);
                Lokad.Enforce.Argument(() => notifications);
                Lokad.Enforce.Argument(() => diagnostics);
                Lokad.Enforce.Argument(() => projectBuilder);
            }

            // No locks are necessary because we're in the constructor, no other
            // methods have been called or can be called.
            m_TimelineBuilder = timelineBuilder;
            m_DataStorageProxyBuilder = dataStorageProxyBuilder;
            m_DatasetDistributor = datasetDistributor;
            m_Notifications = notifications;
            m_Diagnostics = diagnostics;
            m_Builder = projectBuilder;
        }