© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
22 replies
invalidkit0

set with different values

hey everyone, i am a total noob and i want to ask if there is a way for set having different values with different conditions? like
private bool Bool1;

public bool Bool2
{
   get => Bool1;
   if (a = 1) {
      set => Bool2 = true;
   }
   else {
      set => Bool2 = false;
   }
}
private bool Bool1;

public bool Bool2
{
   get => Bool1;
   if (a = 1) {
      set => Bool2 = true;
   }
   else {
      set => Bool2 = false;
   }
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

✅ Set up SpecFlow Logging with 2 different projects
C#CC# / help
4y ago
❔ Designing an api that can create "fields" with different values
C#CC# / help
3y ago
❔ Properties.Settings.Default producing different stored values when called from different winForms
C#CC# / help
3y ago