Ejemplo n.º 1
0
        public string FilterValue(ActiveField <decimal?> field, string displayValue)
        {
            var    url  = "?filter=" + Web.Server.UrlEncode(field.ValueObject + "") + "&filterCol=" + FilterAlias + "[" + field.Name + "]";
            string html = "<a href=\"" + url + "\" title=\"show only this value\">" + displayValue.HtmlEncode() + "</a>";

            return(html);
        }
    protected internal override IEnumerator RespondToCommandInternal(string inputCommand)
    {
        inputCommand = inputCommand.Trim();
        if (!inputCommand.Equals("status", StringComparison.InvariantCultureIgnoreCase))
        {
            yield break;
        }

        bool active = (bool)ActiveField.GetValue(_component);

        IRCConnection.SendMessage("Motion Sense Status: " + (active ? "Active for " + (int)_needy.GetNeedyTimeRemaining() + " seconds" : "Inactive"));
    }
Ejemplo n.º 3
0
        void ToPanel(ActiveField activeField)
        {
            if (activeField == ActiveField.Details)
            {
                //Change Panel Location
                pnlFirstFields.Location  = ActiveFieldLocation;
                pnlSecondFields.Location = InActiveFieldLocation;
            }
            else if (activeField == ActiveField.SecurityOrInsights)
            {
                //Change Panel Location
                pnlFirstFields.Location  = InActiveFieldLocation;
                pnlSecondFields.Location = ActiveFieldLocation;

                //Rearrange Panel
                ReArrangePanel(true);
            }
        }
