Beispiel #1
0
        internal void FindUserOptionChanges()
        {
            JToken optionDifferences = new JsonDiffPatch().Diff(JArray.FromObject(defaultFormatOptions), JArray.FromObject(UserFormatOptions));

            List <string> changes = new List <string>();

            GetChangedOptionPositions(optionDifferences?.Skip(1).First(), changes);

            foreach (var change in changes)
            {
                Queue <int>     parts = new Queue <int>(change.Split('_').Select(c => int.Parse(c)));
                SqlFormatOption currentFormatOption = UserFormatOptions[parts.Dequeue()];

                while (parts.Count > 0)
                {
                    int level = parts.Dequeue();
                    currentFormatOption = currentFormatOption.Childs[level];
                }

                QueuePendingChanges(currentFormatOption);
            }
        }