Change "Field Alias" name in TypedList (Plug-In)

Posts   
 
    
lauge
User
Posts: 25
Joined: 29-Sep-2006
# Posted on: 24-Nov-2006 13:30:33   

Hi,

I just started on my first plug-in. Nice concept :-)

Here is my task. In a TypedList, I need to change the "Field Alias" name to the content in "Entity Field Name" column.

But I need some help to get there. Here is what I got:

// Just so I can see what happens StringBuilder myString = new StringBuilder();

foreach (SD.LLBLGen.Pro.ApplicationCore.TypedLists.TypedListDefinition objTypedList in base.TypedLists) { myString.Append("OK - I can see the name of the TypedList" + Environment.NewLine); myString.Append("Name: " + objTypedList.Name + Environment.NewLine);

foreach (System.Collections.DictionaryEntry objDictionaryEntry in objTypedList.EntityAliases)
{
    SD.LLBLGen.Pro.ApplicationCore.TypedLists.EntityAlias objEntityAlias = ((SD.LLBLGen.Pro.ApplicationCore.TypedLists.EntityAlias)(objDictionaryEntry.Key));

    myString.Append("OK - I can see the name of the Entities in the TypedList" + Environment.NewLine);
    myString.Append("EntityName: " + objEntityAlias.EntityName + Environment.NewLine);

    // Im not shure what im going to do with the "ProgressSubtaskStart"
    //base.ProgressSubtaskStart("Processing TypedList EntityAlias: " + objEntityAlias.EntityName);
    objEntityAlias.Alias = objEntityAlias.EntityName;
    //base.ProgressSubtaskComplete();

    // Where do I go from here?
    // Where do I go from here?
    // Where do I go from here?
    // Where do I go from here?
}

}

lauge
User
Posts: 25
Joined: 29-Sep-2006
# Posted on: 24-Nov-2006 14:06:30   

OK - I found the solution.

/// <summary> /// Executes this plugin /// </summary> public override void Execute() { foreach (SD.LLBLGen.Pro.ApplicationCore.TypedLists.TypedListDefinition objTypedList in base.TypedLists) { foreach (TypedListFieldDefinition typedListContainer in objTypedList.Fields) { typedListContainer.Alias = typedListContainer.FieldName.Replace(".", "_"); } } }