Tealium.TealiumTagger.LoadAutomaticNavigationProperties C# (CSharp) Method

LoadAutomaticNavigationProperties() private method

private LoadAutomaticNavigationProperties ( object page, object parameter ) : void
page object
parameter object
return void
        private void LoadAutomaticNavigationProperties(object page, object parameter)
        {
            Dictionary<string, object> vars = new Dictionary<string, object>();

            var props = TypeHelper.GetAttributes<TrackPropertyAttribute>(page);
            if (props != null && props.Any())
            {
                foreach (var item in props)
                {
                    if (item.Name != null && item.Value != null)
                        vars[item.Name] = item.Value;
                }

            }

            var pars = TypeHelper.GetAttributes<TrackNavigationParameterAttribute>(page);
            if (pars != null && pars.Any())
            {
                foreach (var item in pars)
                {
                    if (!string.IsNullOrEmpty(item.VariableName))
                    {
                        if (!string.IsNullOrEmpty(item.ParameterName) && parameter != null)
                        {
            #if NETFX_CORE
                            vars[item.VariableName] = TypeHelper.LookupProperty(item.ParameterName, parameter);
            #else
                            var context = parameter as NavigationContext;
                            if (context != null && context.QueryString.ContainsKey(item.ParameterName))
                            {
                                vars[item.VariableName] = context.QueryString[item.ParameterName];
                            }
            #endif
                        }
                        else
                        {
                            vars[item.VariableName] = parameter;
                        }
                    }
                }

            }

            this.SetVariables(vars);
        }