public DynamicPropertyScaleDescriptor(IPowerShellDataSource dataSource, string name)
 {
     _dataSource = dataSource;
     _name       = name;
     Color       = ColorManager.AssignColor();
     _dataSource.Data.CollectionChanged += OnData;
     _ranges = new ObservableCollection <IRangeDescriptor>(RangeDescriptorFactory.Create(Color, new object[] { _minimum, "?", _maximum }).ToList());
 }
        public static IEnumerable<IRangeDescriptor> Create( Color baseColor, IEnumerable<object> values )
        {
            var factory = new RangeDescriptorFactory(baseColor, values);
            List<IRangeDescriptor> descriptors = new List<IRangeDescriptor>();
            IRangeDescriptor next = null;
            while( null != ( next = factory.Next() ) )
            {
                descriptors.Add( next );
            }

            return descriptors;
        }
Beispiel #3
0
        public static IEnumerable <IRangeDescriptor> Create(Color baseColor, IEnumerable <object> values)
        {
            var factory = new RangeDescriptorFactory(baseColor, values);
            List <IRangeDescriptor> descriptors = new List <IRangeDescriptor>();
            IRangeDescriptor        next        = null;

            while (null != (next = factory.Next()))
            {
                descriptors.Add(next);
            }

            return(descriptors);
        }
        public ScaleDescriptor(IEnumerable <object> descriptors)
        {
            /*
             * '<serieslabel>','<seriescolor>'(,<rangespec>)?
             * "<serieslabel>",$null(,<rangespec>)?
             * '<serieslabel>'
             */
            var items = descriptors.ToList();

            Name = items.Shift().ToString();
            if (!items.Any() || null == items[0])
            {
                //Color = ColorManager.AssignColor();
            }

            Ranges = new ObservableCollection <IRangeDescriptor>();

            if (!items.Any())
            {
                return;
            }

            var tag   = items[0];
            var color = tag.ToColor();

            if (null != color)
            {
                items.Shift();
                Color = color.Value;
            }
            else
            {
                //    Color = ColorManager.AssignColor();
            }
            Ranges = new ObservableCollection <IRangeDescriptor>(RangeDescriptorFactory.Create(Color, items).ToList());
        }
 public ScaleDescriptor(string name, Color color)
 {
     Name   = name;
     Color  = color;
     Ranges = new ObservableCollection <IRangeDescriptor>(RangeDescriptorFactory.Create(color, new object[] {}).ToList());
 }