コード例 #1
0
ファイル: FormLocations.cs プロジェクト: simaimch/forge
        public void RenderLocationButtons(Queue <Entity> locations, Gamedata.Gamedata gamedata)
        {
            this.SuspendLayout();

            tableLayoutPanelMain.RowCount = locations.Count;
            tableLayoutPanelMain.RowStyles.Clear();
            tableLayoutPanelMain.Controls.Clear();

            locationButtons = new LocationButton[locations.Count];
            int i = 0;

            foreach (Entity entity in locations)
            {
                LocationButton lb = new LocationButton(gamedata.GetValue <String>(entity.ID, "Caption", entity.ID));
                tableLayoutPanelMain.Controls.Add(lb, 0, i);
                locationButtons[i] = lb;
                i++;

                lb.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);

                this.tableLayoutPanelMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
            }

            this.ResumeLayout();
        }
コード例 #2
0
ファイル: Gamemanager.cs プロジェクト: simaimch/forge
        public Gamemanager(FormMain formMain)
        {
            this.formMain = formMain;

            gamedata = new Gamedata.Gamedata();
        }