private RebindDialog() : base(false, true)
        {
            stopwatch = new Stopwatch();
            menu      = new RebindHud(HudMain.HighDpiRoot)
            {
                Visible = false
            };

            blacklist = new List <int>
            {
                BindManager.GetControl("escape").Index,
            };

            SharedBinds.Escape.NewPressed += Exit;
        }
                /// <summary>
                /// Returns or modifies the group member associated with the given enum.
                /// </summary>
                private object GetOrSetMember(object data, int memberEnum)
                {
                    switch ((BindClientAccessors)memberEnum)
                    {
                    case BindClientAccessors.GetOrCreateGroup:
                        return(GetOrCreateGroup(data as string)?.Index ?? -1);

                    case BindClientAccessors.GetBindGroup:
                        return(GetBindGroup(data as string)?.Index ?? -1);

                    case BindClientAccessors.GetComboIndices:
                        return(BindManager.GetComboIndices(data as IReadOnlyList <string>));

                    case BindClientAccessors.GetControlByName:
                        return(BindManager.GetControl(data as string)?.Index ?? -1);

                    case BindClientAccessors.ClearBindGroups:
                        ClearBindGroups(); break;

                    case BindClientAccessors.Unload:
                        Unload(); break;

                    case BindClientAccessors.RequestBlacklistMode:
                    {
                        if (data != null)
                        {
                            RequestBlacklistMode = (SeBlacklistModes)data; break;
                        }
                        else
                        {
                            return(RequestBlacklistMode);
                        }
                    }
                    }

                    return(null);
                }
Exemplo n.º 3
0
 public ControlData(RichHudControls key)
 {
     index = BindManager.GetControl(key).Index;
 }
Exemplo n.º 4
0
 public ControlData(MyKeys key)
 {
     index = BindManager.GetControl(key).Index;
 }
 /// <summary>
 /// Retrieves the control with the given name
 /// </summary>
 public IControl GetControl(string name) =>
 BindManager.GetControl(name);