protected override void OnUpdate(SmartListView list, VisualGit.Commands.CommandUpdateEventArgs e) { bool foundOne = false; e.Checked = true; foreach (SmartColumn sc in list.SortColumns) { foundOne = true; switch (e.Command) { case VisualGitCommand.ListViewSortAscending: if (sc.ReverseSort) { e.Checked = false; return; } break; case VisualGitCommand.ListViewSortDescending: if (!sc.ReverseSort) { e.Checked = false; return; } break; } } if (!foundOne) { e.Checked = e.Enabled = false; } }
/// <summary> /// Gets a list of VisualGitRevisions for the specified origin /// </summary> /// <param name="origin">The origin.</param> /// <returns></returns> public IEnumerable<VisualGitRevisionType> GetRevisionTypes(VisualGit.Scc.GitOrigin origin) { Hashtable ht = new Hashtable(); foreach (IVisualGitRevisionProvider p in _providers) { foreach (VisualGitRevisionType rt in p.GetRevisionTypes(origin)) { if (!ht.Contains(rt)) yield return rt; ht.Add(rt, rt.UniqueName); } } }
/// <summary> /// Gets a list of all files contained within <paramref name="project"/> /// </summary> /// <param name="project"></param> /// <returns></returns> public IEnumerable<string> GetAllFilesOf(VisualGit.Selection.GitProject project) { if (project == null) throw new ArgumentNullException("project"); if (project.IsSolution) { string sf = SolutionFilename; if (sf != null) yield return sf; yield break; } project = ResolveRawProject(project); IVsSccProject2 scc = project.RawHandle; SccProjectData data; if (scc == null || !_projectMap.TryGetValue(scc, out data)) yield break; foreach (string file in data.GetAllFiles()) { if (file[file.Length - 1] != '\\') // Don't return paths yield return file; } }
public IEnumerable<VisualGitRevisionType> GetRevisionTypes(VisualGit.Scc.GitOrigin origin) { if (origin == null) throw new ArgumentNullException("origin"); yield return _head; GitItem item = GetService<IFileStatusCache>()[origin.Target.FullPath]; if (item.IsVersioned) { yield return _working; // yield return _base; } if (item.HasCopyableHistory) { // yield return _committed; // yield return _previous; } else yield break; // yield return new DateRevisionType(this, origin); yield return new ExplicitRevisionType(this, origin); }
public void AddWindowPane(VisualGit.UI.VSContainerForm form, IVsWindowPane pane) { VSCommandRouting routing = VSCommandRouting.FromForm(form); if (routing != null) routing.AddWindowPane(pane); else throw new InvalidOperationException("Command routing not initialized yet"); }
public void AddCommandTarget(VisualGit.UI.VSContainerForm form, IOleCommandTarget commandTarget) { VSCommandRouting routing = VSCommandRouting.FromForm(form); if (routing != null) routing.AddCommandTarget(commandTarget); else throw new InvalidOperationException("Command routing not initialized yet"); }
public void OnContainerCreated(VisualGit.UI.VSContainerForm form) { VSCommandRouting routing = VSCommandRouting.FromForm(form); if (routing != null) routing.OnHandleCreated(); }
public IDisposable InstallFormRouting(VisualGit.UI.VSContainerForm container, EventArgs eventArgs) { return new VSCommandRouting(Context, container); }
protected override void OnFrameShow(VisualGit.Scc.UI.FrameEventArgs e) { base.OnFrameShow(e); switch (e.Show) { case __FRAMESHOW.FRAMESHOW_WinShown: AddRoots(true); break; } }
private void Overview_LineClick(object sender, VisualGit.Diff.DiffUtils.Controls.DiffLineClickEventArgs e) { ViewA.CenterVisibleLine = e.Line; ActiveView.Position = new DiffViewPosition(e.Line, 0); }
internal void OnUpdate(VisualGit.Commands.CommandUpdateEventArgs e) { switch (e.Command) { case VisualGitCommand.PcLogEditorPasteFileList: foreach (PendingCommitItem pci in _listItems.Values) { if (pci.Checked) return; } e.Enabled = false; return; case VisualGitCommand.PcLogEditorPasteRecentLog: return; } }
internal void OnExecute(VisualGit.Commands.CommandEventArgs e) { StringBuilder sb = new StringBuilder(); switch (e.Command) { case VisualGitCommand.PcLogEditorPasteRecentLog: break; } if (sb.Length > 0) logMessageEditor.PasteText(sb.ToString()); }
private void TreeB_VScroll(object sender, VisualGit.Diff.DiffUtils.Controls.Win32MessageEventArgs e) { TreeA.SendVScroll(e.WParam); }
private void TreeB_MouseWheelMsg(object sender, VisualGit.Diff.DiffUtils.Controls.Win32MessageEventArgs e) { TreeA.SendMouseWheel(e.WParam, e.LParam); }