© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
65 replies
thieved

how can i add a function/method to a class that can be changed upon construction?

namespace Elfin
{
    public class ElfinCommand
    {
        public string Name;

        public ElfinCommand(ElfinCommand data)
        {
            this.Name = data.Name;
            this.Respond = data.Respond;
        }
    }
}
namespace Elfin
{
    public class ElfinCommand
    {
        public string Name;

        public ElfinCommand(ElfinCommand data)
        {
            this.Name = data.Name;
            this.Respond = data.Respond;
        }
    }
}


i'm trying to make a command class but how can i make it so i can provide a response function to the command when i construct a new one? (
this.Respond
this.Respond
)
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

❔ Class method construction using lambda?
C#CC# / help
3y ago
Can I add a field to compiled class?
C#CC# / help
2y ago
❔ How can i acces to a Method that is internal?
C#CC# / help
3y ago
❔ Why can i not override a Method from a class that extend a Interface
C#CC# / help
3y ago