Пример #1
0
        /// <summary>
        /// Instantiates an immediate data source.
        /// </summary>
        public static IDataSource <T> ImmediateDataSource <T>(T result)
        {
            SimpleDataSource <T> simpleDataSource = SimpleDataSource <T> .Create();

            simpleDataSource.SetResult(result);
            return(simpleDataSource);
        }
Пример #2
0
        /// <summary>
        /// Instantiates an immediate failed data source.
        /// </summary>
        public static IDataSource <T> ImmediateFailedDataSource <T>(Exception failure)
        {
            SimpleDataSource <T> simpleDataSource = SimpleDataSource <T> .Create();

            simpleDataSource.SetFailure(failure);
            return(simpleDataSource);
        }