dond~
dond~
CC#
Created by dond~ on 10/8/2023 in #help
❔ Getting property from object based on input
Hmm okay, thanks. Would it be faster if I make a seperate method per type of value? So like changePropertyString(string property, string value) changePropertyInt(string property, int value Etc.
23 replies
CC#
Created by dond~ on 10/8/2023 in #help
❔ Getting property from object based on input
So function should look something like this:
private void changeProperty(string property, T value)
{
myObject.property = value
}
private void changeProperty(string property, T value)
{
myObject.property = value
}
And then T is the type, because I have different types of properties within my object
23 replies
CC#
Created by dond~ on 10/8/2023 in #help
❔ Getting property from object based on input
I have like 10 buttons that all change different values and instead of creating 10 different functions, I was wondering if it possible to combine that into one function
23 replies
CC#
Created by dond~ on 10/8/2023 in #help
❔ Getting property from object based on input
And I want to be able to pass the property that I want to change as well as the new value
23 replies
CC#
Created by dond~ on 10/8/2023 in #help
❔ Getting property from object based on input
Well upon pressing a button, I want to change a value
23 replies
CC#
Created by dond~ on 10/8/2023 in #help
❔ Getting property from object based on input
There that is better
23 replies
CC#
Created by dond~ on 10/8/2023 in #help
❔ Getting property from object based on input
There's quite a lot of them so I didn't copy paste all of them
23 replies
CC#
Created by dond~ on 10/8/2023 in #help
❔ Getting property from object based on input
Oh yea, they are, I just made a wrong example
23 replies
CC#
Created by dond~ on 10/8/2023 in #help
❔ Getting property from object based on input
There are no other objects in there
23 replies
CC#
Created by dond~ on 10/8/2023 in #help
❔ Getting property from object based on input
Some different values, so something like this:
public class myObject
{
public string Name{ get; set; }


public string Password{ get; set; }


public int IntProperty{ get; set; }


public double DoubleProperty { get; set; }
}
public class myObject
{
public string Name{ get; set; }


public string Password{ get; set; }


public int IntProperty{ get; set; }


public double DoubleProperty { get; set; }
}
23 replies
CC#
Created by dond~ on 10/8/2023 in #help
❔ Getting property from object based on input
Right now I have like 4 different functions to update a single property, for example:
public void changeA(string newA)
{
myObject.A = newA
}
public void changeA(string newA)
{
myObject.A = newA
}
23 replies
CC#
Created by dond~ on 10/8/2023 in #help
❔ Getting property from object based on input
I don't want to make a function for every seperate part
23 replies
CC#
Created by dond~ on 10/8/2023 in #help
❔ Getting property from object based on input
The object is pulled from a database and I need to sometimes update things of it
23 replies
CC#
Created by dond~ on 7/7/2023 in #help
Picturebox not displaying my pictures
Well sorry about this, I screwed up the load event in the properties of my form... Works properly now
7 replies
CC#
Created by dond~ on 7/7/2023 in #help
Picturebox not displaying my pictures
I guess I can change it in the gui but I want the images to load when the form loads
7 replies
CC#
Created by dond~ on 7/7/2023 in #help
Picturebox not displaying my pictures
i dont think there's much other debugging i can do because the code i posted above is all the code i have
7 replies
CC#
Created by dond~ on 7/7/2023 in #help
Picturebox not displaying my pictures
picture1 and picture2 both exist in my resources tab
7 replies
CC#
Created by dond~ on 6/18/2023 in #help
❔ Call an API, get information and then display it on an ASP.NET app
That worked! I can create a table with that thanks
104 replies
CC#
Created by dond~ on 6/18/2023 in #help
❔ Call an API, get information and then display it on an ASP.NET app
Ah let me try that
104 replies
CC#
Created by dond~ on 6/18/2023 in #help
❔ Call an API, get information and then display it on an ASP.NET app
Cannot implicitly convert type 'Microsoft.AspNetCore.Mvc.ViewResult' to 'System.Collections.Generic.Dictionary<string, ASPWebApp.Models.GTINKeeper>' [ASPWebApp]
Cannot implicitly convert type 'Microsoft.AspNetCore.Mvc.ViewResult' to 'System.Collections.Generic.Dictionary<string, ASPWebApp.Models.GTINKeeper>' [ASPWebApp]
104 replies