Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
 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));
     }
 }
Esempio n. 4
0
 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);
 }