private string PreparePath() { var basePath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments); if (m_dte.Solution != null) { basePath = System.IO.Path.GetDirectoryName(m_dte.Solution.FullName); } basePath = System.IO.Path.Combine(basePath, ".HistoryData"); if (!System.IO.Directory.Exists(basePath)) { var info = System.IO.Directory.CreateDirectory(basePath); info.Attributes |= System.IO.FileAttributes.Hidden; } // Also prepare save/build data var contextPath = System.IO.Path.Combine(basePath, "LocalHistory"); if (!System.IO.Directory.Exists(contextPath)) { //System.IO.Directory.CreateDirectory(contextPath); var provider = new GitProviderLibGit2Sharp(); provider.Init(contextPath); } return basePath; }
public bool Register(EnvDTE.DTE dte, GanjiContext context) { // Register events for running document table. m_RDT = (IVsRunningDocumentTable)Package.GetGlobalService(typeof(SVsRunningDocumentTable)); m_RDT.AdviseRunningDocTableEvents(this, out m_rdtCookie); provider = new GitProviderLibGit2Sharp(); provider.ContextRepository = context.RepositoryPath; provider.SolutionBaseDirectory = context.SolutionPath; provider.Open(context.RepositoryPath); // I: test if this table is from multiple instances routed here... return true; }
public bool Register(EnvDTE.DTE dte, GanjiContext context) { table = (IVsRunningDocumentTable)Package.GetGlobalService(typeof(SVsRunningDocumentTable)); // Listen to show/hide events of docs to register activate/deactivate cursor listeners. table.AdviseRunningDocTableEvents(this, out m_rdtCookie); // In turn, cursor events will register a IVsTextViewEvents indexed by the IVsTextView. provider = new GitProviderLibGit2Sharp(); provider.ContextRepository = context.RepositoryPath; provider.SolutionBaseDirectory = context.SolutionPath; provider.Open(context.RepositoryPath); // Mixing in Find events with click events. m_dte = dte; m_findEvents = dte.Events.FindEvents; m_findEvents.FindDone += new EnvDTE._dispFindEvents_FindDoneEventHandler(m_findEvents_FindDone); return true; }