public void EditGridView(string name, IWin32Window parent = null)
{
if (parent == null)
parent = this;
configurationGrid cg = Conf.GridViews.FirstOrDefault(p => p.name == name);
if (cg != null)
{
var gvc = new GridViewCustom
{
Cols = cg.Columns,
Rows = cg.Rows,
GridName = cg.name,
FullScreen = cg.FullScreen,
AlwaysOnTop = cg.AlwaysOnTop,
Display = cg.Display,
Framerate = cg.Framerate,
Mode = cg.ModeIndex,
ModeConfig = cg.ModeConfig,
Overlays = cg.Overlays,
Fill = cg.Fill,
ShowAtStartup = cg.ShowAtStartup,
};
// bool b = ((Form) parent).TopMost;
//((Form) parent).TopMost = false;
gvc.ShowDialog(parent);
//((Form)parent).TopMost = b;
if (gvc.DialogResult == DialogResult.OK)
{
cg.Columns = gvc.Cols;
cg.Rows = gvc.Rows;
cg.name = gvc.GridName;
cg.FullScreen = gvc.FullScreen;
cg.AlwaysOnTop = gvc.AlwaysOnTop;
cg.Display = gvc.Display;
cg.Framerate = gvc.Framerate;
cg.ModeIndex = gvc.Mode;
cg.ModeConfig = gvc.ModeConfig;
cg.Overlays = gvc.Overlays;
cg.Fill = gvc.Fill;
cg.ShowAtStartup = gvc.ShowAtStartup;
ListGridViews();
}
gvc.Dispose();
}
}