• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MessageBox类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MessageBox的典型用法代码示例。如果您正苦于以下问题:C# MessageBox类的具体用法?C# MessageBox怎么用?C# MessageBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MessageBox类属于命名空间,在下文中一共展示了MessageBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Start

    void Start()
    {
        // Stop reorientation weirdness
        // http://answers.unity3d.com/questions/14655/unity-iphone-black-rect-when-i-turn-the-iphone
        Screen.autorotateToPortrait = false;
        Screen.autorotateToPortraitUpsideDown = false;
        Screen.autorotateToLandscapeRight = false;
        Screen.autorotateToLandscapeLeft = false;

        sounds = new Sounds(gameObject);
        sounds.Start();

        var loopTracker = new LoopTracker(sounds);

        var textLabel = new GameObject("prompt text");
        textLabel.SetActive(false);
        var text = textLabel.AddComponent<GUIText>();
        textLabel.transform.position = new Vector3(0f, 0.06f, -9.5f);
        var font = (Font) Resources.Load("sierra_agi_font/sierra_agi_font", typeof(Font));
        text.font = font;

        messageBox = new MessageBox(font);
        var prompt = new Prompt(textLabel, text).build();

        sceneManager = new SceneManager(loopTracker, new MessagePromptCoordinator(prompt, messageBox));
    }
开发者ID:absurdhero,项目名称:tmotmo-full,代码行数:26,代码来源:Layout.cs


示例2: SubStateConfirmEquipMenu

        public SubStateConfirmEquipMenu(SubStateAbstract theparent, int xCoord, int yCoord, int thePC, int itemSlot, int itemLocation, int type)
            : base(theparent)
        {
            PCid = thePC;
            slot = itemSlot;
            itemID = itemLocation;
            itemType = type;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];
            colors = new Color[2];
            menu = new string[2];

            menu[0] = "Yes";
            menu[1] = "No";

            colors[0] = Color.White;
            colors[1] = Color.DarkGray;

            mX = xCoord;
            mY = yCoord;
            width = 27;
            height = 50;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true);
        }
开发者ID:JBailes,项目名称:FSCMStrikesBack,代码行数:25,代码来源:SubStateConfirmEquipMenu.cs


示例3: SubStateSpellSelect

        public SubStateSpellSelect(StateAbstract theparent, SpellAbstract[] theSpells, PC thePC)
            : base(theparent)
        {
            spells = theSpells;
            curr = thePC;

            parent = theparent;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];

            int i;
            colors = new Color[spells.Length];
            menu = new string[spells.Length];

            for (i = 0; i < spells.Length && spells[i] != null; i++)
                menu[i] = spells[i].Name;

            for (; i < spells.Length; i++)
                menu[i] = "";

            if (colors.Length > 0)
                colors[0] = Color.White;

            for (i = 1; i < colors.Length; i++)
                colors[i] = Color.DarkGray;

            mX = 190;
            mY = 75;
            width = 780;
            height = 570;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true, true);
        }
开发者ID:JBailes,项目名称:FSCMStrikesBack,代码行数:33,代码来源:SubStateSpellSelect.cs


示例4: Awake

    public override void Awake()
    {
        base.Awake();
        gameObject.SetActive(false);
        contentPanel = (RectTransform)transform.Find("ContentPanel");
        scroller = transform.Find("Scrollbar").GetComponent<Scrollbar>();
        messageBox = new MessageBox(transform.Find("MessageBox"));

        scroller.onValueChanged.AddListener(delegate(float value)
        {
            float screenHeight = Screen.height;
            float screenWidth = Screen.width;
            float allHeight = contentPanel.rect.height - screenHeight + 50f;
            float allWidth = contentPanel.rect.width;
            float yPos = value * -allHeight + allHeight / 2f + screenHeight / 2f;
            float xPos = (screenWidth - allWidth) / 2f + allWidth / 2;
            contentPanel.position = new UnityEngine.Vector2(xPos, yPos);
        });

        RectTransform userInfoPanel = (RectTransform)contentPanel.Find("UserInfoPanel");
        firstNameText = userInfoPanel.Find("UserNameText").GetComponent<Text>();
        secondNameText = userInfoPanel.Find("UserLavelText").GetComponent<Text>();
        userIconImage = userInfoPanel.Find("UserIcon").GetComponent<Image>();

        avalableGamesPanel = (RectTransform)contentPanel.Find("AvalableGamesPanel");
    }
