public WidgetDimension(WidgetDimension dimension) { Height = dimension.Height; Width = dimension.Width; MinHeight = dimension.MinHeight; MinWidth = dimension.MinWidth; HeightMode = dimension.HeightMode; WidthMode = dimension.WidthMode; }
public void SetValue(DimensionEnum dimensionEnum, int listIndex, double value) => ...;
public double GetValue(DimensionEnum dimensionEnum, int listIndex) => ...;
public void SetValue(DimensionEnum dimensionEnum, double value) => ...;
public double GetValue(DimensionEnum dimensionEnum) => ...;
/// <summary> /// default Constructor /// </summary> public AxisLine(LineTypeEnum lineType, DimensionEnum dimension, LineOrderEnum lineOrder, Color lineColor, double strokeThickness, FrameworkElement testFrameworkElement) { LineType = lineType; Dimension = dimension; LineOrder = lineOrder; this.testFrameworkElement = testFrameworkElement; testControl = (testFrameworkElement as Control) !; DependencyObject vparent = VisualTreeHelper.GetParent(testFrameworkElement); DependencyObject vgparent = VisualTreeHelper.GetParent(vparent); hostGrid = (vgparent as Grid) !; if (hostGrid == null) { throw new NotSupportedException("TestFrameworkElement must be placed directly in a Grid."); } hostGridRow = Grid.GetColumn(testFrameworkElement); hostGirdColumn = Grid.GetRow(testFrameworkElement); ThisLine = new Line { StrokeThickness = strokeThickness }; if (dimension == DimensionEnum.width) { ThisLine.VerticalAlignment = VerticalAlignment.Stretch; } else /* height*/ { ThisLine.HorizontalAlignment = HorizontalAlignment.Stretch; } GradientStopCollection gradientStopCollection = new GradientStopCollection(4); if (lineOrder == LineOrderEnum.first) { gradientStopCollection.Add(new GradientStop(lineColor, 0)); gradientStopCollection.Add(new GradientStop(lineColor, 0.5)); gradientStopCollection.Add(new GradientStop(Colors.Transparent, 0.5)); gradientStopCollection.Add(new GradientStop(Colors.Transparent, 1)); } else { gradientStopCollection.Add(new GradientStop(Colors.Transparent, 0)); gradientStopCollection.Add(new GradientStop(Colors.Transparent, 0.5)); gradientStopCollection.Add(new GradientStop(lineColor, 0.5)); gradientStopCollection.Add(new GradientStop(lineColor, 1)); } LinearGradientBrush brush; if (dimension == DimensionEnum.width) { brush = new LinearGradientBrush(gradientStopCollection, 0); } else { brush = new LinearGradientBrush(gradientStopCollection, 90); } brush.Opacity = 0.4; brush.Freeze(); ThisLine.Stroke = brush; ThisLine.StrokeThickness = strokeThickness; int[] strokeDashes; if (testControl == null) { if (lineType != LineTypeEnum.margin) { throw new Exception("lineType '' only support for FrameworkElements inheriting from Control."); } strokeDashes = singlelineStrokeDashes; } else { strokeDashes = multilineStrokeDashes[(int)lineType]; } ThisLine.StrokeDashArray = new DoubleCollection(); foreach (double strokeDash in strokeDashes) { ThisLine.StrokeDashArray.Add(strokeDash); } if (dimension == DimensionEnum.width) { ThisLine.Y2 = SystemParameters.VirtualScreenHeight; ThisLine.X1 = strokeThickness / 2; ThisLine.X2 = strokeThickness / 2; ThisLine.Cursor = Cursors.ScrollWE; if (lineOrder == LineOrderEnum.first) { LineName = "Left"; } else { LineName = "Right"; } } else { ThisLine.X2 = SystemParameters.VirtualScreenWidth; ThisLine.Y1 = strokeThickness / 2; ThisLine.Y2 = strokeThickness / 2; ThisLine.Cursor = Cursors.ScrollNS; if (lineOrder == LineOrderEnum.first) { LineName = "Top"; } else { LineName = "Bottom"; } } switch (LineType) { case LineTypeEnum.margin: changeThicknessProperty = FrameworkElement.MarginProperty; LineName += "Margin"; break; case LineTypeEnum.border: changeThicknessProperty = Control.BorderThicknessProperty; LineName += "Border"; break; case LineTypeEnum.padding: changeThicknessProperty = Control.PaddingProperty; LineName += "Padding"; break; default: throw new Exception("LineType '" + LineType + "' not supported"); } hostGrid.Children.Add(ThisLine); Grid.SetRow(ThisLine, hostGridRow); Grid.SetColumn(ThisLine, hostGirdColumn); ThisLine.MouseDown += mouseDown; ThisLine.MouseMove += mouseMove; ThisLine.MouseUp += mouseUp; }
/// <summary> /// Initializes a new instance of the <see cref="ProcessingTimeStatisticsDetails" /> class. /// </summary> /// <param name="Start">The start date and time of window of jobs to analyse (required).</param> /// <param name="End">The end date and time of window of jobs to analyse (required).</param> /// <param name="Measure">The type of processing time to measure (required).</param> /// <param name="Dimension">The type of thing to break down the jobs into - either a time period or other property such as job type (required).</param> /// <param name="JobPropertySelectionType">The property to use to select on the jobs to analyse (required).</param> /// <param name="JobPropertySelections">The set of property values to use to select the jobs (required).</param> public ProcessingTimeStatisticsDetails(DateTime?Start = default(DateTime?), DateTime?End = default(DateTime?), MeasureEnum Measure = default(MeasureEnum), DimensionEnum Dimension = default(DimensionEnum), JobPropertySelectionTypeEnum JobPropertySelectionType = default(JobPropertySelectionTypeEnum), List <string> JobPropertySelections = default(List <string>)) { // to ensure "Start" is required (not null) if (Start == null) { throw new InvalidDataException("Start is a required property for ProcessingTimeStatisticsDetails and cannot be null"); } else { this.Start = Start; } // to ensure "End" is required (not null) if (End == null) { throw new InvalidDataException("End is a required property for ProcessingTimeStatisticsDetails and cannot be null"); } else { this.End = End; } // to ensure "Measure" is required (not null) if (Measure == null) { throw new InvalidDataException("Measure is a required property for ProcessingTimeStatisticsDetails and cannot be null"); } else { this.Measure = Measure; } // to ensure "Dimension" is required (not null) if (Dimension == null) { throw new InvalidDataException("Dimension is a required property for ProcessingTimeStatisticsDetails and cannot be null"); } else { this.Dimension = Dimension; } // to ensure "JobPropertySelectionType" is required (not null) if (JobPropertySelectionType == null) { throw new InvalidDataException("JobPropertySelectionType is a required property for ProcessingTimeStatisticsDetails and cannot be null"); } else { this.JobPropertySelectionType = JobPropertySelectionType; } // to ensure "JobPropertySelections" is required (not null) if (JobPropertySelections == null) { throw new InvalidDataException("JobPropertySelections is a required property for ProcessingTimeStatisticsDetails and cannot be null"); } else { this.JobPropertySelections = JobPropertySelections; } }
public double this[DimensionEnum dimensionEnum, int listIndex] { get; set; }
public double this[DimensionEnum dimensionEnum] { get; set; }
public string CmdEnum7(DimensionEnum dimensions) { return($"{dimensions}"); }