public void TestGetIcon() { var tempFileName = Path.Combine(Path.GetTempPath(), Path.GetTempFileName() + ".txt"); using (File.Create(tempFileName)) { } try { var icon = mapper.GetIcon(tempFileName); Assert.That(icon, Is.GreaterThan(-1)); } finally { File.Delete(tempFileName); } }
public WCSolutionNode(IAnkhServiceProvider context, SvnItem item) : base(context, null, item) { string file = Context.GetService <IAnkhSolutionSettings>().SolutionFilename; IFileIconMapper iconMapper = context.GetService <IFileIconMapper>(); if (string.IsNullOrEmpty(file)) { _imageIndex = iconMapper.GetIconForExtension(".sln"); } else { _imageIndex = iconMapper.GetIcon(file); } }
private int GetIcon(IFileIconMapper mapper) { if (SvnItem.Exists) { return(mapper.GetIcon(_item.FullPath)); } else if (_status.NodeKind == SvnNodeKind.Directory) { return(mapper.DirectoryIcon); } else if (_status.NodeKind == SvnNodeKind.None && _status.RemoteUpdateNodeKind == SvnNodeKind.Directory) { return(mapper.DirectoryIcon); } else { return(mapper.GetIconForExtension(_item.Extension)); } }
private int GetIcon(IFileIconMapper mapper) { if (SvnItem.Exists) return mapper.GetIcon(_item.FullPath); else if (_status.NodeKind == SvnNodeKind.Directory) return mapper.DirectoryIcon; else if (_status.NodeKind == SvnNodeKind.None && _status.RemoteUpdateNodeKind == SvnNodeKind.Directory) return mapper.DirectoryIcon; else return mapper.GetIconForExtension(_item.Extension); }