I'm filling PDF applications using classes that represent the pdf. I have a property per textbox on the pdf and am using attributes to specify the pdf textbox that the propery maps to. All of my PDF's have the same properties, but the pdf's use different names for the textboxes. So, the only solution I could think of was to create a base class and have each application type extend my base class and override each of the properties just to throw the new attribute value on it. Is there a simpler way?
Example (Notice the only difference between Application1 and Application2 is the ITextField value changes from "TextBox1" to "TextBox2":
public class Application
{
private string accountNumber;
public virtual string AccountNumber
{
get { return this.accountNumber; }
set { this.accountNumber = value; }
}
}
public class Application1 : Application
{
[ITextField("TextBox1")]
public override string AccountNumber
{
get
{
return base.AccountNumber;
}
set
{
base.AccountNumber = value;
}
}
}
public class Application2 : Application
{
[ITextField("TextBox2")]
public override string AccountNumber
{
get
{
return base.AccountNumber;
}
set
{
base.AccountNumber = value;
}
}
}
Thanks