コード例 #1
0
        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));
        }
コード例 #2
0
ファイル: Form1.Designer.cs プロジェクト: vanter2x/Learning
        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;
        }
コード例 #3
0
        //------------------------------------------------------------------------------------------------------------------

        //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());
        }