public PropertyValueSource GetValueSource(ITrackValueSource target)
        {
            if (target == null)
            {
                throw Logger.Fatal.ArgumentNull(nameof(target));
            }

            return target.GetValueSource(PropertyInfo);
        }
示例#2
0
        public PropertyValueSource GetValueSource(ITrackValueSource target)
        {
            if (target == null)
            {
                throw Logger.Fatal.ArgumentNull(nameof(target));
            }

            return(target.GetValueSource(PropertyInfo));
        }
        public void SetValue(ITrackValueSource target, Object value, PropertyValueSource source)
        {
            if (target == null)
            {
                throw Logger.Fatal.ArgumentNull(nameof(target));
            }

            Setter(target, value);
            SetValueSource(target, source);
        }
示例#4
0
        public void SetValue(ITrackValueSource target, Object value, PropertyValueSource source)
        {
            if (target == null)
            {
                throw Logger.Fatal.ArgumentNull(nameof(target));
            }

            Setter(target, value);
            SetValueSource(target, source);
        }
        public void Bind(ITrackValueSource target, HarshProvisionerContextBase context)
        {
            if (target == null)
            {
                throw Logger.Fatal.ArgumentNull(nameof(target));
            }

            if (context == null)
            {
                throw Logger.Fatal.ArgumentNull(nameof(context));
            }

            foreach (var prop in Properties)
            {
                var value = prop.Accessor.GetValue(target);

                if (value != null)
                {
                    Logger.Debug(
                        "Property {PropertyName} already has non-null value, skipping",
                        prop.Name
                    );

                    continue;
                }

                value = GetValueFromContext(prop, context);

                if (value != null)
                {
                    Logger.Debug(
                        "Setting property {PropertyName} to {$Value}",
                        prop.Name,
                        value
                    );

                    prop.Accessor.SetValue(target, value, DefaultFromContextPropertyValueSource.Instance);
                }
                else
                {
                    Logger.Debug(
                        "Got null from context for property {PropertyName}, skipping",
                        prop.Name
                    );
                }
            }
        }
示例#6
0
        public void Bind(ITrackValueSource target, HarshProvisionerContextBase context)
        {
            if (target == null)
            {
                throw Logger.Fatal.ArgumentNull(nameof(target));
            }

            if (context == null)
            {
                throw Logger.Fatal.ArgumentNull(nameof(context));
            }

            foreach (var prop in Properties)
            {
                var value = prop.Accessor.GetValue(target);

                if (value != null)
                {
                    Logger.Debug(
                        "Property {PropertyName} already has non-null value, skipping",
                        prop.Name
                        );

                    continue;
                }

                value = GetValueFromContext(prop, context);

                if (value != null)
                {
                    Logger.Debug(
                        "Setting property {PropertyName} to {$Value}",
                        prop.Name,
                        value
                        );

                    prop.Accessor.SetValue(target, value, DefaultFromContextPropertyValueSource.Instance);
                }
                else
                {
                    Logger.Debug(
                        "Got null from context for property {PropertyName}, skipping",
                        prop.Name
                        );
                }
            }
        }
 private void SetValueSource(ITrackValueSource target, PropertyValueSource source)
 {
     target.SetValueSource(PropertyInfo, source);
 }
示例#8
0
 private void SetValueSource(ITrackValueSource target, PropertyValueSource source)
 {
     target.SetValueSource(PropertyInfo, source);
 }
示例#9
0
 public void SetValue(ITrackValueSource target, Object value, PropertyValueSource source)
 => PropertyAccessor.SetValue(target, value, source);
示例#10
0
 public PropertyValueSource GetValueSource(ITrackValueSource target)
 => PropertyAccessor.GetValueSource(target);
示例#11
0
 public void SetValue(ITrackValueSource target, Object value, PropertyValueSource source)
     => PropertyAccessor.SetValue(target, value, source);
示例#12
0
 public PropertyValueSource GetValueSource(ITrackValueSource target)
     => PropertyAccessor.GetValueSource(target);