public override ControlStyleBuilderInfoList GetThemeDesignedControls(System.Windows.Forms.Control previewSurface)
        {
            RadTrackBar trackBar = new RadTrackBar();

            trackBar.Bounds = new System.Drawing.Rectangle(0, 0, 150, 30);

            trackBar.TrackBarElement.Bounds = new System.Drawing.Rectangle(0, 0, 150, 30);

            RadTrackBar trackBarStructure = new RadTrackBar();

            trackBarStructure.Bounds = new System.Drawing.Rectangle(0, 0, 150, 30);

            trackBarStructure.TrackBarElement.Bounds = new System.Drawing.Rectangle(0, 0, 150, 30);

            ControlStyleBuilderInfo designed = new ControlStyleBuilderInfo(trackBar, trackBarStructure.RootElement);

            designed.MainElementClassName = typeof(RadTrackBarElement).FullName;
            ControlStyleBuilderInfoList res = new ControlStyleBuilderInfoList();

            res.Add(designed);

            return(res);
        }
예제 #2
0
 protected override void OnNotifyPropertyChanged(string propertyName)
 {
     base.OnNotifyPropertyChanged(propertyName);
     if (propertyName == "ShowButtons" || propertyName == "LabelStyle" || (propertyName == "IsVertical" || propertyName == "TickStyle"))
     {
         this.measuredSize = SizeF.Empty;
     }
     if (propertyName == "Maximum" || propertyName == "Minimum" || (propertyName == "SmallTickFrequency" || propertyName == "LargeTickFrequency"))
     {
         this.bodyElement.ScaleContainerElement.TopScaleElement.TickContainerElement.UpdateTickElements();
         this.bodyElement.ScaleContainerElement.BottomScaleElement.TickContainerElement.UpdateTickElements();
         this.bodyElement.ScaleContainerElement.BottomScaleElement.LabelContainerElement.UpdateLabelElements();
         this.bodyElement.ScaleContainerElement.TopScaleElement.LabelContainerElement.UpdateLabelElements();
         this.bodyElement.InvalidateMeasure(true);
     }
     if (propertyName == "Value")
     {
         this.bodyElement.ScaleContainerElement.InvalidateMeasure(true);
         this.bodyElement.IndicatorContainerElement.InvalidateMeasure(true);
     }
     if (propertyName == "TickOffSet" || propertyName == "ThumbSize")
     {
         this.bodyElement.ScaleContainerElement.InvalidateMeasure(true);
         this.bodyElement.IndicatorContainerElement.InvalidateMeasure(true);
     }
     if (propertyName == "TrackBarOrientation" || propertyName == "TickAutoSizeCore")
     {
         if (this.Orientation == Orientation.Horizontal)
         {
             this.IsVertical = false;
             this.bodyElement.ScaleContainerElement.Orientation = Orientation.Vertical;
             this.bodyElement.ScaleContainerElement.TrackBarLineElement.IsVertical = false;
             this.bodyElement.ScaleContainerElement.TopScaleElement.Orientation    = Orientation.Vertical;
             this.bodyElement.ScaleContainerElement.BottomScaleElement.Orientation = Orientation.Vertical;
             this.bodyElement.IndicatorContainerElement.StretchHorizontally        = true;
             this.bodyElement.IndicatorContainerElement.StretchVertically          = false;
             this.leftButton.IsVertical  = false;
             this.rightButton.IsVertical = false;
             this.MinSize = new Size(100, 0);
             this.bodyElement.ScaleContainerElement.TopScaleElement.StretchHorizontally    = true;
             this.bodyElement.ScaleContainerElement.BottomScaleElement.StretchHorizontally = true;
             if (this.ElementTree != null)
             {
                 RadTrackBar control = this.ElementTree.Control as RadTrackBar;
                 if (control != null)
                 {
                     if (control.AutoSize)
                     {
                         this.bodyElement.ScaleContainerElement.TopScaleElement.StretchVertically    = false;
                         this.bodyElement.ScaleContainerElement.BottomScaleElement.StretchVertically = false;
                     }
                     else
                     {
                         this.bodyElement.ScaleContainerElement.TopScaleElement.StretchVertically    = true;
                         this.bodyElement.ScaleContainerElement.BottomScaleElement.StretchVertically = true;
                     }
                 }
                 else
                 {
                     this.bodyElement.ScaleContainerElement.TopScaleElement.StretchVertically    = true;
                     this.bodyElement.ScaleContainerElement.BottomScaleElement.StretchVertically = true;
                 }
             }
         }
         else
         {
             this.IsVertical = true;
             this.bodyElement.ScaleContainerElement.Orientation = Orientation.Horizontal;
             this.bodyElement.ScaleContainerElement.TrackBarLineElement.IsVertical = true;
             this.bodyElement.ScaleContainerElement.TopScaleElement.Orientation    = Orientation.Horizontal;
             this.bodyElement.ScaleContainerElement.BottomScaleElement.Orientation = Orientation.Horizontal;
             this.bodyElement.IndicatorContainerElement.StretchHorizontally        = false;
             this.bodyElement.IndicatorContainerElement.StretchVertically          = true;
             this.leftButton.IsVertical  = true;
             this.rightButton.IsVertical = true;
             this.MinSize = new Size(0, 100);
             this.bodyElement.ScaleContainerElement.TopScaleElement.StretchVertically    = true;
             this.bodyElement.ScaleContainerElement.BottomScaleElement.StretchVertically = true;
             if (this.ElementTree != null)
             {
                 RadTrackBar control = this.ElementTree.Control as RadTrackBar;
                 if (control != null)
                 {
                     if (control.AutoSize)
                     {
                         this.bodyElement.ScaleContainerElement.TopScaleElement.StretchHorizontally    = false;
                         this.bodyElement.ScaleContainerElement.BottomScaleElement.StretchHorizontally = false;
                     }
                     else
                     {
                         this.bodyElement.ScaleContainerElement.TopScaleElement.StretchHorizontally    = true;
                         this.bodyElement.ScaleContainerElement.BottomScaleElement.StretchHorizontally = true;
                     }
                 }
                 else
                 {
                     this.bodyElement.ScaleContainerElement.TopScaleElement.StretchHorizontally    = true;
                     this.bodyElement.ScaleContainerElement.BottomScaleElement.StretchHorizontally = true;
                 }
             }
         }
         this.SetElementsOrder();
         foreach (TrackBarIndicatorElement child in this.bodyElement.IndicatorContainerElement.Children)
         {
             child.Orientation = this.Orientation;
             child.UpdateIndicatorElement();
         }
         this.BodyElement.ScaleContainerElement.TopScaleElement.TickContainerElement.UpdateTickElements();
         this.BodyElement.ScaleContainerElement.BottomScaleElement.TickContainerElement.UpdateTickElements();
         this.BodyElement.ScaleContainerElement.TopScaleElement.LabelContainerElement.UpdateLabelElements();
         this.BodyElement.ScaleContainerElement.BottomScaleElement.LabelContainerElement.UpdateLabelElements();
         this.bodyElement.InvalidateArrange(true);
         this.OnNotifyPropertyChanged("RightToLeft");
     }
     if (propertyName == "ShowButtons")
     {
         this.SetHandlesVisibility();
     }
     if (propertyName == "TrackBarMode")
     {
         this.bodyElement.IndicatorContainerElement.UpdateIndicatorElements();
         this.bodyElement.InvalidateMeasure(true);
     }
     if (propertyName == "RightToLeft")
     {
         if (this.Orientation == Orientation.Horizontal)
         {
             if (this.RightToLeft)
             {
                 this.leftButton.AngleTransform  = 180f;
                 this.rightButton.AngleTransform = 180f;
             }
             else
             {
                 int num1 = (int)this.leftButton.ResetValue(RadElement.AngleTransformProperty, ValueResetFlags.Local);
                 int num2 = (int)this.rightButton.ResetValue(RadElement.AngleTransformProperty, ValueResetFlags.Local);
             }
         }
         else
         {
             int num1 = (int)this.leftButton.ResetValue(RadElement.AngleTransformProperty, ValueResetFlags.Local);
             int num2 = (int)this.rightButton.ResetValue(RadElement.AngleTransformProperty, ValueResetFlags.Local);
         }
     }
     if (!(propertyName == "TrackBarMode"))
     {
         return;
     }
     this.OnNotifyPropertyChanged("TrackBarOrientation");
 }