Ejemplo n.º 4
0
    private void OnWarriorDeath(Unit sender)
    {
        int index = -1;

        for (int i = 0; i < ActiveField.childCount; i++)
        {
            if (ActiveField.GetChild(i).gameObject.GetComponent <WarriorCardVM>().Name.text == sender.Name)
            {
                index = i;
                break;
            }
        }
        if (index != -1)
        {
            Debug.Log($"{sender.ToString()} is dead");
            Destroy(ActiveField.GetChild(index).gameObject);
            Game.ActiveWarriors.Remove(sender as Warrior);
        }
    }
        void SelectScore()
        {
            activeField = ActiveField.Score;
            backgroundViewConfirm.Hidden = true;
            backgroundViewKeyPad.Hidden = false;

            playerLabel.TextColor = UIColor.FromRGB(84, 164, 224);
            gameLabel.TextColor = UIColor.FromRGB(84, 164, 224);
            scoreLabel.TextColor = UIColor.White;
            scoreNumberLabel.Hidden = true;

            if (PlayerNumber.HasValue) {
                playerNumberLabel.Hidden = false;
                playerNameLabel.Hidden = false;
            }
            if (GameNumber.HasValue) {
                gameNumberLabel.Hidden = false;
                gameNameLabel.Hidden = false;
            }

            inputField.Frame = new CGRect (inputField.Frame.X, scoreLabel.Frame.Y, 300, inputField.Frame.Height);
            if (ScoreValue.HasValue)
                inputField.Text = ScoreValue.Value.ToString("N0", CultureInfo.GetCultureInfo("nl-BE"));
            else
                inputField.Text = string.Empty;
            inputField.Hidden = false;
        }
        void SelectPlayer()
        {
            activeField = ActiveField.Player;
            backgroundViewToken.Hidden = true;
            backgroundViewConfirm.Hidden = true;
            backgroundViewKeyPad.Hidden = false;
            savedLabel.Hidden = true;

            playerLabel.TextColor = UIColor.White;
            gameLabel.TextColor = UIColor.FromRGB(84, 164, 224);
            scoreLabel.TextColor = UIColor.FromRGB(84, 164, 224);
            playerNumberLabel.Hidden = true;
            playerNameLabel.Hidden = true;

            if (GameNumber.HasValue) {
                gameNumberLabel.Hidden = false;
                gameNameLabel.Hidden = false;
            }
            if (ScoreValue.HasValue) {
                scoreNumberLabel.Hidden = false;
            }

            inputField.Frame = new CGRect (inputField.Frame.X, playerLabel.Frame.Y, 100, inputField.Frame.Height);
            inputField.Text = string.Empty;
            inputField.Hidden = false;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            BTProgressHUD.Dismiss ();

            activeField = ActiveField.Player;
            Round = AppDelegate.Self.ApiClient.Get (new GetRound { Id = AppDelegate.Self.CurrentRoundId });
            Machines = AppDelegate.Self.ApiClient.Get (new GetMachinesInRound { Id = Round.Id });
            if (Machines.Count == 0)
                AppDelegate.Self.ShowModalAlertViewAsync ("No games found.");

            _backgroundViewHeight = UIScreen.MainScreen.Bounds.Height;
            _backgroundViewWidth = UIScreen.MainScreen.Bounds.Width;

            labelh = 50.0f;

            nfloat labelx = 70;
            nfloat labely = 120;

            playerLabel = new UILabel {
                Text = "Player",
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.White,
                Font = UIFont.FromName ("Arial", 16F),
                Frame = new CGRect(labelx, labely, _backgroundViewWidth - labelx, labelh),
                UserInteractionEnabled = true
            };
            playerLabel.AddGestureRecognizer (
                new UITapGestureRecognizer (() => {
                    setFocus(playerLabel);
                }));

            playerNumberLabel = new UILabel {
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(84, 164, 224),
                Font = UIFont.FromName ("Arial-BoldMT", 35F),
                Frame = new CGRect((_backgroundViewWidth / 2) - 130, labely, 100, labelh),
                Hidden = true
            };
            playerNameLabel = new UILabel {
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(84, 164, 224),
                Font = UIFont.FromName ("Arial", 16F),
                Frame = new CGRect((_backgroundViewWidth / 2) - 20, labely, 400, labelh),
                Hidden = true
            };

            inputField = new UITextField
            {
                Placeholder = "|",
                BackgroundColor = UIColor.FromRGB(41, 57, 69),
                TextColor = UIColor.White,
                Font = UIFont.FromName ("Arial", 30F),
                BorderStyle = UITextBorderStyle.RoundedRect,
                Frame = new CGRect((_backgroundViewWidth / 2) - 130, labely, 100, labelh),
                UserInteractionEnabled = false,
                TextAlignment = UITextAlignment.Center
            };

            labely += 140;
            gameLabel = new UILabel {
                Text = "Game",
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(84, 164, 224),
                Font = UIFont.FromName ("Arial", 16f),
                Frame = new CGRect(labelx, labely, _backgroundViewWidth - labelx, labelh),
                UserInteractionEnabled = true
            };
            gameLabel.AddGestureRecognizer (
                new UITapGestureRecognizer (() => {
                    setFocus(gameLabel);
                }));

            gameNumberLabel = new UILabel {
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(84, 164, 224),
                Font = UIFont.FromName ("Arial-BoldMT", 35F),
                Frame = new CGRect((_backgroundViewWidth / 2) - 130, labely, 100, labelh),
                Hidden = false
            };
            gameNameLabel = new UILabel {
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(84, 164, 224),
                Font = UIFont.FromName ("Arial", 16F),
                Frame = new CGRect((_backgroundViewWidth / 2) - 20, labely, 400, labelh),
                Hidden = false
            };

            labely += 140;
            scoreLabel = new UILabel {
                Text = "Score",
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(84, 164, 224),
                Font = UIFont.FromName ("Arial", 16f),
                Frame = new CGRect(labelx, labely, _backgroundViewWidth - labelx, labelh),
                UserInteractionEnabled = true
            };
            scoreLabel.AddGestureRecognizer (
                new UITapGestureRecognizer (() => {
                    setFocus(scoreLabel);
                }));

            scoreNumberLabel = new UILabel {
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(84, 164, 224),
                Font = UIFont.FromName ("Arial-BoldMT", 35F),
                Frame = new CGRect((_backgroundViewWidth / 2) - 130, labely, 300, labelh),
                Hidden = true
            };

            labely += 100;
            savedLabel = new UILabel {
                BackgroundColor = UIColor.Clear,
                TextColor = UIColor.FromRGB(48, 202, 102),
                Text = "Score submitted successfully",
                Font = UIFont.FromName ("Arial", 16F),
                Frame = new CGRect((_backgroundViewWidth / 2) - 130, labely, 300, labelh),
                Hidden = true
            };

            View.AddSubview(playerLabel);
            View.AddSubview(playerNumberLabel);
            View.AddSubview(playerNameLabel);
            View.AddSubview(gameLabel);
            View.AddSubview(gameNumberLabel);
            View.AddSubview(gameNameLabel);
            View.AddSubview(scoreLabel);
            View.AddSubview(scoreNumberLabel);
            View.AddSubview(savedLabel);
            View.AddSubview(inputField);

            drawButtons ();

            if (InterfaceOrientation == UIInterfaceOrientation.LandscapeLeft || InterfaceOrientation == UIInterfaceOrientation.LandscapeRight)
            {
                _heightFix = View.Bounds.Width;
                DidRotate (UIInterfaceOrientation.Portrait);
            }
        }
Ejemplo n.º 8
0
 public string FilterValue(ActiveField <decimal?> field)
 {
     return(FilterValue(field, field.ValueObject + ""));
 }