/*CustomAttribute customAttribute;
public CustomAttribute CustomAttribute {
get {
return customAttribute;
}
}*/
public DomCecilAttribute (CustomAttribute customAttribute)
{
//this.customAttribute = customAttribute;
base.AttributeType = DomCecilMethod.GetReturnType (customAttribute.Constructor);
base.Name = customAttribute.Constructor.DeclaringType.FullName;
try {
// This Resolve call is required to load enum parameter values.
// Without this call, enum parameters are omited.
customAttribute.Resolve ();
} catch {
// If the resolve operation fails, just continue. The enum parameters will
// be omited, but there will be other parameters
}
foreach (object par in customAttribute.ConstructorParameters)
AddPositionalArgument (new System.CodeDom.CodePrimitiveExpression (par));
foreach (System.Collections.DictionaryEntry entry in customAttribute.Properties)
AddNamedArgument ((string)entry.Key, new System.CodeDom.CodePrimitiveExpression (entry.Value));
foreach (System.Collections.DictionaryEntry entry in customAttribute.Fields)
AddNamedArgument ((string)entry.Key, new System.CodeDom.CodePrimitiveExpression (entry.Value));
}