using System; using System.Collections.Generic; using System.ComponentModel; using TSLab.Script; using TSLab.Script.Handlers; using static GanovCubes.Extentions; namespace CubesLib { #region CubeDescription [Obsolete] [HandlerCategory("Ganov Cubes. DateTime")] [HandlerName("SystemDayOfWeek", Language = "ru-ru")] [Description("Кубик выдает текущий системный день недели в виде числа от 1 до 7")] [InputsCount(1)] [Input(0, TemplateTypes.SECURITY, Name = "Sec")] [OutputsCount(1)] [OutputType(TemplateTypes.INT)] #endregion public class SystemDayOfWeek : IStreamHandler, IContextUses, ISecurityInput0, IBar2IntHandler, IIntReturns { public IContext Context { set; get; } public IList Execute(ISecurity _) { return Context.GetValueTypeCollection(Convert.ToInt32(DateTime.Now.DayOfWeek), Context.BarsCount); } } }