using System; using System.Collections.Generic; public class Monitor { public static List info_data_list { get { if (Monitor.data_ == null || Monitor.data_.Count == 0) { Monitor.<>c__AnonStorey0 <>c__AnonStorey = new Monitor.<>c__AnonStorey0(); Monitor.data_ = new List(); <>c__AnonStorey.class_pointer = DLLMonitorData.CreateMonitorData(); int monitorCount = DLLMonitorData.GetMonitorCount(<>c__AnonStorey.class_pointer); int i; for (i = 0; i < monitorCount; i++) { DllBase.NativeWriteStringFunction func = delegate(IntPtr p, int buff_size) { DLLMonitorData.GetMonitorName(<>c__AnonStorey.class_pointer, i, p, buff_size); }; Monitor.InfoData item; item.name = DllBase.GetNativeStringToUtf8(func); item.width = DLLMonitorData.GetMonitorWidth(<>c__AnonStorey.class_pointer, i); item.height = DLLMonitorData.GetMonitorHeight(<>c__AnonStorey.class_pointer, i); item.is_primary = DLLMonitorData.IsMonitorPrimary(<>c__AnonStorey.class_pointer, i); Monitor.data_.Add(item); } DLLMonitorData.DeleteMonitorData(<>c__AnonStorey.class_pointer); } return Monitor.data_; } } private static List data_; public struct InfoData { public string name; public int width; public int height; public bool is_primary; } }