当前位置: 首页>>代码示例>>C#>>正文


C# IDataSource.GetDataAt方法代码示例

本文整理汇总了C#中IDataSource.GetDataAt方法的典型用法代码示例。如果您正苦于以下问题:C# IDataSource.GetDataAt方法的具体用法?C# IDataSource.GetDataAt怎么用?C# IDataSource.GetDataAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDataSource的用法示例。


在下文中一共展示了IDataSource.GetDataAt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateCurrentEffects

        /// <summary>
        /// Updates the collection of current effects, returning the ids of the affected elements.
        /// </summary>
        /// <returns>Ids of the affected elements.</returns>
        public Guid[] UpdateCurrentEffects(IDataSource dataSource, TimeSpan currentTime)
        {
            // Get the effects that are newly qualified.
            IEnumerable<IEffectNode> newQualifiedEffects = dataSource.GetDataAt(currentTime);
            // Add them to the current effect list.
            _currentEffects.AddRange(newQualifiedEffects);
            // Get the distinct list of all elements affected by all effects in the list.
            // List has current effects as well as effects that may be expiring.
            // Current and expired effects affect state.
            Guid[] affectedElements = _GetElementsAffected(_currentEffects);
            _RemoveExpiredEffects(currentTime);

            return affectedElements;
        }
开发者ID:Jchuchla,项目名称:vixen,代码行数:18,代码来源:ContextCurrentEffectsIncremental.cs

示例2: UpdateCurrentEffects

        /// <summary>
        /// Updates the collection of current affects, returning the ids of the affected elements.
        /// </summary>
        /// <returns>Ids of the affected elements.</returns>
        public Guid[] UpdateCurrentEffects(IDataSource dataSource, TimeSpan currentTime)
        {
            // Get the entirety of the new state.
            IEffectNode[] newState = dataSource.GetDataAt(currentTime).ToArray();
            // Get the elements affected by this new state.
            Guid[] nowAffectedElements = _GetAffectedElements(newState).ToArray();
            // New and expiring effects affect the state, so get the union of
            // the previous state and the current state.
            //HashSet<Guid> allAffectedElements = new HashSet<Guid>(_currentAffectedElements.Concat(newAffectedElements));
            IEnumerable<Guid> allAffectedElements = _currentAffectedElements.Concat(nowAffectedElements).Distinct();
            // Set the new state.
            _currentEffects = new List<IEffectNode>(newState);
            _currentAffectedElements = new HashSet<Guid>(nowAffectedElements);

            return allAffectedElements.ToArray();
        }
开发者ID:Jchuchla,项目名称:vixen,代码行数:20,代码来源:ContextCurrentEffectsFull.cs

示例3: UpdateCurrentEffects

        /// <summary>
        /// Updates the collection of current effects, returning the ids of the affected elements.
        /// </summary>
        /// <returns>Ids of the affected elements.</returns>
        public HashSet<Guid> UpdateCurrentEffects(IDataSource dataSource, TimeSpan currentTime)
        {
            if (_lastUpdateTime > currentTime)
            {
                //Make sure the current effects are cleared if we go back to a earlier time.
                _currentEffects.Clear();
            }
            _lastUpdateTime = currentTime;
            // Get the effects that are newly qualified.
            IEnumerable<IEffectNode> newQualifiedEffects = dataSource.GetDataAt(currentTime);
            // Add them to the current effect list.
            _currentEffects.AddRange(newQualifiedEffects);
            // Get the distinct list of all elements affected by all effects in the list.
            // List has current effects as well as effects that may be expiring.
            // Current and expired effects affect state.
            _GetElementsAffected(_currentEffects);
            _RemoveExpiredEffects(currentTime);

            return _affectedElements;
        }
开发者ID:stewmc,项目名称:vixen,代码行数:24,代码来源:ContextCurrentEffectsIncremental.cs


注:本文中的IDataSource.GetDataAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。