3 using System
.Collections
;
4 using System
.Collections
.Generic
;
9 using Microsoft
.TeamFoundation
.Client
;
10 using Microsoft
.TeamFoundation
.VersionControl
.Common
;
11 using Microsoft
.TeamFoundation
.VersionControl
.Client
;
13 public class FileView
: Gtk
.ScrolledWindow
, IExploreViewChild
15 private Gtk
.TextBuffer viewBuffer
;
16 private Driver driver
;
18 public FileView(Driver driver
)
21 Gtk
.TextView view
= new Gtk
.TextView();
22 view
.CursorVisible
= false;
23 view
.Editable
= false;
24 view
.ModifyFont(Pango
.FontDescription
.FromString("Vera Sans Mono 16"));
26 viewBuffer
= view
.Buffer
;
30 public void UpdatePath(string path
)
32 if (String
.IsNullOrEmpty(path
)) return;
33 Microsoft
.TeamFoundation
.VersionControl
.Client
.Item item
= driver
.VersionControlServer
.GetItem(path
, VersionSpec
.Latest
, 0, true);
35 string tname
= System
.IO
.Path
.GetTempFileName();
36 item
.DownloadFile(tname
);
38 using (StreamReader sr
= new StreamReader(tname
))
40 viewBuffer
.Text
= sr
.ReadToEnd();