예제 #1
0
            public void OpenMenu()
            {
                if (!IsOpen)
                {
                    CloseMenu();
                    UpdateConfig();

                    for (int i = 0; i < Target.BlockMembers.Count; i++)
                    {
                        IBlockMember blockMember = Target.BlockMembers[i];

                        if (blockMember is IBlockColor)
                        {
                            // Assign an entry for each color channel
                            var colorMember = blockMember as IBlockColor;
                            var entry       = entryPool.Get();
                            entry.SetMember(Target, colorMember.ColorChannels[0], i);
                            listBody.Add(entry);

                            entry = entryPool.Get();
                            entry.SetMember(Target, colorMember.ColorChannels[1], i);
                            listBody.Add(entry);

                            entry = entryPool.Get();
                            entry.SetMember(Target, colorMember.ColorChannels[2], i);
                            listBody.Add(entry);
                        }
                        else if (blockMember is IBlockColorHSV)
                        {
                            // Assign an entry for each color channel
                            var colorMember = blockMember as IBlockColorHSV;
                            var entry       = entryPool.Get();
                            entry.SetMember(Target, colorMember.ColorChannels[0], i);
                            listBody.Add(entry);

                            entry = entryPool.Get();
                            entry.SetMember(Target, colorMember.ColorChannels[1], i);
                            listBody.Add(entry);

                            entry = entryPool.Get();
                            entry.SetMember(Target, colorMember.ColorChannels[2], i);
                            listBody.Add(entry);
                        }
                        else
                        {
                            var entry = entryPool.Get();
                            entry.SetMember(Target, blockMember, i);
                            listBody.Add(entry);
                        }
                    }

                    listWrapTimer.Restart();
                    IsOpen           = true;
                    peekBody.Visible = false;
                    listBody.Visible = true;
                }

                Visible = true;
            }
예제 #2
0
                    /// <summary>
                    /// Creates and returns a new control root with the name given.
                    /// </summary>
                    public ModControlRoot AddModRoot(string clientName)
                    {
                        ModControlRoot modSettings = new ModControlRoot()
                        {
                            Name = clientName
                        };

                        scrollBox.Add(modSettings);

                        return(modSettings);
                    }
예제 #3
0
                /// <summary>
                /// Updates bind controls.
                /// </summary>
                private void UpdateBindGroup()
                {
                    if (BindGroup != null)
                    {
                        name.Text = $"Group: {BindGroup.Name}";

                        for (int n = 0; n < BindGroup.Count; n++)
                        {
                            if (scrollBox.Collection.Count == n)
                            {
                                scrollBox.Add(new BindBox());
                            }

                            scrollBox.Collection[n].Enabled = true;
                            scrollBox.Collection[n].Element.SetBind(BindGroup[n], BindGroup);
                        }
                    }
                }
 public void Add(TMember tile)
 {
     scrollBox.Add(tile);
 }