Ejemplo n.º 1
0
 public SideSliderParameter(SideSliderEdgeLabelModel model, SliderParameterLocation location,
                            ILabelModelParameter parameter)
 {
     this.model     = model;
     this.location  = location;
     this.parameter = parameter;
 }
Ejemplo n.º 2
0
        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            SideSliderEdgeLabelModel exModel = Model as SideSliderEdgeLabelModel;

            if (exModel == null)
            {
                exModel = new SideSliderEdgeLabelModel();
            }

            bool fromSource = (Location & SliderParameterLocation.FromSource) == SliderParameterLocation.FromSource;
            bool left       = (Location & SliderParameterLocation.Left) == SliderParameterLocation.Left;

            if (fromSource)
            {
                if (left)
                {
                    return(exModel.CreateParameterLeftFromSource(SegmentIndex, SegmentRatio));
                }
                else
                {
                    return(exModel.CreateParameterRightFromSource(SegmentIndex, SegmentRatio));
                }
            }
            else
            {
                if (left)
                {
                    return(exModel.CreateParameterLeftFromTarget(SegmentIndex, SegmentRatio));
                }
                else
                {
                    return(exModel.CreateParameterRightFromTarget(SegmentIndex, SegmentRatio));
                }
            }
        }
Ejemplo n.º 3
0
        /// <inheritdoc/>
        public IEnumerable <ILabelModelParameter> GetParameters(ILabel label, ILabelModel model)
        {
            SideSliderEdgeLabelModel    mmodel = (SideSliderEdgeLabelModel)model;
            List <ILabelModelParameter> list   = new List <ILabelModelParameter>();

            foreach (
                SliderEdgeLabelModel.SliderParameter parameter in mmodel.leftSlider.GetParameters(label, mmodel.leftSlider))
            {
                list.Add(new SideSliderParameter(this,
                                                 SliderParameterLocation.Left |
                                                 (parameter.segmentIndex >= 0 ? SliderParameterLocation.FromSource : SliderParameterLocation.FromTarget),
                                                 parameter));
            }
            foreach (
                SliderEdgeLabelModel.SliderParameter parameter in mmodel.rightSlider.GetParameters(label, mmodel.rightSlider))
            {
                list.Add(new SideSliderParameter(this,
                                                 SliderParameterLocation.Right |
                                                 (parameter.segmentIndex >= 0 ? SliderParameterLocation.FromSource : SliderParameterLocation.FromTarget),
                                                 parameter));
            }
            return(list);
        }