public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            if ((versionChangeType & VersionChangeType.ViewData) != VersionChangeType.ViewData)
            {
                return;
            }

            ++m_Version;

            m_UpdateList.Add(ve);
            PropagateToParents(ve);
        }
Пример #2
0
        private void UpdateSubTree(VisualElement ve, int currentLayoutPass)
        {
            Rect yogaRect    = new Rect(ve.yogaNode.LayoutX, ve.yogaNode.LayoutY, ve.yogaNode.LayoutWidth, ve.yogaNode.LayoutHeight);
            Rect lastRect    = ve.lastLayout;
            bool rectChanged = false;

            VersionChangeType changeType = 0;

            // If the last layout rect is different than the current one we must dirty transform on children
            if ((lastRect.width != yogaRect.width) || (lastRect.height != yogaRect.height))
            {
                changeType |= VersionChangeType.Size | VersionChangeType.Repaint;
                rectChanged = true;
            }
            if (yogaRect.position != lastRect.position)
            {
                changeType |= VersionChangeType.Transform;
                rectChanged = true;
            }

            if (changeType != 0)
            {
                ve.IncrementVersion(changeType);
            }

            ve.lastLayout = yogaRect;

            // ignore clean sub trees
            bool hasNewLayout = ve.yogaNode.HasNewLayout;

            if (hasNewLayout)
            {
                for (int i = 0; i < ve.hierarchy.childCount; ++i)
                {
                    UpdateSubTree(ve.hierarchy[i], currentLayoutPass);
                }
            }

            if (rectChanged)
            {
                using (var evt = GeometryChangedEvent.GetPooled(lastRect, yogaRect))
                {
                    evt.layoutPass = currentLayoutPass;
                    evt.target     = ve;
                    ve.SendEvent(evt);
                }
            }

            if (hasNewLayout)
            {
                ve.yogaNode.MarkLayoutSeen();
            }
        }
Пример #3
0
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            if ((versionChangeType & (VersionChangeType.Layout | VersionChangeType.Hierarchy)) == 0)
            {
                return;
            }

            var yogaNode = ve.yogaNode;

            if (yogaNode != null && yogaNode.IsMeasureDefined)
            {
                yogaNode.MarkDirty();
            }
        }
        private void ExperimentalPackageValidateApiDiffs(ApiDiff diff, VersionChangeType changeType)
        {
            if (diff.breakingChanges > 0 && changeType == VersionChangeType.Patch)
            {
                AddError("For Experimental or Preview Packages, breaking changes require a new minor version.");
            }

            if (changeType == VersionChangeType.Patch)
            {
                foreach (var assembly in diff.missingAssemblies)
                {
                    AddError("Assembly \"{0}\" no longer exists or is no longer included in build. For Experimental or Preview Packages, this change requires a new minor version.", assembly);
                }
            }
        }
Пример #5
0
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            base.OnVersionChanged(ve, versionChangeType);

            if ((versionChangeType & VersionChangeType.Bindings) == VersionChangeType.Bindings)
            {
                if (GetUpdaterFromElement(ve) != null)
                {
                    StartTracking(ve);
                }
                else
                {
                    StopTracking(ve);
                }
            }
        }
Пример #6
0
        public void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
#if UNITY_EDITOR
            for (int i = 0; i < (int)VisualTreeEditorUpdatePhase.Count; i++)
            {
                var updater = m_EditorUpdaterArray[i];
                updater.OnVersionChanged(ve, versionChangeType);
            }
#endif

            for (int i = 0; i < (int)VisualTreeUpdatePhase.Count; i++)
            {
                var updater = m_UpdaterArray[i];
                updater.OnVersionChanged(ve, versionChangeType);
            }
        }
Пример #7
0
        public async Task StoreData(ExecutionContext executionContext, Guid providerDefinitionId, string containerName,
                                    string correlationId, DateTimeOffset timestamp, VersionChangeType changeType,
                                    IDictionary <string, object> data)
        {
            try
            {
                var dataToUse = new Dictionary <string, object>(data);
                if (StreamMode == StreamMode.EventStream)
                {
                    dataToUse.Add(TimestampFieldName, timestamp);
                    dataToUse.Add(ChangeTypeFieldName, changeType.ToString());
                    dataToUse.Add(CorrelationIdFieldName, correlationId);
                }
                else
                {
                    dataToUse.Add(TimestampFieldName, timestamp);
                }

                var config = await base.GetAuthenticationDetails(executionContext, providerDefinitionId);

                // feature start here

                var feature = _features.GetFeature <IBuildStoreDataFeature>();
                IEnumerable <PostgreSqlConnectorCommand> commands;
                if (feature is IBuildStoreDataForMode modeFeature)
                {
                    commands = modeFeature.BuildStoreDataSql(containerName, dataToUse, _defaultKeyFields, StreamMode,
                                                             correlationId, _logger);
                }
                else
                {
                    commands = feature.BuildStoreDataSql(containerName, dataToUse, _defaultKeyFields, _logger);
                }

                foreach (var command in commands)
                {
                    await _client.ExecuteCommandAsync(config, command.Text, command.Parameters);
                }
            }
            catch (Exception e)
            {
                var message =
                    $"Could not store data into Container '{containerName}' for Connector {providerDefinitionId}";
                _logger.LogError(e, message);
                throw new StoreDataException(message);
            }
        }
