Beispiel #1
0
        public static string DetermineConfigurationType(IConfigurationAction action)
        {
            var knowsItself = action as IKnowMyConfigurationType;
            if (knowsItself != null) return knowsItself.DetermineConfigurationType();

            if (action.GetType().HasAttribute<ConfigurationTypeAttribute>())
            {
                return action.GetType().GetAttribute<ConfigurationTypeAttribute>().Type;
            }

            return null;
        }
Beispiel #2
0
        public static ConfigurationType? DetermineConfigurationType(IConfigurationAction action)
        {
            if (action is ReorderBehaviorsPolicy) return ConfigurationType.Reordering;
            if (action is NavigationRegistry) return ConfigurationType.Navigation;
            if (action is ServiceRegistry) return ConfigurationType.Services;

            if (action.GetType().HasAttribute<ConfigurationTypeAttribute>())
            {
                return action.GetType().GetAttribute<ConfigurationTypeAttribute>().ConfigurationType;
            }

            return null;
        }
Beispiel #3
0
        public static string DetermineConfigurationType(IConfigurationAction action)
        {
            var knowsItself = action as IKnowMyConfigurationType;

            if (knowsItself != null)
            {
                return(knowsItself.DetermineConfigurationType());
            }

            if (action.GetType().HasAttribute <ConfigurationTypeAttribute>())
            {
                return(action.GetType().GetAttribute <ConfigurationTypeAttribute>().Type);
            }

            return(null);
        }
        public void Fill(IConfigurationAction action)
        {
            Type actionType = action.GetType();

            if (TypeIsUnique(actionType) && _actions.Any(x => x.GetType() == actionType))
            {
                return;
            }

            _actions.Fill(action);
        }
Beispiel #5
0
        public void Fill(IConfigurationAction action)
        {
            Type actionType = action.GetType();


            if (TypeIsUnique(actionType) && _actions.Any(x => x.GetType() == actionType))
            {
                return;
            }

            _actions.Fill(action);
        }
Beispiel #6
0
        public void AddConfiguration(IConfigurationAction action, ConfigurationType?defaultType = null)
        {
            ConfigurationType?type = DetermineConfigurationType(action) ?? defaultType;

            if (type == null)
            {
                throw new ArgumentOutOfRangeException(
                          "No ConfigurationType specified and unable to determine what the configuration type for " +
                          action.GetType());
            }

            _configurations[type.Value].FillAction(action);
        }
Beispiel #7
0
        public static ConfigurationType?DetermineConfigurationType(IConfigurationAction action)
        {
            if (action is ReorderBehaviorsPolicy)
            {
                return(ConfigurationType.Reordering);
            }
            if (action is NavigationRegistry)
            {
                return(ConfigurationType.Navigation);
            }
            if (action is ServiceRegistry)
            {
                return(ConfigurationType.Services);
            }

            if (action.GetType().HasAttribute <ConfigurationTypeAttribute>())
            {
                return(action.GetType().GetAttribute <ConfigurationTypeAttribute>().ConfigurationType);
            }

            return(null);
        }
Beispiel #8
0
        public void Add(IConfigurationAction action, string configurationType = null)
        {
            string type = DetermineConfigurationType(action) ?? configurationType;

            if (type == null)
            {
                throw new ArgumentOutOfRangeException(
                          "No Type specified and unable to determine what the configuration type for " +
                          action.GetType());
            }

            _configurations[type].Fill(_currentProvenance, action);
        }
        public void Fill(ProvenanceChain provenanceStack, IConfigurationAction action)
        {
            if (provenanceStack == null || !provenanceStack.Chain.Any())
            {
                throw new ArgumentException("No provenance supplied!");
            }

            Type actionType = action.GetType();


            if (TypeIsUnique(actionType) && _logs.Any(x => x.Action.GetType() == actionType))
            {
                return;
            }

            _logs.Fill(new ActionLog(action, provenanceStack));
        }
Beispiel #10
0
        public void AddConfiguration(IConfigurationAction action, ConfigurationType? defaultType = null)
        {
            ConfigurationType? type = DetermineConfigurationType(action) ?? defaultType;
            if (type == null)
            {
                throw new ArgumentOutOfRangeException(
                    "No ConfigurationType specified and unable to determine what the configuration type for " +
                    action.GetType());
            }

            _configurations[type.Value].FillAction(action);
        }
Beispiel #11
0
        public void Add(IConfigurationAction action, string configurationType = null)
        {
            string type = DetermineConfigurationType(action) ?? configurationType;
            if (type == null)
            {
                throw new ArgumentOutOfRangeException(
                    "No Type specified and unable to determine what the configuration type for " +
                    action.GetType());
            }

            _configurations[type].Fill(action);
        }