コード例 #1
0
    public void Start()
    {
        premio        = false;
        buttonOptions = GameObject.Find("ElCubo").GetComponent <ButtonOptions>();

        AdsReal();
    }
コード例 #2
0
ファイル: XMessageboxUI.cs プロジェクト: vlad1000/ModioX
        public XMessageboxUI(string title = "", string body = "", ButtonOptions options = ButtonOptions.YesNo)
        {
            InitializeComponent();
            LabelTitle.Text = title;
            LabelBody.Text  = body;

            TransparencyKey = Color.FromName("MenuBar");

            if (options == ButtonOptions.Ok)
            {
                ButtonExtra.Visible = false;
                ButtonYes.Visible   = false;
                ButtonNo.Visible    = true;
                ButtonNo.Text       = "OK";
            }
            else if (options == ButtonOptions.YesNo)
            {
                ButtonExtra.Visible = false;
                ButtonYes.Visible   = true;
                ButtonNo.Visible    = true;
            }
            else if (options == ButtonOptions.YesNoCancel)
            {
                ButtonExtra.Visible = true;
                ButtonYes.Visible   = true;
                ButtonNo.Visible    = true;
            }
        }
コード例 #3
0
        public MessageBox(Window Owner, string Title, string Text = "", ButtonOptions options = ButtonOptions.OKOnly)
        {
            this.Title  = Title;
            this.Owner  = Owner;
            this.Width  = 280;
            this.Height = 180;
            RichTextDisplay text = new RichTextDisplay(this.Width, 120, Owner.WM);

            text.SetText(Text);
            this.Controls.Add(text);
            switch (options)
            {
            case ButtonOptions.OKCancel:
            {
                Button okb = new Button("OK")
                {
                    Width  = 80,
                    Height = 20,
                    Y      = 120,
                    X      = (Width - 165) / 2
                };

                okb.OnClick += Okb_OnClick;
                AddControl(okb);
                Button cancelb = new Button("Cancel")
                {
                    Width  = 80,
                    Height = 20,
                    Y      = 120,
                    X      = (Width - 165) / 2 + 80
                };

                cancelb.OnClick += Cancelb_OnClick;
                AddControl(cancelb);

                break;
            }

            default:     //OKOnly
            {
                Button okb = new Button("OK")
                {
                    Width  = 60,
                    Height = 20,
                    Y      = 120,
                    X      = (Width - 60) / 2
                };

                okb.OnClick += Okb_OnClick;
                AddControl(okb);

                break;
            }
            }
        }
コード例 #4
0
        void AddButtonAtLocation(RectangleF location, ButtonOptions options, string title, float size)
        {
            UIButton button = new UIButton(location);

            Xamarin.Themes.BizappTheme.Apply(button, options);

            button.SetTitle(title, UIControlState.Normal);
            button.TitleLabel.Font = UIFont.BoldSystemFontOfSize(size);

            View.AddSubview(button);
        }
コード例 #5
0
        public void BuildUrlIsSandboxTest()
        {
            IOptions options = new ButtonOptions();

            string result = options.GetOptionString();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Contains("<image"));
            Assert.IsTrue(result.Contains("class=\"v-button\""));
            Assert.IsTrue(result.Contains(ButtonOptions.SandboxButtonUrl));
        }
コード例 #6
0
        private void SetButtons()
        {
            ButtonClose.Enabled    = CloseButtonEnabled;
            ButtonAutoHide.Visible = ShouldShowAutoHideButton;
            ButtonOptions.Visible  = HasTabPageContextMenu;
            ButtonClose.RefreshChanges();
            ButtonAutoHide.RefreshChanges();
            ButtonOptions.RefreshChanges();

            SetButtonsPosition();
        }
コード例 #7
0
        void AddButtonAtLocation(RectangleF location, ButtonOptions options, string title, float size)
        {
            UIButton button = new UIButton (location);

            Xamarin.Themes.BizappTheme.Apply (button, options);

            button.SetTitle (title, UIControlState.Normal);
            button.TitleLabel.Font = UIFont.BoldSystemFontOfSize (size);

            View.AddSubview (button);
        }
