public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var status    = (ComparableStatus)value;
            var iconIndex = StatusImages.GetIndex((HgFileStatus)status);

            return(images[iconIndex]);
        }
        AnkhGlyph GetPathGlyph(string path, bool lookForChildren)
        {
            SvnItem item = StatusCache[path];

            if (item == null || StatusImages == null)
            {
                return(AnkhGlyph.None);
            }

            AnkhGlyph glyph = StatusImages.GetStatusImageForSvnItem(item);

            switch (glyph)
            {
            case AnkhGlyph.Normal:
                break;     // See below

            default:
                return(glyph);
            }

            // Let's try to do some simple inheritance trick on scc-special files with a normal icon
            // as those are collapsed by default

            SccProjectFile file;

            if (!lookForChildren || !ProjectMap.TryGetFile(item.FullPath, out file))
            {
                return(glyph);
            }

            SccProjectFileReference rf = file.FirstReference;

            if (rf != null)
            {
                foreach (string fn in rf.GetSubFiles())
                {
                    if (IsChildChanged(fn))
                    {
                        return(AnkhGlyph.ChildChanged);
                    }
                }

                // TODO: Make configurable and review missing/lock etc.
                //if (ProjectGlyphRecursive && rf.IsProjectFile)
                //{
                //    foreach (string fn in rf.Project.GetAllFiles())
                //    {
                //        if (IsChildChanged(fn))
                //            return AnkhGlyph.ChildChanged;
                //    }
                //}
            }

            return(AnkhGlyph.Normal);
        }
Exemple #3
0
        private VsStateIcon GetStatusIcon(HgFileStatus status)
        {
            var iconIndex = 0;

            if (StatusIconsLimited)
            {
                iconIndex = StatusImages.GetIndexLimited(status);
            }
            else
            {
                iconIndex = StatusImages.GetIndex(status);
            }

            return(GetStatusIcon(iconIndex));
        }
Exemple #4
0
        private void InitializeStatusImageList(uint baseIndex)
        {
            iconBaseIndex = baseIndex;

            if (statusImageList == null)
            {
                var fileName = VisualHgOptions.Global.StatusImageFileName;

                if (StatusIconsLimited)
                {
                    statusImageList = StatusImages.CreateLimited(fileName);
                }
                else
                {
                    statusImageList = StatusImages.Create(fileName);
                }
            }
        }