public void AddGrid(GridTableManager dg) { lock (_singleton) { Grid = dg; } }
public StatsViewer( APPLICATION_DATA appData) { InitializeComponent(); m_AppData = appData; m_StatGroups = m_AppData.HealthStatistics.GetGroupList(); m_AllStats = m_AppData.HealthStatistics.GetStatList(); m_GroupManager = new STAT_GROUP_MANAGER(); m_GroupManager.LoadGroups(m_StatGroups); singleton = new object(); ButtonSize = new Size(this.Size.Width/4, 25 ); Locations = new Point[NUM_BUTTONS]; m_PushStatusInfoQ = new ThreadSafeQueue<string>(2); m_ButtonClickHandlers = new ButtonClick[NUM_BUTTONS]; // row one Locations[0] = new Point(0, 0); Locations[1] = new Point(ButtonSize.Width, 0); Locations[2] = new Point(ButtonSize.Width*2, 0); Locations[3] = new Point(ButtonSize.Width*3, 0); // row two Locations[4] = new Point(0, ButtonSize.Height); Locations[5] = new Point(ButtonSize.Width, ButtonSize.Height); Locations[6] = new Point(ButtonSize.Width * 2, ButtonSize.Height); Locations[7] = new Point(ButtonSize.Width * 3, ButtonSize.Height); ButtonUsed = new bool[NUM_BUTTONS]; Buttons = new Button[NUM_BUTTONS]; for (int b = 0; b < NUM_BUTTONS; b++) { Buttons[b] = new Button(); ButtonUsed[b] = false; } int groupCnt = 0; foreach (string group in m_StatGroups) { if (groupCnt == NUM_BUTTONS) break; int b = GetNextAvailableButton(); DefineButton(Buttons[b], ButtonSize, group, Locations[b], b); this.Controls.Add(Buttons[b]); } foreach (string group in m_StatGroups) { GridTableManager grid = new GridTableManager(); grid.CreateGrid(new Size(this.Size.Width, this.Size.Height - 50), new Point(0, 50)); m_GroupManager[group].AddGrid(grid); } }
public StatsViewer(APPLICATION_DATA appData) { InitializeComponent(); m_AppData = appData; m_StatGroups = m_AppData.HealthStatistics.GetGroupList(); m_AllStats = m_AppData.HealthStatistics.GetStatList(); m_GroupManager = new STAT_GROUP_MANAGER(); m_GroupManager.LoadGroups(m_StatGroups); singleton = new object(); ButtonSize = new Size(this.Size.Width / 4, 25); Locations = new Point[NUM_BUTTONS]; m_PushStatusInfoQ = new ThreadSafeQueue <string>(2); m_ButtonClickHandlers = new ButtonClick[NUM_BUTTONS]; // row one Locations[0] = new Point(0, 0); Locations[1] = new Point(ButtonSize.Width, 0); Locations[2] = new Point(ButtonSize.Width * 2, 0); Locations[3] = new Point(ButtonSize.Width * 3, 0); // row two Locations[4] = new Point(0, ButtonSize.Height); Locations[5] = new Point(ButtonSize.Width, ButtonSize.Height); Locations[6] = new Point(ButtonSize.Width * 2, ButtonSize.Height); Locations[7] = new Point(ButtonSize.Width * 3, ButtonSize.Height); ButtonUsed = new bool[NUM_BUTTONS]; Buttons = new Button[NUM_BUTTONS]; for (int b = 0; b < NUM_BUTTONS; b++) { Buttons[b] = new Button(); ButtonUsed[b] = false; } int groupCnt = 0; foreach (string group in m_StatGroups) { if (groupCnt == NUM_BUTTONS) { break; } int b = GetNextAvailableButton(); DefineButton(Buttons[b], ButtonSize, group, Locations[b], b); this.Controls.Add(Buttons[b]); } foreach (string group in m_StatGroups) { GridTableManager grid = new GridTableManager(); grid.CreateGrid(new Size(this.Size.Width, this.Size.Height - 50), new Point(0, 50)); m_GroupManager[group].AddGrid(grid); } }