public void GetSize() { var memField = new MemField(default(int), default(int), default(Control)); var size = typeof(MemField).GetField("_fSize", BindingFlags.NonPublic | BindingFlags.Instance); Debug.WriteLine(size.GetValue(null)); }
protected void SetGameSize(MemBoard memBoard, MemField memField) { var level = (int)memBoard.GetType().GetField("_gameLevel", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(memBoard); var size = (Size)memField.GetType().GetField("_fSize", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(memField); Height = 4 * size.Height + 50 + 25; Width = (level / 4) * size.Width + 17; }
//------------------------------------------------------------------------------------------------------------------ //Click field method private void ClickMe(object sender, EventArgs e) { MemField field = sender as MemField; _game.Clicker(field, _gameBoard.Board.Where(fld => fld.Visible).ToList()); }