Exemplo n.º 1
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Rows;
         hashCode = (hashCode * 397) ^ Columns;
         hashCode = (hashCode * 397) ^ (LogicalGPU != null ? LogicalGPU.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Displays?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
Exemplo n.º 2
0
 /// <inheritdoc />
 public bool Equals(TopologyDetails other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return((Rows == other.Rows) && (Columns == other.Columns) && LogicalGPU.Equals(other.LogicalGPU) &&
            Displays.SequenceEqual(other.Displays));
 }
Exemplo n.º 3
0
        private static void Main(string[] args)
        {
            _writer = new StreamWriter(new FileStream(
                                           string.Format("HeliosDisplayManagement.Reporting.{0}.log", Process.GetCurrentProcess().Id),
                                           FileMode.CreateNew));

            try
            {
                Dump(DisplayAdapter.GetDisplayAdapters(), "WindowsDisplayAPI.DisplayAdapter.GetDisplayAdapters()");
            }
            catch (Exception e)
            {
                WriteException(e);
            }

            try
            {
                Dump(Display.GetDisplays(), "WindowsDisplayAPI.Display.GetDisplays()", new[]
                {
                    new Tuple <Func <Display, object>, string>(display => display.GetPossibleSettings(),
                                                               "GetPossibleSettings()")
                });
            }
            catch (Exception e)
            {
                WriteException(e);
            }

            try
            {
                Dump(UnAttachedDisplay.GetUnAttachedDisplays(),
                     "WindowsDisplayAPI.UnAttachedDisplay.GetUnAttachedDisplays()");
            }
            catch (Exception e)
            {
                WriteException(e);
            }

            try
            {
                Dump(PathDisplayAdapter.GetAdapters(),
                     "WindowsDisplayAPI.DisplayConfig.PathDisplayAdapter.GetAdapters()",
                     new[]
                {
                    new Tuple <Func <PathDisplayAdapter, object>, string>(adapter => adapter.ToDisplayAdapter(),
                                                                          "ToDisplayAdapter()")
                });
            }
            catch (Exception e)
            {
                WriteException(e);
            }

            try
            {
                Dump(PathDisplaySource.GetDisplaySources(),
                     "WindowsDisplayAPI.DisplayConfig.PathDisplaySource.GetDisplaySources()", new[]
                {
                    new Tuple <Func <PathDisplaySource, object>, string>(source => source.ToDisplayDevices(),
                                                                         "ToDisplayDevices()")
                });
            }
            catch (Exception e)
            {
                WriteException(e);
            }

            try
            {
                Dump(PathDisplayTarget.GetDisplayTargets(),
                     "WindowsDisplayAPI.DisplayConfig.PathDisplayTarget.GetDisplayTargets()", new[]
                {
                    new Tuple <Func <PathDisplayTarget, object>, string>(target => target.ToDisplayDevice(),
                                                                         "ToDisplayDevice()")
                });
            }
            catch (Exception e)
            {
                WriteException(e);
            }

            try
            {
                if (PathInfo.IsSupported)
                {
                    Dump(PathInfo.GetActivePaths(), "WindowsDisplayAPI.DisplayConfig.PathInfo.GetActivePaths()", null,
                         2);
                }
            }
            catch (Exception e)
            {
                WriteException(e);
            }

            try
            {
                Dump(LogicalGPU.GetLogicalGPUs(), "NvAPIWrapper.GPU.LogicalGPU.GetLogicalGPUs()", null, 1);
            }
            catch (Exception e)
            {
                WriteException(e);
            }

            try
            {
                Dump(PhysicalGPU.GetPhysicalGPUs(), "NvAPIWrapper.GPU.PhysicalGPU.GetPhysicalGPUs()");
            }
            catch (Exception e)
            {
                WriteException(e);
            }

            try
            {
                Dump(NvAPIWrapper.Display.Display.GetDisplays(), "NvAPIWrapper.Display.Display.GetDisplays()", new[]
                {
                    new Tuple <Func <NvAPIWrapper.Display.Display, object>, string>(
                        display => display.GetSupportedViews(),
                        "GetSupportedViews()")
                });
            }
            catch (Exception e)
            {
                WriteException(e);
            }

            try
            {
                Dump(NvAPIWrapper.Display.UnAttachedDisplay.GetUnAttachedDisplays(),
                     "NvAPIWrapper.Display.UnAttachedDisplay.GetUnAttachedDisplays()");
            }
            catch (Exception e)
            {
                WriteException(e);
            }

            try
            {
                Dump(NvAPIWrapper.Display.PathInfo.GetDisplaysConfig(),
                     "NvAPIWrapper.Display.PathInfo.GetDisplaysConfig()",
                     null, 3);
            }
            catch (Exception e)
            {
                WriteException(e);
            }

            try
            {
                Dump(GridTopology.GetGridTopologies(), "NvAPIWrapper.Mosaic.GridTopology.GetGridTopologies()", null, 3);
            }
            catch (Exception e)
            {
                WriteException(e);
            }


            try
            {
                Dump(Profile.GetAllProfiles(), "HeliosDisplayManagement.Shared.Profile.GetAllProfiles()", null, 99);
            }
            catch (Exception e)
            {
                WriteException(e);
            }

            _writer.Flush();
            _writer.Close();
            _writer.Dispose();

            Console.WriteLine(@"Done, press enter to exit.");
            Console.ReadLine();
        }