示例#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);
        }
        /// <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);
        }