Beispiel #1
0
        private PathInfo(
            DisplayConfigPathSourceInfo sourceInfo,
            DisplayConfigSourceMode?sourceMode,
            IEnumerable <
                Tuple <
                    DisplayConfigPathInfoFlags,
                    DisplayConfigPathTargetInfo,
                    DisplayConfigTargetMode?,
                    DisplayConfigDesktopImageInfo?
                    >
                > targets
            )
        {
            DisplaySource = new PathDisplaySource(new PathDisplayAdapter(sourceInfo.AdapterId), sourceInfo.SourceId);

            IsInUse = sourceInfo.StatusFlags.HasFlag(DisplayConfigPathSourceInfoFlags.InUse);
            IsModeInformationAvailable = sourceMode.HasValue;

            if (sourceMode.HasValue)
            {
                _resolution  = new Size((int)sourceMode.Value.Width, (int)sourceMode.Value.Height);
                _pixelFormat = sourceMode.Value.PixelFormat;
                _position    = new Point(sourceMode.Value.Position.X, sourceMode.Value.Position.Y);
            }

            TargetsInfo = targets.Select(t => new PathTargetInfo(t.Item1, t.Item2, t.Item3, t.Item4)).ToArray();

            if (TargetsInfo.Any(info => info.IsVirtualModeSupportedByPath) &&
                sourceInfo.CloneGroupId != DisplayConfigPathSourceInfo.InvalidCloneGroupId
                )
            {
                _cloneGroupId = sourceInfo.CloneGroupId;
                IsCloneMember = true;
            }
        }
Beispiel #2
0
 /// <summary>
 ///     Creates a new PathInfo
 /// </summary>
 /// <param name="displaySource">The display source</param>
 /// <param name="pathTargetInfos">An array of target information</param>
 public PathInfo(
     PathDisplaySource displaySource,
     PathTargetInfo[] pathTargetInfos
     ) : this(displaySource)
 {
     TargetsInfo = pathTargetInfos;
 }
Beispiel #3
0
 /// <summary>
 ///     Creates a new PathInfo
 /// </summary>
 /// <param name="displaySource">The display source</param>
 /// <param name="pathTargetInfos">An array of target information</param>
 /// <param name="cloneGroup">The display clone group, only valid for virtual aware paths</param>
 public PathInfo(
     PathDisplaySource displaySource,
     PathTargetInfo[] pathTargetInfos,
     uint cloneGroup
     ) : this(displaySource, cloneGroup)
 {
     TargetsInfo = pathTargetInfos;
 }
Beispiel #4
0
 /// <summary>
 ///     Creates a new PathInfo
 /// </summary>
 /// <param name="displaySource">The display source</param>
 /// <param name="position">The display position in desktop</param>
 /// <param name="resolution">The display resolution</param>
 /// <param name="pixelFormat">The display pixel format</param>
 /// <param name="pathTargetInfos">An array of target information</param>
 public PathInfo(
     PathDisplaySource displaySource,
     Point position,
     Size resolution,
     DisplayConfigPixelFormat pixelFormat,
     PathTargetInfo[] pathTargetInfos
     ) : this(displaySource, position, resolution, pixelFormat)
 {
     TargetsInfo = pathTargetInfos;
 }
Beispiel #5
0
 /// <summary>
 ///     Creates a new PathInfo
 /// </summary>
 /// <param name="displaySource">The display source</param>
 /// <param name="position">The display position in desktop</param>
 /// <param name="resolution">The display resolution</param>
 /// <param name="pixelFormat">The display pixel format</param>
 public PathInfo(
     PathDisplaySource displaySource,
     Point position,
     Size resolution,
     DisplayConfigPixelFormat pixelFormat
     ) : this(displaySource)
 {
     _position    = position;
     _resolution  = resolution;
     _pixelFormat = pixelFormat;
     IsModeInformationAvailable = true;
 }
Beispiel #6
0
 /// <summary>
 ///     Creates a new PathInfo
 /// </summary>
 /// <param name="displaySource">The display source</param>
 /// <param name="cloneGroup">The display clone group, only valid for virtual aware paths</param>
 public PathInfo(PathDisplaySource displaySource, uint cloneGroup) : this(displaySource)
 {
     IsCloneMember = true;
     _cloneGroupId = cloneGroup;
 }
Beispiel #7
0
 /// <summary>
 ///     Creates a new PathInfo
 /// </summary>
 /// <param name="displaySource">The display source</param>
 public PathInfo(PathDisplaySource displaySource)
 {
     DisplaySource = displaySource;
 }