本文整理汇总了C#中Group.add方法的典型用法代码示例。如果您正苦于以下问题:C# Group.add方法的具体用法?C# Group.add怎么用?C# Group.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Group
的用法示例。
在下文中一共展示了Group.add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnOK_Click
private void btnOK_Click(object sender, EventArgs e)
{
try
{
if (checkInput())
{
switch (function)
{
case "add":
objGroup = new Group();
setDataObj();
if (objGroup.add() > 0 && DBInstance.commit() > 0)
{
XtraMessageBox.Show("Thêm nhóm quyền thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
Guid id = objGroup.id;
reloadAndFocused(id);
}
else
{
XtraMessageBox.Show("Thêm nhóm quyền không thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
break;
case "edit":
setDataObj();
if (objGroup.update() > 0 && DBInstance.commit() > 0)
{
XtraMessageBox.Show("Sửa nhóm quyền thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
Guid id = objGroup.id;
reloadAndFocused(id);
}
else
{
XtraMessageBox.Show("Sửa nhóm quyền không thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
break;
}
}
}
catch (Exception ex)
{
Debug.WriteLine(this.Name + "->btnOk_Click: " + ex.Message);
}
}
示例2: Create
public override void Create()
{
G.playMusic("titleMusic");
titleScreen = new Sprite();
titleScreen.screenPositioning = ScreenPositioning.Absolute;
titleScreen.loadGraphic("titleScreen", 640, 360);
add(titleScreen);
roundOption = new MenuText("ROUNDS:", () => {
Assets.getSound("select").Play(0.6f, 0, 0);
GameTracker.RoundsToWin = (GameTracker.RoundsToWin % 5) + 1;
roundOption.valueText = rounds[GameTracker.RoundsToWin - 1].ToString();
});
roundOption.valueText = rounds[GameTracker.RoundsToWin - 1].ToString();
mainMenu = new Menu(MENU_X, 204);
mainMenu.addMenuText(new MenuText("START GAME", () => {
Assets.getSound("superKO").Play();
flicker = false;
mainMenu.deactivate();
G.DoForSeconds(0.5f, () => {
//MediaPlayer.Volume -= G.elapsed;
}, () => {
G.switchState(new TeamSelectState(), "gate");
});
}));
mainMenu.addMenuText(new MenuText("CONTROLS", displayControls));
mainMenu.addMenuText(roundOption);
//mainMenu.addMenuText(new MenuText("OPTIONS", displayOptions));
mainMenu.addMenuText(new MenuText("CREDITS", displayCredits));
mainMenu.addMenuText(new MenuText("EXIT", () => G.exit()));
mainMenu.deactivate();
add(mainMenu);
optionsMenu = new Menu(MENU_X, 204);
//optionsMenu.addMenuText(new MenuText("ROUNDS:"));
//optionsMenu.addMenuText(new MenuText("ZOOM:"));
//optionsMenu.addMenuText(new MenuText("FULLSCREEN:", G.toggleFullscreen));
optionsMenu.deactivate();
add(optionsMenu);
credits = new Group();
Text credit;
credit = new Text("CODE", MENU_X, 204);
credit.color = new Color(0x77, 0x80, 0x85);
credits.add(credit);
credits.add(new Text("JOSH SCHONSTAL", MENU_X, 220));
credit = new Text("ART", MENU_X, 236);
credit.color = new Color(0x77, 0x80, 0x85);
credits.add(credit);
credits.add(new Text("IAN BROCK", MENU_X, 252));
credit = new Text("SOUND", MENU_X, 268);
credit.color = new Color(0x77, 0x80, 0x85);
credits.add(credit);
credits.add(new Text("GUERIN MCMURRY", MENU_X, 284));
credits.visible = false;
add(credits);
controls = new Sprite(190, 182);
controls.loadGraphic("controls", 251, 125);
controls.visible = false;
controls.screenPositioning = ScreenPositioning.Absolute;
add(controls);
DoInSeconds(2, () => {
pressStart = new Text("PUSH START BUTTON");
pressStart.y = 210;
pressStart.x = 259;
pressStartShadow = new Text(pressStart.text);
pressStartShadow.y = pressStart.y + 1;
pressStartShadow.x = pressStart.x;
pressStartShadow.color = Color.Black;
add(pressStartShadow);
add(pressStart);
ready = true;
});
GameTracker.MatchesWon[Team.Left] = 0;
GameTracker.MatchesWon[Team.Right] = 0;
GameTracker.RoundsWon[Team.Left] = 0;
GameTracker.RoundsWon[Team.Right] = 0;
GameTracker.LeftPlayers = new List<PlayerIndex>();
GameTracker.RightPlayers = new List<PlayerIndex>();
}