コード例 #8
0
        public void BuildUrlTest()
        {
            VisaHelper.Environment.IsSandbox = false;
            IOptions options = new ButtonOptions();

            string result = options.GetOptionString();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Contains("<image"));
            Assert.IsTrue(result.Contains("class=\"v-button\""));
            Assert.IsTrue(result.Contains(ButtonOptions.ProductionButtonUrl));
        }
コード例 #9
0
        private void SetButtons()
        {
            ButtonClose.Enabled    = CloseButtonEnabled;
            ButtonClose.Visible    = CloseButtonVisible;
            ButtonAutoHide.Visible = ShouldShowAutoHideButton;
            ButtonOptions.Visible  = HasTabPageContextMenu;
            if (!Win32Helper.IsRunningOnMono)
            {
                ButtonClose.RefreshChanges();
                ButtonAutoHide.RefreshChanges();
                ButtonOptions.RefreshChanges();
            }

            SetButtonsPosition();
        }
コード例 #10
0
        public void BuildUrlWithOptionsTest()
        {
            VisaHelper.Environment.IsSandbox = false;
            IOptions options = new ButtonOptions
            {
                CardBrands = SupportedCards.AMEX | SupportedCards.VISA,
                Color      = ButtonColors.Neutral,
                Size       = ButtonSizes.Large
            };

            string result = options.GetOptionString();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Contains("<image"));
            Assert.IsTrue(result.Contains("class=\"v-button\""));
            Assert.IsTrue(result.Contains(ButtonOptions.ProductionButtonUrl));
            Assert.IsTrue(result.Contains("cardBrands=VISA,AMEX"));
            Assert.IsTrue(result.Contains("color=neutral"));
            Assert.IsTrue(result.Contains("size=425"));
        }
コード例 #11
0
        public Task <bool> DisplayMessageBox(string title, string message, ButtonOptions buttonOptions = ButtonOptions.Ok)
        {
            bool res;

            switch (buttonOptions)
            {
            case ButtonOptions.OkCancel:
                res = MessageBox.Show(message, title, MessageBoxButton.OKCancel) == MessageBoxResult.OK;
                break;

            case ButtonOptions.YesNo:
                res = MessageBox.Show(message, title, MessageBoxButton.YesNo) == MessageBoxResult.Yes;
                break;

            default:
                res = MessageBox.Show(message, title, MessageBoxButton.OK) == MessageBoxResult.OK;
                break;
            }

            return(Task.FromResult(res));
        }
コード例 #12
0
    public void Start()
    {
        premio        = false;
        buttonOptions = GameObject.Find("ElCubo").GetComponent <ButtonOptions>();

        /*
         * rewardBasedVideo = null;
         * rewardBasedVideo = RewardBasedVideoAd.Instance;
         *
         * // Called when an ad request has successfully loaded.
         * rewardBasedVideo.OnAdLoaded += HandleRewardBasedVideoLoaded;
         * // Called when an ad request failed to load.
         * rewardBasedVideo.OnAdFailedToLoad += HandleRewardBasedVideoFailedToLoad;
         * // Called when an ad is shown.
         * rewardBasedVideo.OnAdOpening += HandleRewardBasedVideoOpened;
         * // Called when the ad starts to play.
         * rewardBasedVideo.OnAdStarted += HandleRewardBasedVideoStarted;
         */

        //RequestRewardBasedVideo();
        AdsReal();
    }
