Example #1
0
        public PathTarget(PathTargetInfo targetInfo, SurroundTopology surround = null)
        {
            DevicePath = targetInfo.DisplayTarget.DevicePath;
            var index = DevicePath.IndexOf("{", StringComparison.InvariantCultureIgnoreCase);

            if (index > 0)
            {
                DevicePath = DevicePath.Substring(0, index).TrimEnd('#');
            }

            FrequencyInMillihertz = targetInfo.FrequencyInMillihertz;
            Rotation         = targetInfo.Rotation.ToRotation();
            Scaling          = targetInfo.Scaling.ToScaling();
            ScanLineOrdering = targetInfo.ScanLineOrdering.ToScanLineOrdering();

            try
            {
                DisplayName = targetInfo.DisplayTarget.FriendlyName;
            }
            catch
            {
                DisplayName = null;
            }

            SurroundTopology = surround ?? SurroundTopology.FromPathTargetInfo(targetInfo);
        }