Beispiel #1
0
	virtual bool UpdateFromParentTime (TimeSpan parentTime)
	{
		bool rv = Clock::UpdateFromParentTime (parentTime);

		bool children_rv = false;
		for (GList *l = child_clocks; l; l = l->next) {
			Clock *clock = (Clock*)l->data;
			children_rv = clock->UpdateFromParentTime (current_time) || children_rv;
		}

		return rv && children_rv;
	}
Beispiel #2
0
bool
ClockGroup::UpdateFromParentTime (TimeSpan parentTime)
{
	// we need to cache this here because
	// Clock::UpdateFromParentTime will be updating it for the
	// next tick.
	ClockState current_state = GetClockState();

	/* likewise, we need to cache this here since
	   Clock::UpdateFromParentTime will clear it */
	bool seeking = GetIsSeeking();

	bool rv = Clock::UpdateFromParentTime (parentTime);

	// ClockGroups (which correspond to storyboards generally)
	// only cause their children to update (and therefore for
	// animations to hold/progress their value) if they are
	// active, or if they've had Seek called on them.
	//
	// but it also happens when the clockgroup is in the Filling
	// state.  This means that you can attach a handler to
	// Storyboard.Completed and inside the handler modify a
	// property that an animation under that storyboard was
	// targetting.  and the new setting isnt clobbered by the
	// animation like it would be if the storyboard was active.

	bool update_child_clocks = (current_state == Clock::Active || seeking);

	for (GList *l = child_clocks; l; l = l->next) {
		Clock *clock = (Clock*)l->data;
		if (update_child_clocks || clock->Is(Type::CLOCKGROUP))
			rv = clock->UpdateFromParentTime (current_time) || rv;
	}

	return rv;
}