Пример #8
0
        public static VersionChangeType CompareChanges(ref ComputedStyle x, ref ComputedStyle y)
        {
            // This is a pre-emptive since we do not know if style changes actually cause a repaint or a layout
            // But those should be the only possible type of changes needed
            VersionChangeType changes = VersionChangeType.Styles | VersionChangeType.Layout | VersionChangeType.Repaint;

            if (x.overflow != y.overflow)
            {
                changes |= VersionChangeType.Overflow;
            }

            if (x.borderBottomLeftRadius != y.borderBottomLeftRadius ||
                x.borderBottomRightRadius != y.borderBottomRightRadius ||
                x.borderTopLeftRadius != y.borderTopLeftRadius ||
                x.borderTopRightRadius != y.borderTopRightRadius)
            {
                changes |= VersionChangeType.BorderRadius;
            }

            if (x.borderLeftWidth != y.borderLeftWidth ||
                x.borderTopWidth != y.borderTopWidth ||
                x.borderRightWidth != y.borderRightWidth ||
                x.borderBottomWidth != y.borderBottomWidth)
            {
                changes |= VersionChangeType.BorderWidth;
            }

            if (x.opacity != y.opacity)
            {
                changes |= VersionChangeType.Opacity;
            }

            if (!ComputedTransitionUtils.SameTransitionProperty(ref x, ref y))
            {
                changes |= VersionChangeType.TransitionProperty;
            }

            if (x.transformOrigin != y.transformOrigin ||
                x.translate != y.translate ||
                x.scale != y.scale ||
                x.rotate != y.rotate)
            {
                changes |= VersionChangeType.Transform;
            }

            return(changes);
        }
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            if (renderChain == null)
            {
                return;
            }

            if ((versionChangeType & (VersionChangeType.Transform | VersionChangeType.Clip)) != 0)
            {
                renderChain.UIEOnTransformChanged(ve);
            }

            if ((versionChangeType & VersionChangeType.Repaint) != 0)
            {
                renderChain.UIEOnVisualsChanged(ve, false);
            }
        }
        public override void OnVersionChanged(VisualElement ve, VersionChangeType changeTypeFlag)
        {
            if ((changeTypeFlag & VersionChangeType.Repaint) == VersionChangeType.Repaint && m_ShowRepaintOverlay)
            {
                var visible = ve.resolvedStyle.visibility == Visibility.Visible &&
                              ve.resolvedStyle.opacity > Mathf.Epsilon;
                if (panel != null && ve != panel.visualTree && visible)
                {
                    m_RepaintOverlay.AddOverlay(ve);
                }
            }

            if ((changeTypeFlag & VersionChangeType.Hierarchy) == VersionChangeType.Hierarchy)
            {
                m_TreeViewContainer.hierarchyHasChanged = true;
            }
        }
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            base.OnVersionChanged(ve, versionChangeType);
            bool flag = (versionChangeType & VersionChangeType.Bindings) == VersionChangeType.Bindings;

            if (flag)
            {
                bool flag2 = this.GetUpdaterFromElement(ve) != null;
                if (flag2)
                {
                    this.StartTracking(ve);
                }
                else
                {
                    this.StopTracking(ve);
                }
            }
        }
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            bool flag = (versionChangeType & VersionChangeType.StyleSheet) != VersionChangeType.StyleSheet;

            if (!flag)
            {
                this.m_Version += 1u;
                bool isApplyingStyles = this.m_IsApplyingStyles;
                if (isApplyingStyles)
                {
                    this.m_ApplyStyleUpdateList.Add(ve);
                }
                else
                {
                    this.m_StyleContextHierarchyTraversal.AddChangedElement(ve);
                }
            }
        }
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            if ((versionChangeType & (VersionChangeType.Transform | VersionChangeType.Clip)) == 0)
            {
                return;
            }

            if ((versionChangeType & VersionChangeType.Transform) == VersionChangeType.Transform && (!ve.isWorldTransformDirty || !ve.isWorldClipDirty))
            {
                DirtyTransformClipHierarchy(ve); // Dirty both transform and clip when the transform changes
            }
            else if ((versionChangeType & VersionChangeType.Clip) == VersionChangeType.Clip && !ve.isWorldClipDirty)
            {
                DirtyClipHierarchy(ve);
            }

            ++m_Version;
        }
