private static ImageListKind GetImageListKind(FunctionDefinition funcDef) { ImageListKind imageKind = ImageListKind.Method; if (funcDef.Decorators != null && funcDef.Decorators.Decorators.Count == 1) { foreach (var decorator in funcDef.Decorators.Decorators) { NameExpression nameExpr = decorator as NameExpression; if (nameExpr != null) { if (nameExpr.Name == "property") { imageKind = ImageListKind.Property; break; } else if (nameExpr.Name == "staticmethod") { imageKind = ImageListKind.StaticMethod; break; } else if (nameExpr.Name == "classmethod") { imageKind = ImageListKind.ClassMethod; break; } } } } return(imageKind); }
/// <summary> /// Turns an image list kind / overlay into the proper index in the image list. /// </summary> private static int GetImageListIndex(ImageListKind kind, ImageListOverlay overlay) { if ((int)kind <= 30) { int groupBase = (int)kind * 6; return(groupBase + (int)overlay); } return((int)kind); }
/// <summary> /// Turns an image list kind / overlay into the proper index in the image list. /// </summary> internal static int GetImageListIndex(ImageListKind kind, ImageListOverlay overlay) { return ((int)kind) * 6 + (int)overlay; }
/// <summary> /// Turns an image list kind / overlay into the proper index in the image list. /// </summary> private static int GetImageListIndex(ImageListKind kind, ImageListOverlay overlay) { return(((int)kind) * 6 + (int)overlay); }