private string get_indexer_for_prop(ICompiledPropertyScope scope) { ITypeScope[] indexers = scope.Indexers; if (indexers.Length == 0) return ""; StringBuilder sb = new StringBuilder(); sb.Append('['); for (int i=0; i<indexers.Length; i++) { sb.Append(GetSimpleDescriptionWithoutNamespace(indexers[i])); if (i<indexers.Length-1) sb.Append(','); } sb.Append(']'); return sb.ToString(); }
protected virtual string GetDescriptionForCompiledProperty(ICompiledPropertyScope scope) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); MethodInfo acc = scope.CompiledProperty.GetGetMethod(); string inst_type = null; if (acc != null) if (acc.IsStatic) sb.Append("class "); if (scope.Type is ICompiledTypeScope && scope.GenericArgs != null) { Type t = (scope.Type as ICompiledTypeScope).CompiledType; inst_type = get_type_instance(t,scope.GenericArgs); } sb.Append("property "+ GetShortTypeName(scope.CompiledProperty.DeclaringType) +"."+ scope.CompiledProperty.Name + get_indexer_for_prop(scope)+ ": "+(inst_type != null?inst_type:GetSimpleDescription(scope.Type))); if (acc != null) //if (acc.IsStatic) sb.Append("; static"); if (acc.IsVirtual) sb.Append("; virtual"); else if (acc.IsAbstract) sb.Append("; abstract"); if (scope.IsReadOnly) sb.Append("; readonly"); sb.Append(';'); return sb.ToString(); }
protected override string GetDescriptionForCompiledProperty(ICompiledPropertyScope scope) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); MethodInfo acc = scope.CompiledProperty.GetGetMethod(); sb.Append(get_access_modifier(scope.AccessModifier)); if (acc != null) { if (acc.IsStatic) sb.Append("Shared "); else if (acc.IsVirtual) sb.Append("Overridable "); else if (acc.IsAbstract) sb.Append("MustOverride "); } sb.Append("Property " + scope.CompiledProperty.Name + " As " + GetSimpleDescription(scope.Type)); return sb.ToString(); }