private void add_filter_color_actions(List<action> actions, string prefix, bool_func color, bool_func match_color, bool_func no_color = null) { if ( no_color != null) actions.Add(new action { category = "Filter/" + prefix, name = "Default Color", on_click = () => no_color() }); actions.Add(new action { category = "Filter/" + prefix, name = "Color the Full Line", on_click = () => color() }); actions.Add(new action { category = "Filter/" + prefix, name = "Match Color (color only what matches)", on_click = () => match_color() }); if (!parent_.lv_parent.global_ui_copy.show_filter) { if ( no_color != null) actions.Add(new action {category = "Filter/" + prefix, name = "Default Color + Take Me to Edit", on_click = () => { // note: the user can cancel on the color dialog if ( no_color()) parent_.lv_parent.simple_action(simple_action.edit_last_filter); } }); actions.Add(new action {category = "Filter/" + prefix, name = "Color the Full Line + Take Me to Edit", on_click = () => { // note: the user can cancel on the color dialog if ( color()) parent_.lv_parent.simple_action(simple_action.edit_last_filter); } }); actions.Add(new action {category = "Filter/" + prefix, name = "Match Color (color only what matches) + Take Me to Edit", on_click = () => { // note: the user can cancel on the color dialog if (match_color()) parent_.lv_parent.simple_action(simple_action.edit_last_filter); }}); } }
private void add_filter_color_actions(List <action> actions, string prefix, bool_func color, bool_func match_color, bool_func no_color = null) { if (no_color != null) { actions.Add(new action { category = "Filter/" + prefix, name = "Default Color", on_click = () => no_color() }); } actions.Add(new action { category = "Filter/" + prefix, name = "Color the Full Line", on_click = () => color() }); actions.Add(new action { category = "Filter/" + prefix, name = "Match Color (color only what matches)", on_click = () => match_color() }); if (!parent_.lv_parent.global_ui_copy.show_filter) { if (no_color != null) { actions.Add(new action { category = "Filter/" + prefix, name = "Default Color + Take Me to Edit", on_click = () => { // note: the user can cancel on the color dialog if (no_color()) { parent_.lv_parent.simple_action(simple_action.edit_last_filter); } } }); } actions.Add(new action { category = "Filter/" + prefix, name = "Color the Full Line + Take Me to Edit", on_click = () => { // note: the user can cancel on the color dialog if (color()) { parent_.lv_parent.simple_action(simple_action.edit_last_filter); } } }); actions.Add(new action { category = "Filter/" + prefix, name = "Match Color (color only what matches) + Take Me to Edit", on_click = () => { // note: the user can cancel on the color dialog if (match_color()) { parent_.lv_parent.simple_action(simple_action.edit_last_filter); } } }); } }
/// <summary> /// Returns a return code equivalent to the test /// -Returns Success if true /// -Returns Failure if false /// </summary> /// <param name="test">the value to be tested</param> public Conditional(bool_func test) { _bool = test; }