[MonoDevelop] Generics on ClassPad

Lluis Sanchez lluis at ximian.com
Mon Jul 10 06:36:11 EDT 2006


The change in the node builder looks correct. Are you really getting the
generic information in the IClass?

Lluis.

El dj 06 de 07 del 2006 a les 16:38 +0200, en/na Alejandro Serrano va
escriure:
> I've changed a bit on
> Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.ClassPad/ClassNodeBuilder.cs,
> in order to show generic parameters. However, they don't seems to
> appear. Am I doing something wrong? I've changed this parts of the file:
> 
>         public override string GetNodeName (ITreeNavigator thisNode,
> object dataObject)
>         {
>             return
> GetNameWithGenericParameters(((ClassData)dataObject).Class);
>         }
>        
>         public override void BuildNode (ITreeBuilder treeBuilder, object
> dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf
> closedIcon)
>         {
>             ClassData classData = dataObject as ClassData;
>             label = GetNameWithGenericParameters(classData.Class);
>             icon = Context.GetIcon (Services.Icons.GetIcon
> (classData.Class));
>         }
>        
>         private string GetNameWithGenericParameters (IClass c)
>         {
>             if (c.GenericParameters != null && c.GenericParameters.Count
> > 0)
>             {
>                 System.Console.WriteLine ("hey");
>                 StringBuilder builder = new StringBuilder (c.Name);
>                 builder.Append("<");
>                 for (int i = 0; i < c.GenericParameters.Count; i++)
>                 {
>                     builder.Append(c.GenericParameters[i].Name);
>                     if (i + 1 < c.GenericParameters.Count)
> builder.Append(", ");
>                 }
>                 builder.Append("&gt;");
>                 return builder.ToString();
>             }
>             else
>                 return c.Name;
>         }
> 
> Once I got this working, I'll try to commit the other changes I've done
> in this area.
> 
> Thanks in advance,
> Alejandro
> 
> 		
> ______________________________________________ 
> LLama Gratis a cualquier PC del Mundo. 
> Llamadas a fijos y móviles desde 1 céntimo por minuto. 
> http://es.voice.yahoo.com
> _______________________________________________
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-list



More information about the Monodevelop-list mailing list