开发者ID:feamorx86,项目名称:UnityChatTest,代码行数:26,代码来源:UserInfoScreen.cs


示例5: SubStateCharSelectMenuRune

        public SubStateCharSelectMenuRune(SubStateAbstract theparent)
            : base(theparent)
        {
            parent = theparent;

            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];
            colors = new Color[3];
            menu = new string[3];

            menu[0] = StateHandler.GetPC(0).Name;
            menu[1] = StateHandler.GetPC(1).Name;
            menu[2] = StateHandler.GetPC(2).Name;

            colors[0] = Color.White;
            colors[1] = Color.DarkGray;
            colors[2] = Color.DarkGray;

            mX = 100;
            mY = 45;
            width = 860;
            height = 590;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true);
        }
开发者ID:JBailes,项目名称:FSCMStrikesBack,代码行数:25,代码来源:SubStateCharSelectMenuRune.cs


示例6: SubStateDifficultySelect

        public SubStateDifficultySelect(StateAbstract theparent)
            : base(theparent)
        {
            int i;
            parent = theparent;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];

            colors = new Color[6];
            menu = new string[6];

            menu[0] = "Child";
            menu[1] = "Youth";
            menu[2] = "Standard";
            menu[3] = "Challenging";
            menu[4] = "Expert";
            menu[5] = "Insane";

            for (i = 1; i < colors.Length; i++)
                colors[i] = Color.DarkGray;
            colors[0] = Color.White;

            mX = 100;
            mY = 45;
            width = 900;
            height = 630;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true, true);
        }
开发者ID:JBailes,项目名称:FSCMStrikesBack,代码行数:29,代码来源:SubStateDifficultySelect.cs


示例7: SubStateOptionsMenu

        public SubStateOptionsMenu(StateAbstract theparent)
            : base(theparent)
        {
            int i;
            parent = theparent;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];

            colors = new Color[1];
            menu = new string[colors.Length];

            colors[0] = Color.White;
            for (i = 1; i < colors.Length; i++)
                colors[i] = Color.DarkGray;

            menu[0] = "Difficulty";

            for (i = 1; i < menu.Length; i++)
                menu[i] = "Option " + i;

            mX = 100;
            mY = 45;
            width = 900;
            height = 630;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true, true);
        }
开发者ID:JBailes,项目名称:FSCMStrikesBack,代码行数:27,代码来源:SubStateOptionsMenu.cs


示例8: Start

	void Start () {
		var messageBox = new MessageBox ();
		var trialUpgradeButton = new MessageBox.Command ("Trial Upgrade", trialUpgrade);
		var productPurchaseButton = new MessageBox.Command ("In app purchase", productPurchase);
		messageBox.ShowMessageBox ("Which scenario would you like to test?", "Store plugin test", trialUpgradeButton, productPurchaseButton);
	
		// Initialize the Store proxy on debug builds
		Store.DebugApp debugapp = new Store.DebugApp();
		debugapp.Name = "WinControls debug harness";
		debugapp.Price = 5.99;
		debugapp.IsTrial = false;
		debugapp.IsActive = true;

		Store.DebugProduct bigsword = new Store.DebugProduct();
		bigsword.ProductId = "bigsword";
		bigsword.Name = "really big swordy!";
		bigsword.Price = 99.99;

		Store.DebugProduct bigaxe = new Store.DebugProduct();
		bigaxe.ProductId = "bigaxe";
		bigaxe.Name = "really big axe!";
		bigaxe.Price = 65.99;
		bigaxe.IsActive = true;

		Store.EnableDebugWindowsStoreProxy (handleLicenseChanged, debugapp, bigsword, bigaxe);
	}
