MCPcopy
hub / github.com/lxn/walk / SetVisibleCondition

Method SetVisibleCondition

action.go:417–437  ·  view source on GitHub ↗
(c Condition)

Source from the content-addressed store, hash-verified

415}
416
417func (a *Action) SetVisibleCondition(c Condition) {
418 if a.visibleCondition != nil {
419 a.visibleCondition.Changed().Detach(a.visibleConditionChangedHandle)
420 }
421
422 a.visibleCondition = c
423
424 if c != nil {
425 a.visible = c.Satisfied()
426
427 a.visibleConditionChangedHandle = c.Changed().Attach(func() {
428 if a.visible != c.Satisfied() {
429 a.visible = !a.visible
430
431 a.raiseVisibleChanged()
432 }
433 })
434 }
435
436 a.raiseChanged()
437}
438
439func (a *Action) Triggered() *Event {
440 return a.triggeredPublisher.Event()

Callers 1

releaseMethod · 0.95

Calls 6

raiseVisibleChangedMethod · 0.95
raiseChangedMethod · 0.95
ChangedMethod · 0.65
SatisfiedMethod · 0.65
DetachMethod · 0.45
AttachMethod · 0.45

Tested by

no test coverage detected