Exemple #1
0
        /// <summary>
        /// Adds a new <see cref="PreferencesMenuItem"/> to the list.
        /// </summary>
        /// <param name="click">The action invoked when the item is clicked.</param>
        public void AddPreferencesItem(Action <IntPtr> click = null)
        {
            PreferencesMenuItem item = new PreferencesMenuItem(LibuiLibrary.uiMenuAppendPreferencesItem(Handle.DangerousGetHandle()));

            if (click != null)
            {
                item.Clicked += (sender, args) =>
                {
                    if (args != null)
                    {
                        click(args.Data);
                    }
                };
            }
            Items.Add(item);
        }
Exemple #2
0
        /// <summary>
        /// Adds a new <see cref="PreferencesMenuItem"/> to the list.
        /// </summary>
        /// <param name="click">The action invoked when the item is clicked.</param>
        public void AddPreferencesItem(Action <IntPtr> click = null)
        {
            PreferencesMenuItem item = new PreferencesMenuItem(Libui.uiMenuAppendPreferencesItem(this));

            if (click != null)
            {
                item.Clicked += (sender, args) =>
                {
                    if (args != null)
                    {
                        click(args.Data);
                    }
                };
            }
            Items.Add(item);
        }