开发者ID:kungfubozo,项目名称:WinBridge,代码行数:26,代码来源:GameObjectStart.cs


示例9: wuc_ShowMessage

    /// <summary>
    /// 
    /// </summary>
    /// <param name="pInfo">Mensagem</param>
    /// <param name="pPageRedirect">Pagina Redirecionada</param>
    /// <param name="type">Tipo de Mensagem. 1 - information; 2 - warning; 3 - erro;</param>
    public void wuc_ShowMessage(string pInfo, string pPageRedirect, int type)
    {
        string appPath = HttpContext.Current.Request.ApplicationPath;
        string physicalPath = HttpContext.Current.Request.MapPath(appPath);
        MessageBox msgbox = new MessageBox(physicalPath + "\\Resources\\Config\\msgbox.txt");
        msgbox.SetMessage(pInfo);

        switch (type)
        {
            case 1:
                msgbox.SetTitle("Informação");
                if (appPath.ToString() != "/")
                    msgbox.SetIcon(appPath + "/Resources/Img/information.png");
                else
                    msgbox.SetIcon("/Resources/Img/information.png");
                break;
            case 2:
                msgbox.SetTitle("Atenção");
                if (appPath.ToString() != "/")
                    msgbox.SetIcon(appPath + "/Resources/Img/warning.png");
                else
                    msgbox.SetIcon("/Resources/Img/warning.png");
                break;
            case 3:
                msgbox.SetTitle("Error");
                if (appPath.ToString() != "/")
                    msgbox.SetIcon(appPath + "/Resources/Img/error.png");
                else
                    msgbox.SetIcon("/Resources/Img/error.png");
                break;
        }
        msgboxpanel.Visible = true;
        msgbox.SetOKButton("msg_button_class", pPageRedirect);
        msgboxpanel.InnerHtml = msgbox.ReturnObject();
    }
开发者ID:andreibaptista,项目名称:DEF_PUB_PETICOES,代码行数:41,代码来源:MessageBox.ascx.cs


示例10: SubStateRuneSelect

        public SubStateRuneSelect(StateAbstract theparent, Character thePC)
            : base(theparent)
        {
            curr = (PC) thePC;

            parent = theparent;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];

            int i, size = calcSize();
            colors = new Color[size];
            menu = new string[size];

            for (i = 0; i < size; i++)
                menu[i] = curr.runes[i].Name;

            for (; i < size; i++)
                menu[i] = "";

            if(colors.Length > 0)
                colors[0] = Color.White;

            for (i = 1; i < colors.Length; i++)
                colors[i] = Color.DarkGray;

            mX = 100;
            mY = 45;
            width = 900;
            height = 630;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true, true);
        }
开发者ID:JBailes,项目名称:FSCMStrikesBack,代码行数:32,代码来源:SubStateRuneSelect.cs


示例11: BattleGUI

            internal BattleGUI(ScreenConstants screen, GUIManager manager, 
            Dialog messageFrame, MessageBox messageBox, 
            IMenuWidget<MainMenuEntries> mainWidget, 
            IMenuWidget<Move> moveWidget, IMenuWidget<Pokemon> pokemonWidget, 
            IMenuWidget<Item> itemWidget, IBattleStateService battleState, 
            BattleData data)
        {
            this.battleState = battleState;
            playerId = data.PlayerId;
            ai = data.Clients.First(id => !id.IsPlayer);
            this.moveWidget = moveWidget;
            this.itemWidget = itemWidget;
            this.mainWidget = mainWidget;
            this.pokemonWidget = pokemonWidget;

            this.messageBox = messageBox;
            this.messageFrame = messageFrame;

            InitMessageBox(screen, manager);

            InitMainMenu(screen, manager);
            InitAttackMenu(screen, manager);
            InitItemMenu(screen, manager);
            InitPKMNMenu(screen, manager);

        }
开发者ID:Nexus87,项目名称:PokeClone,代码行数:26,代码来源:BattleGUI.cs


