public void Arrange(XDocument input)
        {
            _attributeKeyComparer = CreateAttributeKeyComparer(_sortAttributes);
            _nodeNameComparer     = new NodeNameComparer(_stickyElementNames);

            input.Root.ReplaceNodes(
                UnfoldSections(
                    FoldSections(input.Root.Nodes())
                    .OrderBy(x => x.OptionSection ? 2 : 1)
                    )
                );
        }
        public void Arrange(XDocument input)
        {
            new InputDataModificator().ModifyInputData(input);

            _attributeKeyComparer = CreateAttributeKeyComparer(_sortAttributes);
            _nodeNameComparer     = new NodeNameComparer(_stickyElementNames);

            input.Root.ReplaceNodes(
                UnfoldSections(
                    FoldSections(input.Root.Nodes().Where(obj => !(obj is XComment)))
                    .OrderBy(x => x.OptionSection ? 2 : 1)
                    )
                );
        }
Beispiel #3
0
        public void Arrange(XDocument input)
        {
            _attributeKeyComparer = CreateAttributeKeyComparer(_sortAttributes);
            _nodeNameComparer     = new NodeNameComparer(_stickyElementNames);

            var ds = input.Root.Descendants().Where(a => a.Name.LocalName == "ProjectExtensions");

            foreach (var d in ds)
            {
                d.RemoveAll();
            }

            input.Root.ReplaceNodes(
                UnfoldSections(
                    FoldSections(input.Root.Nodes())
                    .OrderBy(x => x.OptionSection ? 2 : 1)
                    )
                );
        }