I have several different types of data that I need to do with a function. This data should be processed in the function and returned as an object, which, I believe, is called.
This is some kind of untested code that I just wrote here, but I think it shows what I'm trying to do. Hope you guys can help me how to do this.
private void Button_Click(object sender, RoutedEventArgs e)
{
object thoseProcessedData = SomeTestObject(5, "ABC", SomeOtherThing);
string useItLikeThis = thoseProcessedData.newString;
int numbersLikeThis = thoseProcessedData.newNumber;
}
public object SomeTestObject(int numbers, string letters, AnotherType anothertype)
{
string newString = letters.Substring(0,5);
int newNumber = numbers + 10;
AnotherType newType = anothertype.Something();
return processedData;
}
Please guys do not kill me if this is too stupid a question. Im still very new to C # ..
If you do not get what I'm trying to do, ask! Since my English is not the best, I thought this method would be the best to show you what I want.
source
share