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());
 }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
 public ScaleDescriptor(string name, Color color)
 {
     Name   = name;
     Color  = color;
     Ranges = new ObservableCollection <IRangeDescriptor>(RangeDescriptorFactory.Create(color, new object[] {}).ToList());
 }