Example #1
0
void
ClockGroup::Stop ()
{
	for (GList *l = child_clocks; l; l = l->next) {
		Clock *clock = (Clock*)l->data;

		if (timemanager_clockgroup || !clock->Is(Type::CLOCKGROUP)) {
			// we don't stop sub-clock groups, since if we
			// nest storyboards under one another they
			// seem to behave independent of each other
			// from this perspective.
			((Clock*)l->data)->Stop ();
		}
	}

	Clock::Stop ();
}
Example #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;
}