Allow parameter to have more than one value? for example value 1|| value 2 (C#,Light switch)

in my project "Light switch C#", I have a button which take me to a certain screen. The screen take one parameter of type string, for example "Office-Italy","Office- Germany"

My code:

enter code here
   partial void HQ_Execute()
    {
        // Write your code here.
        this.Application.ShowPart_1_SearchBalanceGreaterZero("IC-MOS");

    }

now the question here is, I have 12 office and when I press the HQ (Head office) button I want my filter to be something like *. in other words I want my filter to have this value

this.Application.ShowPart_1_SearchBalanceGreaterZero("IC-MOS"||"IC-IT")

is this possible by anyhow?

Thanks a lot, Zayed

Jon Skeet
people
quotationmark

No, a parameter can't have more than one value. So you'll need to change your method to accommodate what you need, e.g. by changing the parameter so that it's a collection of strings instead of a single string.

You could change the implementation instead, e.g. to allow you to pass "IC-MOS,IC-IT" and split it by commas - but it's clearer (IMO) to specify the values separately.

people

See more on this question at Stackoverflow