The text below is OK - but irrelevant to the actual question. To read the parameter of a TBB, simply use this:
string value = package.GetValue("FieldName");
Where "FieldName" is the (XML) name of the field of the parameter schema.
This is relatively simple to do...
You need to first load an instance of the EmbeddedSchemaField, then read it's child nodes. It's very easy to visualize if you look at the XML of the component:
<Content>
<Field>Some value</Field>
<EmbeddedField>
<Key>Key</Key>
<Value>Value</Value>
</EmbeddedField>
</Content>
In c# you'd write something along these lines:
ItemFields content = new ItemFields(component.Content, Component.Schema);
ItemField embeddedField = (ItemFields)content["EmbeddedField"];;
TextField textField = embeddedField["Key"];
String textFieldValue = textField.Value;
Or even simpler if you happen to have the DGX installed.
EDIT
If you know the key name, and want to find the corresponding value, I'd probably use something like a KeyValuePair or a simple Dictionary(String,String)
, load the various key/value pairs into it the first time you try to load a value, then use simple String value = dictionary[key]
in my code.