Exemplo n.º 1
0
        public static string GetImageName(DmdPropertyInfo property)
        {
            var method = property.GetGetMethod(DmdGetAccessorOptions.All) ?? property.GetSetMethod(DmdGetAccessorOptions.All);

            if ((object)method == null)
            {
                return(PredefinedDbgValueNodeImageNames.Property);
            }
            switch (method.Attributes & DmdMethodAttributes.MemberAccessMask)
            {
            case DmdMethodAttributes.PrivateScope:  return(PredefinedDbgValueNodeImageNames.PropertyCompilerControlled);

            case DmdMethodAttributes.Private:               return(PredefinedDbgValueNodeImageNames.PropertyPrivate);

            case DmdMethodAttributes.FamANDAssem:   return(PredefinedDbgValueNodeImageNames.PropertyFamilyAndAssembly);

            case DmdMethodAttributes.Assembly:              return(PredefinedDbgValueNodeImageNames.PropertyAssembly);

            case DmdMethodAttributes.Family:                return(PredefinedDbgValueNodeImageNames.PropertyFamily);

            case DmdMethodAttributes.FamORAssem:    return(PredefinedDbgValueNodeImageNames.PropertyFamilyOrAssembly);

            case DmdMethodAttributes.Public:                return(PredefinedDbgValueNodeImageNames.PropertyPublic);

            default:                                                                return(PredefinedDbgValueNodeImageNames.Property);
            }
        }
Exemplo n.º 2
0
        public static DbgTextColor GetColor(DmdPropertyInfo property)
        {
            var methodSig = (property.GetGetMethod(DmdGetAccessorOptions.All) ?? property.GetSetMethod(DmdGetAccessorOptions.All))?.GetMethodSignature() ?? property.GetMethodSignature();

            return(methodSig.HasThis ? DbgTextColor.InstanceProperty : DbgTextColor.StaticProperty);
        }