示例12: Page_Load

    /// <summary>
    /// handle load event
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        employees = db.Employees;

        // only perform on page load
        if (!Page.IsPostBack)
        {
            // catch any database exceptions
            try
            {

                // table databinding
                refreshDataBinding();

                //set the login id
                lblUsername.Text = Page.User.Identity.Name;
            }
            catch (Exception)
            {
                // display messagebox
                string title = "My box title goes here";
                string text = "Do you want to Update this record?";
                // use my custom messagebox class
                MessageBox messageBox = new MessageBox(text, title, MessageBox.MessageBoxIcons.Question, MessageBox.MessageBoxButtons.YesOrNo, MessageBox.MessageBoxStyle.StyleA);
                messageBox.SuccessEvent.Add("YesModClick");

                // set text of asp:Literal#PopupBox in the aspx file
                PopupBox.Text = messageBox.Show(this);
            }
        }
    }
开发者ID:chrisUsick,项目名称:HumanResources,代码行数:34,代码来源:wfEmployee.aspx.cs


示例13: Start

        protected override void Start()
        {
            if (email == null || recover == null) {
                Debug.LogWarning ("UIRecoverPassword: Please assign all fields in the inspector.");
                return;
            }
            if (LoginSystem.current == null) {
                Debug.LogWarning("UIRecoverPassword: Requires a LoginSystem. Create one from Tools > Unitycoding > Login System > Login System!");
                return;
            }

            if (LoginSystem.Settings == null) {
                Debug.LogWarning("[LoginSystem(UIRecoverPassword)] Please assign LoginSettings to the Login Systtem!");
                return;
            }

            messageBox = UIWindow.Get<MessageBox> (LoginSystem.Settings.messageBoxWindow);

            if (messageBox == null) {
                Debug.LogWarning("[LoginSystem(UIRecoverPassword)] No message box found with name " + LoginSystem.Settings.messageBoxWindow+"!");
                return;
            }

            loginWindow = UIWindow.Get<UILogin> (LoginSystem.Settings.loginWindow);

            if (loginWindow == null) {
                Debug.LogWarning("[LoginSystem(UIRecoverPassword)] No login window found with name " + LoginSystem.Settings.loginWindow+"!");
                return;
            }

            LoginSystem.current.RegisterListener ("OnPasswordRecovered", OnPasswordRecovered);
            LoginSystem.current.RegisterListener ("OnFailedToRecoverPassword", OnFailedToRecoverPassword);

            recover.onClick.AddListener (RecoverPasswordUsingFields);
        }
开发者ID:gloowa,项目名称:mstest,代码行数:35,代码来源:UIRecoverPassword.cs


示例14: Gui

        public Gui(Viewport viewport)
        {
            this.viewport = viewport;

            mainMenu = new MainMenu(viewport); //for developing only, later it will be moved somewhere and rewritten
            messageBox = new MessageBox(viewport);
        }
开发者ID:Czeslav,项目名称:Costam,代码行数:7,代码来源:Gui.cs


示例15: GameplayScreen

        public GameplayScreen()
        {
            _state = GameState.PlayerTurn;

            _messageBox = _messageBox = new MessageBox(new Vector2(0, 628));
            Announcer.Instance.Announcement += new Announcer.AnnouncementEvent(AddAnnouncement);
            _world = new World();
            _world.AchievementUnlocked += new World.AchievementEvent(AchievementUnlocked);
            _user = new User();
            _user.UserInputReceived += new User.UserInput(UserInputReceived);
            _sideBar = new SideBar(new Vector2(919, 0), ref _world.Player);
            _inventory = new Inventory(new Vector2(10, 30), _world.Player.Inventory);
            _spells = new SpellBook(new Vector2(10, 400), _world.Player.Spells);
            Camera.SetWorldSize(_world.GetWorldSize().X + 120, _world.GetWorldSize().Y + 300);
            _mouse = new MouseHelper();
            _mouse.MouseButtonReleased += new MouseHelper.MouseButtonEventEvent(MouseButtonReleased);
            _achievementNotifications = new List<AchievementNotifier>();
            _miniMap = new MiniMap(new Vector2(824, 428), _world);
            GameReference.Game.IsMouseVisible = true;
            _timeOfLastMouseMovement = new TimeSpan();
            _previousMouseState = Mouse.GetState();

            _availableTargets = new List<ICreature>();
            _currentTargetIndex = 0;
            _targetImage = ContentHelper.Content.Load<Texture2D>("target");
        }
