Skip to content

Commit

Permalink
Display Information Structures and Functions (#37)
Browse files Browse the repository at this point in the history
* Implementing necessary structures and functions to get display information, store it, and print the information.

* Fixed bug with PrintDisplaySettings(...), implemented SaveDisplaySettings(...), and modified Form1.cs to test the functions.
  • Loading branch information
Fahim-zzz authored Sep 27, 2024
1 parent 50c8bb9 commit e858700
Show file tree
Hide file tree
Showing 2 changed files with 597 additions and 409 deletions.
18 changes: 3 additions & 15 deletions DAIRemote/Form1.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Windows.Forms;
using static DisplayProfileManager.DisplayConfig;
using DisplayProfileManager;

namespace DAIRemote
{
Expand Down Expand Up @@ -29,22 +29,10 @@ private void Form1_FormClosing(object sender, FormClosingEventArgs e)
trayIconManager.HideIcon();
}
}

string fileName = "displayConfig";
private void BtnSaveDisplayConfig_Click(object sender, EventArgs e)
{
try
{
string filePath = "displayConfig.json";

var (pathArray, modeInfoArray, topologyId) = GetDisplayConfig();
SaveDisplayConfig(filePath, pathArray, modeInfoArray, topologyId);

MessageBox.Show($"Display configuration saved to {filePath}", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show($"An error occurred while saving the display configuration: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
DisplayConfig.SaveDisplaySettings(fileName + ".json");
}
}
}
Loading

0 comments on commit e858700

Please sign in to comment.