예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="target"></param>
        /// <param name="skipDisplayList"></param>
        public void ValidateClient(InvalidationManagerClient target, bool skipDisplayList = false)
        {
            InvalidationManagerClient lastCurrentObject = _currentObject;

            int oldTargetLevel = _targetLevel;

            if (MaxHDepth == _targetLevel)
            {
                _targetLevel = target.NestLevel;
            }

            _done = false;

            while (!_done)
            {
                // assume we won't find anything
                _done = true;

                /**
                 * 1) Validate properties
                 * */
                _propertyInvalidator.ValidateClient(target, ref _currentObject);

                /**
                 * 2) Validate size
                 * */
                //InvalidationHelper.Log("## Validate size", target);
                _sizeInvalidator.ValidateClient(target, ref _currentObject);

                /**
                 * 3) Validate display list
                 * */
                if (!skipDisplayList)
                {
                    _displayListInvalidator.ValidateClient(target, ref _currentObject);
                }

                /**
                 * 4) Validate transforms
                 * */
                _transformInvalidator.ValidateClient(target, ref _currentObject);                 // moved 20130807

                /**
                 * 5) Validate events
                 * */
                _eventInvalidator.ValidateClient(target, ref _currentObject);
            }

            if (MaxHDepth == oldTargetLevel)
            {
                _targetLevel = MaxHDepth;
                if (!skipDisplayList)
                {
                    _obj = _updateCompleteQueue.RemoveLargestChild(target);
                    while (null != _obj)
                    {
                        if (!_obj.Initialized)
                        {
                            _obj.Initialized = true;
                        }

                        if (_obj.HasEventListener(FrameworkEvent.UPDATE_COMPLETE))
                        {
                            _obj.DispatchEvent(new FrameworkEvent(FrameworkEvent.UPDATE_COMPLETE));
                        }
                        _obj.UpdateFlag = false;
                        _obj            = _updateCompleteQueue.RemoveLargestChild(target);
                    }
                }
            }

            _currentObject = lastCurrentObject;
        }
예제 #2
0
        //private int _measureCount;
        private void DoValidate()
        {
            if (_propertyInvalidator.Invalid)
            {
                _propertyInvalidator.Validate(ref _currentObject);
            }

            if (_sizeInvalidator.Invalid)
            {
                //Debug.Log("_styleInvalidator.Invalid: " + _styleInvalidator.Invalid);
                //Debug.Log("*** Measuring: " + _measureCount++);
                _sizeInvalidator.Validate(ref _currentObject);
            }

            if (_displayListInvalidator.Invalid)
            {
                _displayListInvalidator.Validate(ref _currentObject);
            }

            if (_transformInvalidator.Invalid)
            {
                _transformInvalidator.Validate(ref _currentObject);
            }

            if (_eventInvalidator.Invalid)
            {
                _eventInvalidator.Validate(ref _currentObject);
            }

            if (_propertyInvalidator.Invalid ||
                _transformInvalidator.Invalid ||
                _sizeInvalidator.Invalid ||
                _displayListInvalidator.Invalid ||
                _eventInvalidator.Invalid)
            {
                // do nothing (attachListeners(systemManager);)
            }
            else
            {
                InvalidationManagerClient obj = _updateCompleteQueue.RemoveLargest();
                while (null != obj)
                {
                    if (!obj.Initialized /* && obj.InternalStructureBuilt*/)
                    {
#if DEBUG
                        {
                            if (DebugMode)
                            {
                                InvalidationHelper.Log("Creation complete", obj);
                            }
                        }
#endif
                        // Most important: setting the initialized property here
                        // after all the initial VALIDATION cycles
                        obj.Initialized = true;
                    }
                    if (obj.HasEventListener(FrameworkEvent.UPDATE_COMPLETE))
                    {
                        obj.DispatchEvent(new FrameworkEvent(FrameworkEvent.UPDATE_COMPLETE));
                    }
                    obj.UpdateFlag = false;
                    obj            = _updateCompleteQueue.RemoveLargest();
                }

                //Debug.Log("updateComplete");

                /**
                 * We are emmiting the update complete signal here
                 * The listeners of this signal are connected for one shot only
                 * They internally reset their ForceLayout flags etc.
                 * */
                UpdateCompleteSignal.Emit();
            }
        }
예제 #3
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="target"></param>
		/// <param name="skipDisplayList"></param>
		public void ValidateClient(InvalidationManagerClient target, bool skipDisplayList = false)
		{
			InvalidationManagerClient lastCurrentObject = _currentObject;
			
			int oldTargetLevel = _targetLevel;

			if (MaxHDepth == _targetLevel)
				_targetLevel = target.NestLevel;

			_done = false;

			while (!_done)
			{
				// assume we won't find anything
				_done = true;

				/**
				 * 1) Validate properties
				 * */
				_propertyInvalidator.ValidateClient(target, ref _currentObject);

				/**
				 * 2) Validate size
				 * */
				//InvalidationHelper.Log("## Validate size", target);
				_sizeInvalidator.ValidateClient(target, ref _currentObject);

				/**
				 * 3) Validate display list
				 * */
				if (!skipDisplayList)
					_displayListInvalidator.ValidateClient(target, ref _currentObject);

				/**
				 * 4) Validate transforms
				 * */
				_transformInvalidator.ValidateClient(target, ref _currentObject); // moved 20130807

				/**
				 * 5) Validate events
				 * */
				_eventInvalidator.ValidateClient(target, ref _currentObject);
			}

			if (MaxHDepth == oldTargetLevel)
			{
				_targetLevel = MaxHDepth;
				if (!skipDisplayList)
				{
					_obj = _updateCompleteQueue.RemoveLargestChild(target);
					while (null != _obj)
					{
						if (!_obj.Initialized)
							_obj.Initialized = true;

						if (_obj.HasEventListener(FrameworkEvent.UPDATE_COMPLETE))
							_obj.DispatchEvent(new FrameworkEvent(FrameworkEvent.UPDATE_COMPLETE));
						_obj.UpdateFlag = false;
						_obj = _updateCompleteQueue.RemoveLargestChild(target);
					}
				}
			}

			_currentObject = lastCurrentObject;
		}