void MyShowFileEventHandler(object sender, ShowFileEventArgs args) { string serverItem = args.ServerItem; VersionControlServer vcs = args.VersionControlServer; Microsoft.TeamFoundation.VersionControl.Client.Item item = vcs.GetItem(serverItem, VersionSpec.Latest, 0, true); string tname = System.IO.Path.GetTempFileName(); item.DownloadFile(tname); Document d = MonoDevelop.Ide.Gui.IdeApp.Workbench.OpenDocument(tname, true); d.FileName = serverItem; File.Delete(tname); }
public string GetFile() { // this is a quite inefficient implementation, FIXME string tname = Path.GetTempFileName(); item.DownloadFile(tname); string file; using (StreamReader sr = new StreamReader(tname)) { file = sr.ReadToEnd(); } File.Delete(tname); return(file); }
public void UpdatePath(string path) { if (String.IsNullOrEmpty(path)) { return; } Microsoft.TeamFoundation.VersionControl.Client.Item item = driver.VersionControlServer.GetItem(path, VersionSpec.Latest, 0, true); string tname = System.IO.Path.GetTempFileName(); item.DownloadFile(tname); using (StreamReader sr = new StreamReader(tname)) { view.Update(path, sr.ReadToEnd()); } File.Delete(tname); }
public FileView(VersionControlServer vcs, string path) { view = MyTextViewFactory.CreateNewTextView(); Add(view); if (String.IsNullOrEmpty(path)) { return; } Microsoft.TeamFoundation.VersionControl.Client.Item item = vcs.GetItem(path, VersionSpec.Latest, 0, true); string tname = System.IO.Path.GetTempFileName(); item.DownloadFile(tname); using (StreamReader sr = new StreamReader(tname)) { view.Update(path, sr.ReadToEnd()); } File.Delete(tname); }
public Stream DownloadFile() { return(_item.DownloadFile()); }