예제 #1
0
        private static IEnumerable <PSObject> CreatePreset(XmlNode presetNode)
        {
            var presetEntries = PresetFactory.Create(presetNode);

            return(presetEntries.Select(preset =>
            {
                var psPreset = PSObject.AsPSObject(preset);
                psPreset.Properties.Add(new PSNoteProperty("PresetName", presetNode.Name));
                return psPreset;
            }));
        }
예제 #2
0
        /// <summary>
        /// Gets the default presets specified in configuration/sitecore/serialization/name
        /// </summary>
        public static IList <IncludeEntry> GetPreset(string name)
        {
            var config = Factory.GetConfigNode("serialization/" + name);

            if (config != null)
            {
                return(PresetFactory.Create(config));
            }

            return(null);
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ConfigurationService"/> class.
        /// </summary>
        public ConfigurationService()
        {
            var config = Factory.GetConfigNode("packman");

            if (config == null)
            {
                Log.Info("No include/exclude configuration found. Everything will be included.", this);
                return;
            }

            this.preset = PresetFactory.Create(config);
        }
예제 #4
0
        public SerializationPresetFilter(string presetName)
        {
            Assert.IsNotNullOrEmpty(presetName, "presetName");

            var config = Factory.GetConfigNode("serialization/" + presetName);

            if (config == null)
            {
                throw new InvalidOperationException("Preset " + presetName + " is undefined in configuration.");
            }

            _preset = PresetFactory.Create(config);
        }
        public SerializationPresetPredicate(XmlNode configNode)
        {
            Assert.ArgumentNotNull(configNode, "configNode");

            _preset = PresetFactory.Create(configNode);
        }