示例#1
0
        public PathTargetInfo ToPathTargetInfo()
        {
            var targetDevice =
                PathDisplayTarget.GetDisplayTargets()
                .FirstOrDefault(
                    target => target.DevicePath.StartsWith(DevicePath,
                                                           StringComparison.InvariantCultureIgnoreCase));

            if (targetDevice == null)
            {
                return(null);
            }

            return(new PathTargetInfo(new PathDisplayTarget(targetDevice.Adapter, targetDevice.TargetId),
                                      FrequencyInMillihertz, ScanLineOrdering.ToDisplayConfigScanLineOrdering(),
                                      Rotation.ToDisplayConfigRotation(), Scaling.ToDisplayConfigScaling()));
        }
        public static DisplayConfigScanLineOrdering ToDisplayConfigScanLineOrdering(
            this ScanLineOrdering scanLineOrdering)
        {
            switch (scanLineOrdering)
            {
            case ScanLineOrdering.Progressive:

                return(DisplayConfigScanLineOrdering.Progressive);

            case ScanLineOrdering.InterlacedWithUpperFieldFirst:

                return(DisplayConfigScanLineOrdering.InterlacedWithUpperFieldFirst);

            case ScanLineOrdering.InterlacedWithLowerFieldFirst:

                return(DisplayConfigScanLineOrdering.InterlacedWithLowerFieldFirst);

            default:

                return(DisplayConfigScanLineOrdering.NotSpecified);
            }
        }