开发者ID:faintpixel,项目名称:Roguelike,代码行数:26,代码来源:GameplayScreen.cs


示例16: MessageBoxTests

        public MessageBoxTests()
        {
            _httpContext = TestHelper.CreateMockedHttpContext();
            _viewContext = new ViewContext { HttpContext = _httpContext.Object, ViewData = new ViewDataDictionary() };

            _messageBox = new MessageBox(_viewContext, new Mock<IClientSideObjectWriterFactory>().Object) { AssetKey = jQueryViewComponentFactory.DefaultAssetKey };
        }
开发者ID:timbooker,项目名称:telerikaspnetmvc,代码行数:7,代码来源:MessageBoxTests.cs


示例17: SubStateSlotMenuRune

        public SubStateSlotMenuRune(SubStateAbstract theparent, int thePC)
            : base(theparent)
        {
            PCid = thePC;
            absolute = false;
            StateHandler.AddDelay();
            messageBoxes = new MessageBox[1];
            colors = new Color[2];
            menu = new string[2];

            for (int i = 0; i < 2; i++)
            {
                if (StateHandler.GetPC(thePC).GetRune(i) == null)
                    menu[i] = "Open";
                else
                    menu[i] = StateHandler.GetPC(thePC).GetRune(i).Name;
                colors[i] = Color.DarkGray;
            }

            colors[0] = Color.White;

            mX = 170;
            mY = 60;
            width = 760;
            height = 490;

            messageBoxes[0] = new MessageBox(mX, mY, width, height, menu, colors, true, true);
        }
开发者ID:JBailes,项目名称:FSCMStrikesBack,代码行数:28,代码来源:SubStateSlotMenuRune.cs


示例18: ChangeMCVersion

        public ChangeMCVersion()
        {
            InitializeComponent();
            try
            {
                foreach (TinyMinecraftVersion ver in VersionManager.versions)
                {
                    ListBoxItem item = new ListBoxItem();
                    item.Content = ver.Key;
                    item.Tag = ver;

                    if (ver.Type == ReleaseType.release)
                        lb_release.Items.Add(item);
                    else if (ver.Type == ReleaseType.snapshot)
                        lb_snapshot.Items.Add(item);
                    else
                        lb_instance.Items.Add(item);
                }
            }
            catch
            {
                MessageBox mb = new MessageBox("Warning!","The versions haven't initialized yet");
                mb.Show();
                this.Close();
            }
        }
开发者ID:Northcode,项目名称:MCM-reboot,代码行数:26,代码来源:ChangeMCVersion.xaml.cs


示例19: Show

 public static void Show(string text)
 {
     MessageBox mb = new MessageBox();
     mb.lblText.Text = text;
     MainForm.Enabled = false;
     mb.Show(MainForm);
     mb.Location = new Point((MainForm.Width / 2) - (mb.Width / 2), (MainForm.Height / 2) - (mb.Height / 2));
 }
开发者ID:ErichDonGubler,项目名称:uvschess,代码行数:8,代码来源:MessageBox.cs


示例20: Awake

    protected virtual void Awake()
    {
        msgBox = GameObject.FindObjectOfType<MessageBox>();
        PlayerData.instance.CheckInstance();

        this.name = this.name.Remove(this.name.IndexOf("(")); // (Clone) 문자열 삭제
        amount = PlayerData.instance.itemStorage[name];
    }
开发者ID:penspanic,项目名称:Mawang,代码行数:8,代码来源:ItemBase.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MessageBoxButton类代码示例发布时间:2022-05-24
下一篇:
C# Message类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap