Hi, I am brand new to both Excel DNA and .NET languages, as well as relatively new to programming in general (1 year VBA experience). It has been quite a leap for me to try to take a stab at this and I keep getting lost in terminology when I check the Docs and StackOverflow, but I am trying to persevere!
I am now working in C# and have several functions (methods) that mostly all include the same 7 input arguments and definitions. I would ideally like to declare and decorate the arguments/descriptions in one central location by either using a separate Class or wrapper etc (or any other way really). For example, I use the following arguments, along with a handful of others in over a dozen formulas:
public static int MyFunction1(
[ExcelArgument(Name = "Arg1", Description = "arg1 Description")] int arg1,
[ExcelArgument(Name = "Arg2", Description = "arg2 Description")] int arg2,
[ExcelArgument(Name = "Arg3", Description = "arg3 Description")] string arg3)
I have a specific pattern defined for the input arguments which remains the same, and if I include all 7 arguments with descriptors for every function (method), my code is very quickly going to become both bloated and unmaintainable from all the descriptions.
In my attempts so far, I have tried creating a separate class CommonArguments, but that failed because the ExcelArgument appears to only be allowed to be used when declaring the variables inside a new method. I have also tried at least creating variables for the common descriptions, so that I could shorten each line as well as consolidate the duplicate descriptions to one location by setting (...Description = arg1DescVariable...). However, ExcelArgument is requiring me to use a constant value for the description instead of a variable.
Is this even possible, or does anyone have any recommendations??
Thank you so much!