Exemplo n.º 1
0
        public void ValidateTimelineGroupKeys()
        {
            List <string> removeKeys = new List <string>();

            HashSet <string> validProperties = ProfilePropertyKeys.GetPropertyKeysSet();

            foreach (string timelineKey in timelineManagedKeys)
            {
                if (!IsManagedByTimeline(timelineKey) || !validProperties.Contains(timelineKey))
                {
                    removeKeys.Add(timelineKey);
                }
            }

            foreach (string removeKey in removeKeys)
            {
                if (timelineManagedKeys.Contains(removeKey))
                {
                    timelineManagedKeys.Remove(removeKey);
                }
            }
        }
Exemplo n.º 2
0
        public void MergeGroupsWithDefinitions()
        {
            HashSet <string> validProperties = ProfilePropertyKeys.GetPropertyKeysSet();

            // Build our groups from the profile definition table.
            foreach (ProfileGroupSection section in groupDefinitions)
            {
                foreach (ProfileGroupDefinition groupInfo in section.groups)
                {
                    // Filter out old groups that are no longer valid.
                    if (!validProperties.Contains(groupInfo.propertyKey))
                    {
                        continue;
                    }

                    if (groupInfo.type == ProfileGroupDefinition.GroupType.Color)
                    {
                        if (keyframeGroups.ContainsKey(groupInfo.propertyKey) == false)
                        {
                            AddColorGroup(groupInfo.propertyKey, groupInfo.groupName, groupInfo.color);
                        }
                        else
                        {
                            keyframeGroups[groupInfo.propertyKey].name = groupInfo.groupName;
                        }
                    }
                    else if (groupInfo.type == ProfileGroupDefinition.GroupType.Number)
                    {
                        if (keyframeGroups.ContainsKey(groupInfo.propertyKey) == false)
                        {
                            AddNumericGroup(groupInfo.propertyKey, groupInfo.groupName,
                                            groupInfo.minimumValue, groupInfo.maximumValue, groupInfo.value);
                        }
                        else
                        {
                            NumberKeyframeGroup numberGroup = keyframeGroups.GetGroup <NumberKeyframeGroup>(groupInfo.propertyKey);
                            numberGroup.name     = groupInfo.groupName;
                            numberGroup.minValue = groupInfo.minimumValue;
                            numberGroup.maxValue = groupInfo.maximumValue;
                        }
                    }
                    else if (groupInfo.type == ProfileGroupDefinition.GroupType.Texture)
                    {
                        if (keyframeGroups.ContainsKey(groupInfo.propertyKey) == false)
                        {
                            AddTextureGroup(groupInfo.propertyKey, groupInfo.groupName, groupInfo.texture);
                        }
                        else
                        {
                            keyframeGroups[groupInfo.propertyKey].name = groupInfo.groupName;
                        }
                    }
                    else if (groupInfo.type == ProfileGroupDefinition.GroupType.SpherePoint)
                    {
                        if (keyframeGroups.ContainsKey(groupInfo.propertyKey) == false)
                        {
                            AddSpherePointGroup(groupInfo.propertyKey, groupInfo.groupName, groupInfo.spherePoint);
                        }
                        else
                        {
                            keyframeGroups[groupInfo.propertyKey].name = groupInfo.groupName;
                        }
                    }
                    else if (groupInfo.type == ProfileGroupDefinition.GroupType.Boolean)
                    {
                        if (keyframeGroups.ContainsKey(groupInfo.propertyKey) == false)
                        {
                            AddBooleanGroup(groupInfo.propertyKey, groupInfo.groupName, groupInfo.boolValue);
                        }
                        else
                        {
                            keyframeGroups[groupInfo.propertyKey].name = groupInfo.groupName;
                        }
                    }
                }
            }
        }