Пример #14
0
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            if (renderChain == null)
            {
                return;
            }

            bool transformChanged    = (versionChangeType & VersionChangeType.Transform) != 0;
            bool sizeChanged         = (versionChangeType & VersionChangeType.Size) != 0;
            bool overflowChanged     = (versionChangeType & VersionChangeType.Overflow) != 0;
            bool borderRadiusChanged = (versionChangeType & VersionChangeType.BorderRadius) != 0;
            bool borderWidthChanged  = (versionChangeType & VersionChangeType.BorderWidth) != 0;
            bool renderHintsChanged  = (versionChangeType & VersionChangeType.RenderHints) != 0;

            if (renderHintsChanged)
            {
                renderChain.UIEOnRenderHintsChanged(ve);
            }

            if (transformChanged || sizeChanged || borderWidthChanged)
            {
                renderChain.UIEOnTransformOrSizeChanged(ve, transformChanged, sizeChanged || borderWidthChanged);
            }

            if (overflowChanged || borderRadiusChanged)
            {
                renderChain.UIEOnClippingChanged(ve, false);
            }

            if ((versionChangeType & VersionChangeType.Opacity) != 0)
            {
                renderChain.UIEOnOpacityChanged(ve);
            }

            if ((versionChangeType & VersionChangeType.Color) != 0)
            {
                renderChain.UIEOnColorChanged(ve);
            }

            if ((versionChangeType & VersionChangeType.Repaint) != 0)
            {
                renderChain.UIEOnVisualsChanged(ve, false);
            }
        }
Пример #15
0
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            if ((versionChangeType & VersionChangeType.StyleSheet) != VersionChangeType.StyleSheet)
            {
                return;
            }

            ++m_Version;

            // Applying styles can trigger new changes, store changes in a separate list
            if (m_IsApplyingStyles)
            {
                m_ApplyStyleUpdateList.Add(ve);
            }
            else
            {
                m_StyleContextHierarchyTraversal.AddChangedElement(ve);
            }
        }
Пример #16
0
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            bool flag = (versionChangeType & (VersionChangeType.Hierarchy | VersionChangeType.Layout)) == (VersionChangeType)0;

            if (!flag)
            {
                bool flag2 = (versionChangeType & VersionChangeType.Hierarchy) != (VersionChangeType)0 && base.panel.duringLayoutPhase;
                if (flag2)
                {
                    throw new InvalidOperationException("Hierarchy change detected while computing layout, this is not supported.");
                }
                YogaNode yogaNode = ve.yogaNode;
                bool     flag3    = yogaNode != null && yogaNode.IsMeasureDefined;
                if (flag3)
                {
                    yogaNode.MarkDirty();
                }
            }
        }
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            bool flag = (versionChangeType & (VersionChangeType.Hierarchy | VersionChangeType.Overflow | VersionChangeType.BorderWidth | VersionChangeType.Transform | VersionChangeType.Size)) == (VersionChangeType)0;

            if (!flag)
            {
                bool flag2 = (versionChangeType & VersionChangeType.Transform) > (VersionChangeType)0;
                bool flag3 = (versionChangeType & (VersionChangeType.Overflow | VersionChangeType.BorderWidth | VersionChangeType.Transform | VersionChangeType.Size)) > (VersionChangeType)0;
                flag2 = (flag2 && !ve.isWorldTransformDirty);
                flag3 = (flag3 && !ve.isWorldClipDirty);
                bool flag4 = flag2 | flag3;
                if (flag4)
                {
                    VisualTreeTransformClipUpdater.DirtyHierarchy(ve, flag2, flag3);
                }
                VisualTreeTransformClipUpdater.DirtyBoundingBoxHierarchy(ve);
                this.m_Version += 1u;
            }
        }
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            if (renderChain == null)
            {
                return;
            }

            bool transformChanged = (versionChangeType & VersionChangeType.Transform) != 0;
            bool sizeChanged      = (versionChangeType & VersionChangeType.Size) != 0;

            if (transformChanged || sizeChanged)
            {
                renderChain.UIEOnTransformOrSizeChanged(ve, transformChanged, sizeChanged);
            }

            if ((versionChangeType & VersionChangeType.Repaint) != 0)
            {
                renderChain.UIEOnVisualsChanged(ve, false);
            }
        }
Пример #19
0
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            if ((versionChangeType & VersionChangeType.Hierarchy) == VersionChangeType.Hierarchy)
            {
                switch (m_State)
                {
                case State.Waiting:
                    ProcessNewChange(ve);
                    break;

                case State.TrackingRemove:
                    ProcessRemove(ve);
                    break;

                case State.TrackingAddOrMove:
                    ProcessAddOrMove(ve);
                    break;
                }
            }
        }
