canton7
canton7
CC#
Created by casualvoid on 1/20/2025 in #help
WPF Snake Game problem
Can you put it on github and post a link? Downloading a zip is risky, and most people won't do it
5 replies
CC#
Created by Okno on 1/3/2025 in #help
Compilation issue with source generator
You did give the design doc a read? Then great, you'll know that you can't store symbols in your generator models, and you'll know why 🙂
27 replies
CC#
Created by Ruttie on 1/6/2025 in #help
Inline if conditionals in dotnet new template
(not that it's any prettier tbh)
12 replies
CC#
Created by Ruttie on 1/6/2025 in #help
Inline if conditionals in dotnet new template
public partial class MyTemplateClass : BaseClass
{

}

#if USE_INTERFACE
partial class MyTemplateClass : IMyInterface { }
#endif
public partial class MyTemplateClass : BaseClass
{

}

#if USE_INTERFACE
partial class MyTemplateClass : IMyInterface { }
#endif
12 replies
CC#
Created by Ruttie on 1/6/2025 in #help
Inline if conditionals in dotnet new template
You can also use partial classes
12 replies
CC#
Created by SlimeShulker on 1/4/2025 in #help
Please can somebody help me with this .txt file?
That's no different to what OP is doing, except using more lines
14 replies
CC#
Created by SlimeShulker on 1/4/2025 in #help
Please can somebody help me with this .txt file?
Maybe you've got 2 files called dna.txt in different folders, and it's not reading the one you expect?
14 replies
CC#
Created by SlimeShulker on 1/4/2025 in #help
Please can somebody help me with this .txt file?
I'm afraid there's not much we can do to help. Yes, the 2 lines of code you're posted should do what you describe
14 replies
CC#
Created by cone on 1/3/2025 in #help
College project
That looks like a console application should be fine, IMO
252 replies
CC#
Created by Okno on 1/3/2025 in #help
Compilation issue with source generator
Can you make that screenshot bigger so that it doesn't clip the right-hand side (or just post text)?
27 replies
CC#
Created by Arsenic on 12/29/2024 in #help
✅ Base64
Whether it has much effect depends on how compressible your data is
9 replies
CC#
Created by Arsenic on 12/29/2024 in #help
✅ Base64
You might be able to compress your data (you'd typically want to do this on the binary data before turning it into base64)
9 replies
CC#
Created by MechWarrior99 on 12/24/2024 in #help
High performances way to access members?
SGs are supposed to be incremental. As in, they just re-generate what they need on each keystroke, and cache the rest. Therefore, generating small bits of code is good, because you can re-generate a small bit and cache the rest
14 replies
CC#
Created by KikiZC on 12/24/2024 in #help
Desktop icons
5 replies
CC#
Created by KikiZC on 12/24/2024 in #help
Desktop icons
5 replies
CC#
Created by MechWarrior99 on 12/24/2024 in #help
High performances way to access members?
Look at e.g. how the System.Text.Json SG does it
14 replies
CC#
Created by MechWarrior99 on 12/24/2024 in #help
High performances way to access members?
The current advice for SGs is to only process objects marked with an attribute. The problem isn't compiling the generated code, but re-generating the code on every keystroke
14 replies
CC#
Created by MechWarrior99 on 12/24/2024 in #help
High performances way to access members?
The C# compiler is quick: I wouldn't worry too much about a few extra classes
14 replies