Пример #1
0
        public void Digest(object source)
        {
            List <BindingChange> changes = null;

            for (int i = 0; i < Paths.Length; i++)
            {
                var path  = Paths[i];
                var value = DotPath.GetDotPathValue(source, path);

                if (value != Values[i])
                {
                    //Changed
                    if (changes == null)
                    {
                        changes = new List <BindingChange>();
                    }
                    changes.Add(new BindingChange()
                    {
                        Path          = PathStrings[i],
                        PreviousValue = Values[i],
                        Value         = value
                    });
                    Values[i] = value;
                }
            }

            if (changes != null)
            {
                Callback(changes.ToArray());
            }
        }
Пример #2
0
 private object GetValue(object source)
 {
     return(DotPath.GetDotPathValue(source, Path));
 }