当前位置: 首页>>代码示例>>C#>>正文


C# Group.add方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:quocdunginfo,项目名称:QuanLyTaiSan,代码行数:43,代码来源:ucPhanQuyen_Group.cs

示例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>();
        }
开发者ID:schonstal,项目名称:BLOODBALL,代码行数:84,代码来源:MenuState.cs


注:本文中的Group.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。