/// <summary>
        /// Initializes a new instance of the <see cref="CompositionCommands"/> class.
        /// </summary>
        /// <param name="datasetLock">The object used to lock the dataset for reading or writing.</param>
        /// <param name="groups">The object that stores all the selected groups and their connections.</param>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="datasetLock"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="groups"/> is <see langword="null" />.
        /// </exception>
        public CompositionCommands(
            ITrackDatasetLocks datasetLock,
            IStoreGroupsAndConnections groups)
        {
            {
                Lokad.Enforce.Argument(() => datasetLock);
                Lokad.Enforce.Argument(() => groups);
            }

            m_DatasetLock = datasetLock;
            m_CompositionLayer = groups;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CompositionCommands"/> class.
        /// </summary>
        /// <param name="datasetLock">The object used to lock the dataset for reading or writing.</param>
        /// <param name="groups">The object that stores all the selected groups and their connections.</param>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="datasetLock"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="groups"/> is <see langword="null" />.
        /// </exception>
        public CompositionCommands(
            ITrackDatasetLocks datasetLock,
            IStoreGroupsAndConnections groups)
        {
            {
                Lokad.Enforce.Argument(() => datasetLock);
                Lokad.Enforce.Argument(() => groups);
            }

            m_DatasetLock      = datasetLock;
            m_CompositionLayer = groups;
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DatasetApplicationCommands"/> class.
        /// </summary>
        /// <param name="dataDownload">The object that handles the communication with remote endpoints.</param>
        /// <param name="datasetLock">The function that handles downloading data from the remote endpoint.</param>
        /// <param name="closeAction">The action that closes the application.</param>
        /// <param name="loadAction">The action that is used to load the dataset from a given file path.</param>
        /// <param name="systemDiagnostics">The object that provides the diagnostics methods for the system.</param>
        /// <param name="scheduler">The scheduler that is used to run the tasks.</param>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="dataDownload"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="datasetLock"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="closeAction"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="loadAction"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// Thrown is <paramref name="systemDiagnostics"/> is <see langword="null"/>
        /// </exception>
        public DatasetApplicationCommands(
            DownloadDataFromRemoteEndpoints dataDownload,
            ITrackDatasetLocks datasetLock,
            Action closeAction,
            Action <FileInfo> loadAction,
            SystemDiagnostics systemDiagnostics,
            TaskScheduler scheduler = null)
        {
            {
                Enforce.Argument(() => dataDownload);
                Enforce.Argument(() => closeAction);
                Enforce.Argument(() => loadAction);
                Enforce.Argument(() => systemDiagnostics);
            }

            m_DataDownload = dataDownload;
            m_DatasetLock  = datasetLock;
            m_CloseAction  = closeAction;
            m_LoadAction   = loadAction;
            m_Diagnostics  = systemDiagnostics;
            m_Scheduler    = scheduler ?? TaskScheduler.Default;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DatasetApplicationCommands"/> class.
        /// </summary>
        /// <param name="dataDownload">The object that handles the communication with remote endpoints.</param>
        /// <param name="datasetLock">The function that handles downloading data from the remote endpoint.</param>
        /// <param name="closeAction">The action that closes the application.</param>
        /// <param name="loadAction">The action that is used to load the dataset from a given file path.</param>
        /// <param name="systemDiagnostics">The object that provides the diagnostics methods for the system.</param>
        /// <param name="scheduler">The scheduler that is used to run the tasks.</param>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="dataDownload"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="datasetLock"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="closeAction"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if <paramref name="loadAction"/> is <see langword="null" />.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// Thrown is <paramref name="systemDiagnostics"/> is <see langword="null"/>
        /// </exception>
        public DatasetApplicationCommands(
            DownloadDataFromRemoteEndpoints dataDownload,
            ITrackDatasetLocks datasetLock,
            Action closeAction,
            Action<FileInfo> loadAction,
            SystemDiagnostics systemDiagnostics,
            TaskScheduler scheduler = null)
        {
            {
                Enforce.Argument(() => dataDownload);
                Enforce.Argument(() => closeAction);
                Enforce.Argument(() => loadAction);
                Enforce.Argument(() => systemDiagnostics);
            }

            m_DataDownload = dataDownload;
            m_DatasetLock = datasetLock;
            m_CloseAction = closeAction;
            m_LoadAction = loadAction;
            m_Diagnostics = systemDiagnostics;
            m_Scheduler = scheduler ?? TaskScheduler.Default;
        }