示例#1
0
 private void OnScaleChanged(DependencyPropertyChangedEventArgs e)
 {
     MonitorWidth            = XMax - XMin;
     MonitorHeight           = YMax - YMin;
     AspectRatio             = (double)MonitorWidth / MonitorHeight;
     HorizontalSizeText.Text = MonitorWidth.ToString();
     VerticalSizeText.Text   = MonitorHeight.ToString();
 }
示例#2
0
            public override string ToString()
            {
                var sb = new StringBuilder();

                // using CultureInfo.InvariantCulture since this is internal data
                sb.Append("Monitor: ");
                sb.AppendLine(Monitor);
                sb.Append("Virtual desktop: ");
                sb.AppendLine(VirtualDesktop);
                sb.Append("DPI: ");
                sb.AppendLine(Dpi.ToString(CultureInfo.InvariantCulture));

                sb.Append("X: ");
                sb.AppendLine(LeftCoordinate.ToString(CultureInfo.InvariantCulture));
                sb.Append("Y: ");
                sb.AppendLine(TopCoordinate.ToString(CultureInfo.InvariantCulture));

                sb.Append("Width: ");
                sb.AppendLine(MonitorWidth.ToString(CultureInfo.InvariantCulture));
                sb.Append("Height: ");
                sb.AppendLine(MonitorHeight.ToString(CultureInfo.InvariantCulture));

                return(sb.ToString());
            }