Пример #20
0
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            if ((versionChangeType & (VersionChangeType.Layout | VersionChangeType.Hierarchy)) == 0)
            {
                return;
            }

            // Yoga DOES NOT expect the node tree to mutate while layout is being computed.
            // it could lead to crashes (EXC_BAD_ACCESS)
            if ((versionChangeType & VersionChangeType.Hierarchy) != 0 && panel.duringLayoutPhase)
            {
                throw new InvalidOperationException("Hierarchy change detected while computing layout, this is not supported.");
            }

            var yogaNode = ve.yogaNode;

            if (yogaNode != null && yogaNode.IsMeasureDefined)
            {
                yogaNode.MarkDirty();
            }
        }
Пример #21
0
        public override void OnVersionChanged(VisualElement ve, VersionChangeType changeTypeFlag)
        {
            if ((changeTypeFlag & VersionChangeType.Repaint) == VersionChangeType.Repaint && m_Context.showRepaintOverlay)
            {
                var visible = ve.resolvedStyle.visibility == Visibility.Visible &&
                              ve.resolvedStyle.opacity > UIRUtility.k_Epsilon;
                if (panel != null && ve != panel.visualTree && visible)
                {
                    m_RepaintOverlay.AddOverlay(ve, panelDebug?.debugContainer);
                }
            }

            if ((changeTypeFlag & VersionChangeType.Hierarchy) == VersionChangeType.Hierarchy)
            {
                m_TreeViewContainer.hierarchyHasChanged = true;
            }

            if (panelDebug?.debuggerOverlayPanel != null)
            {
                panelDebug.debuggerOverlayPanel.visualTree.layout = panel.visualTree.layout;
            }
        }
Пример #22
0
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            base.OnVersionChanged(ve, versionChangeType);

            if ((versionChangeType & VersionChangeType.Bindings) == VersionChangeType.Bindings)
            {
                if (GetBindingObjectFromElement(ve) != null)
                {
                    StartTracking(ve);
                }
                else
                {
                    StopTracking(ve);
                }

                var bindingRequests = ve.GetProperty(s_BindingRequestObjectVEPropertyName);
                if (bindingRequests != null)
                {
                    m_ElementsToBind.Add(ve);
                }
            }
        }
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            bool flag = (versionChangeType & VersionChangeType.Hierarchy) == VersionChangeType.Hierarchy;

            if (flag)
            {
                switch (this.m_State)
                {
                case BaseVisualTreeHierarchyTrackerUpdater.State.Waiting:
                    this.ProcessNewChange(ve);
                    break;

                case BaseVisualTreeHierarchyTrackerUpdater.State.TrackingAddOrMove:
                    this.ProcessAddOrMove(ve);
                    break;

                case BaseVisualTreeHierarchyTrackerUpdater.State.TrackingRemove:
                    this.ProcessRemove(ve);
                    break;
                }
            }
        }
Пример #24
0
        public override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
        {
            if ((versionChangeType & (VersionChangeType.Transform | VersionChangeType.Size)) == 0)
            {
                return;
            }

            // According to the flags, what operations must be done?
            bool mustDirtyWorldTransform = (versionChangeType & VersionChangeType.Transform) != 0;
            bool mustDirtyWorldClip      = (versionChangeType & (VersionChangeType.Transform | VersionChangeType.Size)) != 0;

            // Are these operations already done?
            mustDirtyWorldTransform = mustDirtyWorldTransform && !ve.isWorldTransformDirty;
            mustDirtyWorldClip      = mustDirtyWorldClip && !ve.isWorldClipDirty;

            if (mustDirtyWorldTransform || mustDirtyWorldClip)
            {
                DirtyHierarchy(ve, mustDirtyWorldTransform, mustDirtyWorldClip);
            }

            DirtyBoundingBoxHierarchy(ve);

            ++m_Version;
        }
Пример #25
0
 public abstract void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType);
Пример #26
0
 internal override void OnVersionChanged(VisualElement ve, VersionChangeType versionChangeType)
 {
     ++m_Version;
     m_VisualTreeUpdater.OnVersionChanged(ve, versionChangeType);
     panelDebug?.OnVersionChanged(ve, versionChangeType);
 }
Пример #27
0
 internal abstract void OnVersionChanged(VisualElement ele, VersionChangeType changeTypeFlag);
Пример #28
0
 public virtual void OnVersionChanged(VisualElement ve, VersionChangeType changeTypeFlag)
 {
 }
 public override void OnVersionChanged(VisualElement ve, VersionChangeType changeTypeFlag)
 {
 }
Пример #30
0
 public void OnVersionChanged(VisualElement ele, VersionChangeType changeTypeFlag)
 {
 }