Example #1
0
        void CreateJoinPanel()
        {
            try
            {
                var newGamePanel = GameObject.Find("(Library) NewGamePanel");

                if (newGamePanel.GetComponent <NewGamePanel>() != null)
                {
                    GameObject.Destroy(newGamePanel.GetComponent <NewGamePanel>());
                }
                if (newGamePanel.GetComponent <JoinPanel>() == null)
                {
                    newGamePanel.AddComponent <JoinPanel>();
                }
                newGamePanel.transform.Find("Caption").Find("Label").GetComponent <UILabel>().text = "Join Game";
                newGamePanel.transform.Find("Start").GetComponent <UIButton>().text = "Join";
                newGamePanel.transform.Find("Start").GetComponent <BindEvent>().Unbind();
                BindingReference re2 = new BindingReference();
                re2.component  = newGamePanel.GetComponent <JoinPanel>();
                re2.memberName = "OnStartNewGame";
                newGamePanel.transform.Find("Start").GetComponent <BindEvent>().dataTarget = re2;
                newGamePanel.transform.Find("Start").GetComponent <BindEvent>().Bind();
            }
            catch (Exception)
            {
                throw new Exception("Coulden't change the join panel.");
            }
        }
Example #2
0
        void CreateHostPanel()
        {
            try
            {
                var loadPanel = GameObject.Find("(Library) LoadPanel");

                if (loadPanel.GetComponent <LoadPanel>() != null)
                {
                    GameObject.Destroy(loadPanel.GetComponent <LoadPanel>());
                }
                if (loadPanel.GetComponent <HostPanel>() == null)
                {
                    loadPanel.AddComponent <HostPanel>();
                }
                loadPanel.transform.Find("Caption").Find("Label").GetComponent <UILabel>().text = "Host Game";
                loadPanel.transform.Find("Load").GetComponent <UIButton>().text = "Host";
                loadPanel.transform.Find("Load").GetComponent <BindEvent>().Unbind();
                BindingReference re = new BindingReference();
                re.component  = loadPanel.GetComponent <HostPanel>();
                re.memberName = "OnLoad";
                loadPanel.transform.Find("Load").GetComponent <BindEvent>().dataTarget = re;
                loadPanel.transform.Find("Load").GetComponent <BindEvent>().Bind();
            }
            catch (Exception)
            {
                throw new Exception("Coulden't change the host panel.");
            }
        }
Example #3
0
        /// <inheritdoc/>
        public override object AddValueChangedHandler(object dataItem, EventHandler <EventArgs> handler)
        {
            var reference = new BindingReference();

            reference.owner    = this;
            reference.dataItem = dataItem;
            reference.handler  = handler;
            var childItem = _parent.GetValue(dataItem);

            reference.parentReference = _parent.AddValueChangedHandler(dataItem, reference.ValueChanged);
            reference.childReference  = _child.AddValueChangedHandler(childItem, handler);
            return(reference);
        }
        public BindingDisplay(string binding)
        {
            Binding = BindingReference.FromString(binding);

            var bindingCommand = new Command();

            bindingCommand.Executed += async(sender, e) =>
            {
                var dialog = new BindingEditorDialog(Binding);
                Binding = await dialog.ShowModalAsync(this);
            };
            this.Command = bindingCommand;

            this.MouseDown += async(s, e) =>
            {
                if (e.Buttons.HasFlag(MouseButtons.Alternate))
                {
                    var dialog = new AdvancedBindingEditorDialog(Binding);
                    Binding = await dialog.ShowModalAsync(this);
                }
            };
        }
Example #5
0
        void CreateJoinPanel()
        {
            try
            {
                var newGamePanel = GameObject.Find("(Library) NewGamePanel");

                if (newGamePanel.GetComponent<NewGamePanel>() != null)
                    GameObject.Destroy(newGamePanel.GetComponent<NewGamePanel>());
                if (newGamePanel.GetComponent<JoinPanel>() == null)
                    newGamePanel.AddComponent<JoinPanel>();
                newGamePanel.transform.Find("Caption").Find("Label").GetComponent<UILabel>().text = "Join Game";
                newGamePanel.transform.Find("Start").GetComponent<UIButton>().text = "Join";
                newGamePanel.transform.Find("Start").GetComponent<BindEvent>().Unbind();
                BindingReference re2 = new BindingReference();
                re2.component = newGamePanel.GetComponent<JoinPanel>();
                re2.memberName = "OnStartNewGame";
                newGamePanel.transform.Find("Start").GetComponent<BindEvent>().dataTarget = re2;
                newGamePanel.transform.Find("Start").GetComponent<BindEvent>().Bind();
            }
            catch (Exception)
            {
                throw new Exception("Coulden't change the join panel.");
            }
        }
Example #6
0
        void CreateHostPanel()
        {
            try
            {
                var loadPanel = GameObject.Find("(Library) LoadPanel");

                if (loadPanel.GetComponent<LoadPanel>() != null)
                    GameObject.Destroy(loadPanel.GetComponent<LoadPanel>());
                if (loadPanel.GetComponent<HostPanel>() == null)
                    loadPanel.AddComponent<HostPanel>();
                loadPanel.transform.Find("Caption").Find("Label").GetComponent<UILabel>().text = "Host Game";
                loadPanel.transform.Find("Load").GetComponent<UIButton>().text = "Host";
                loadPanel.transform.Find("Load").GetComponent<BindEvent>().Unbind();
                BindingReference re = new BindingReference();
                re.component = loadPanel.GetComponent<HostPanel>();
                re.memberName = "OnLoad";
                loadPanel.transform.Find("Load").GetComponent<BindEvent>().dataTarget = re;
                loadPanel.transform.Find("Load").GetComponent<BindEvent>().Bind();
            }
            catch (Exception)
            {
                throw new Exception("Coulden't change the host panel.");
            }
        }