示例#1
0
        public override void Rewrite()
        {
            if (!IsDirty)
            {
                return;
            }

            var component = Module.Parent;

            if (component.Type == ComponentType.Document)
            {
                // can't re-import a document module
                return;
            }

            var file    = _exporter.Export(component);
            var content = Rewriter.GetText();

            File.WriteAllText(file, content);

            var components = component.Collection;

            components.Remove(component);
            components.ImportSourceFile(file);
        }
 // returns the changed text
 public string GetText()
 {
     return(Rewriter.GetText());
 }