コード例 #13
0
ファイル: Helpers.cs プロジェクト: wesleywh/GameDevRepo
        public static string ModifiedText(ButtonOptions ReplaceActionWith, string textToReplace)
        {
            string button = "";

            switch (ReplaceActionWith)
            {
            case ButtonOptions.Backwards:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [1].negative.ToString().Replace("Alpha", "");
                break;

            case ButtonOptions.Forwards:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [1].positive.ToString().Replace("Alpha", "");
                break;

            case ButtonOptions.Left:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [0].negative.ToString().Replace("Alpha", "");
                break;

            case ButtonOptions.Right:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [0].positive.ToString().Replace("Alpha", "");
                break;

            case ButtonOptions.Submit:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [7].positive.ToString().Replace("Alpha", "");
                break;

            case ButtonOptions.Jump:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [6].positive.ToString().Replace("Alpha", "");
                break;

            case ButtonOptions.Run:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [9].positive.ToString().Replace("Alpha", "");
                break;

            case ButtonOptions.Close:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [17].positive.ToString().Replace("Alpha", "");
                break;

            case ButtonOptions.Action:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [10].positive.ToString().Replace("Alpha", "");
                break;

            case ButtonOptions.Inventory:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [11].positive.ToString().Replace("Alpha", "");
                break;

            case ButtonOptions.InventorySlot1:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [12].positive.ToString().Replace("Alpha", "");
                break;

            case ButtonOptions.InventorySlot2:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [13].positive.ToString().Replace("Alpha", "");
                break;

            case ButtonOptions.InventorySlot3:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [14].positive.ToString().Replace("Alpha", "");
                break;

            case ButtonOptions.InventorySlot4:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [15].positive.ToString().Replace("Alpha", "");
                break;

            case ButtonOptions.InventorySlot5:
                button = InputManager.GetInputConfiguration(PlayerID.One).axes [16].positive.ToString().Replace("Alpha", "");
                break;
            }

            return(textToReplace.Replace("<ACTION>", button));
        }
コード例 #14
0
        static ToolBar()
        {
            jQuery.OnDocumentReady(delegate() {
                jQuery.Select("#beginning")
                .Plugin <ButtonObject>()
                .Button(new ButtonOptions(ButtonOption.Text, false,
                                          ButtonOption.Icons, new ButtonOptions("primary", "ui-icon-seek-start")));

                jQuery.Select("#rewind")
                .Plugin <ButtonObject>()
                .Button(new ButtonOptions(ButtonOption.Text, false,
                                          ButtonOption.Icons, new ButtonOptions("primary", "ui-icon-seek-prev")));

                jQuery.Select("#play")
                .Plugin <ButtonObject>()
                .Button(new ButtonOptions(ButtonOption.Text, false,
                                          ButtonOption.Icons, new ButtonOptions("primary", "ui-icon-play")))
                .Click(new jQueryEventHandler(delegate(jQueryEvent e) {
                    ButtonOptions options;

                    if (jQuery.This.GetText() == "play")
                    {
                        options = new ButtonOptions(ButtonOption.Label, "pause",
                                                    ButtonOption.Icons, new ButtonOptions("primary", "ui-icon-pause"));
                    }
                    else
                    {
                        options = new ButtonOptions(ButtonOption.Label, "play",
                                                    ButtonOption.Icons, new ButtonOptions("primary", "ui-icon-play"));
                    }
                    jQuery.This
                    .Plugin <ButtonObject>()
                    .Button(ButtonMethod.Option, options);
                }));

                jQuery.Select("#stop")
                .Plugin <ButtonObject>()
                .Button(new ButtonOptions(ButtonOption.Text, false,
                                          ButtonOption.Icons, new ButtonOptions("primary", "ui-icon-stop")))
                .Click(new jQueryEventHandler(delegate(jQueryEvent e) {
                    jQuery.Select("#play")
                    .Plugin <ButtonObject>()
                    .Button(ButtonMethod.Option, new ButtonOptions(ButtonOption.Label, "play",
                                                                   ButtonOption.Icons, new ButtonOptions("primary", "ui-icon-play")));
                }));

                jQuery.Select("#forward")
                .Plugin <ButtonObject>()
                .Button(new ButtonOptions(ButtonOption.Text, false,
                                          ButtonOption.Icons, new ButtonOptions("primary", "ui-icon-seek-nex")));

                jQuery.Select("#end")
                .Plugin <ButtonObject>()
                .Button(new ButtonOptions(ButtonOption.Text, false,
                                          ButtonOption.Icons, new ButtonOptions("primary", "ui-icon-seek-end")));

                jQuery.Select("#shuffle")
                .Plugin <ButtonObject>()
                .Button();

                jQuery.Select("#repeat")
                .Plugin <ButtonSetObject>()
                .ButtonSet();
            });
        }
