public TextReader GetTemplate(string path)
        {
            if (path.StartsWith("temp://"))
            {
                byte[]       byteArray = Encoding.ASCII.GetBytes(path.Remove(0, 7));
                MemoryStream stream    = new MemoryStream(byteArray);
                return(new StreamReader(stream));
            }
            path = get_absolute_path(path);
            BufferRecord record;

            if (templates.TryGetValue(path, out record) && record.Item1 != null)
            {
                var new_record = new BufferRecord(record.Item1.TextBuffer.CurrentSnapshot, false);
                templates[path] = new_record;
                return(new BufferReader(new_record.Item1));
            }
            if (File.Exists(path))
            {
                return(new StreamReader(path));
            }
            return(new DummyReader());
        }
 internal void Register(string path, ITextBuffer buffer, NodeProvider provider)
 {
     templates[path] = new BufferRecord(buffer.CurrentSnapshot, true);
 }