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


C# MessageBox类代码示例

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


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


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