コード例 #15
0
///<summary>
///Creates a new instance of Button
///</summary>
public Button(JsString selector, ButtonOptions options)
{
Selector = J(selector);
Selector.button(options);
}
コード例 #16
0
        public static MvcHtmlString AddComponentFor <TModel, TValue>(
            this HtmlHelper <TModel> helper,
            Expression <Func <TModel, TValue> > addModelExpression,
            Expression <Func <TModel, IEnumerable <TValue> > > modelExpressionList,
            string partialListName,
            string addButtonID          = null,
            string containerListID      = null,
            ButtonOptions buttonOptions = null) where TValue : new()
        {
            if (!object.ReferenceEquals(helper, null))
            {
                TValue        model                   = new TValue();
                string        modelName               = model.GetType().Name;
                string        addTemplateName         = String.Format("{0}{1}{2}.cshtml", COMMON_PATH_EDITOR, "Add", modelName);
                StringBuilder addTemplate             = new StringBuilder(string.Empty);
                string        temp                    = string.Empty;
                string        htmlFieldPrefix         = ExpressionHelper.GetExpressionText(addModelExpression);
                string        htmlFieldPrefixControls = htmlFieldPrefix.Replace(".", String.Empty);
                string        _containerListID        = containerListID ?? String.Format("lst{0}", htmlFieldPrefixControls);
                string        _addButtonID            = addButtonID ?? String.Format("btnAdd{0}", htmlFieldPrefixControls);
                string        _addWrapperID           = String.Format("lblAdd{0}", htmlFieldPrefixControls);

                ViewDataDictionary viewData = new ViewDataDictionary()
                {
                    { "addButtonID", _addButtonID },
                    { "addWrapperID", _addWrapperID }
                };
                viewData.TemplateInfo = new TemplateInfo()
                {
                    HtmlFieldPrefix = htmlFieldPrefix
                };


                //verifica se existe view específica de inserção de acordo com o nome do tipo do model
                if (ViewExistis(helper, addTemplateName))
                {
                    temp = helper.Partial(addTemplateName, model, viewData).ToHtmlString();
                }
                else
                {
                    temp = helper.EditorFor(addModelExpression, viewData).ToHtmlString();
                }

                //if (!object.ReferenceEquals(buttonOptions, null))
                //{
                //    #region Add Button
                //    TagBuilder button = new TagBuilder(buttonOptions.TagName);
                //    button.Attributes.Add("id", buttonOptions.ID);
                //    button.Attributes.Add("class", buttonOptions.ClassName);
                //    button.MergeAttributes<string, object>(buttonOptions.buttonAttributes, false);
                //    #endregion

                //    #region Button Container
                //    TagBuilder container = new TagBuilder(buttonOptions.containerTagName);
                //    container.Attributes.Add("class", buttonOptions.containerButtonClassName);
                //    container.MergeAttributes<string, object>(buttonOptions.containerButtonAttributes, false);
                //    container.InnerHtml = button.ToString();
                //    #endregion

                //    string positionMark = (buttonOptions.Position == ButtonInsertPosition.After) ? "{0}{1}" : "{1}{0}";
                //    temp = String.Format(positionMark, temp, container.ToString());
                //}

                addTemplate.Append(temp);

                htmlFieldPrefix = ExpressionHelper.GetExpressionText(modelExpressionList);
                viewData        = new ViewDataDictionary()
                {
                    { "containerListID", _containerListID }
                };
                viewData.TemplateInfo = new TemplateInfo()
                {
                    HtmlFieldPrefix = htmlFieldPrefix
                };

                IEnumerable <TValue> items = modelExpressionList.Compile()(helper.ViewData.Model);
                if (!ReferenceEquals(items, null))
                {
                    addTemplate.Append(helper.Partial(partialListName, items, viewData).ToHtmlString());
                }

                return(new MvcHtmlString(addTemplate.ToString()));
            }
            return(MvcHtmlString.Empty);
        }
コード例 #17
0
ファイル: ButtonClose.cs プロジェクト: iletai/TowerDefense
 void Awake()
 {
     pressSound      = GetComponent <AudioSource>();
     classBtnOptions = BtnOptions.GetComponent <ButtonOptions>();
 }