senox13
senox13
CC#
Created by MrScautHD on 8/22/2023 in #help
❔ Is there a way to override a Variable in the .csproj by a project that is reference this project?
Well yeah, if you build your project for distribution, the .csproj will not be included. It's exclusively a development construct
10 replies
CC#
Created by senox13 on 8/22/2023 in #help
❔ Sharpie-Curses fails to find curses lib on Windows
Well, I swear there's some mystical effect by which the solution to a problem will only present itself immediately after you ask for help in a public place. It seems that installing the package Sharpie-Libs-PdCurses, I can get the demo projects to work, which is good enough for me. Still no idea why the bundled libs don't get found, but at this point I've accepted not understanding it
3 replies
CC#
Created by MrScautHD on 8/22/2023 in #help
❔ Is there a way to override a Variable in the .csproj by a project that is reference this project?
Oh hey, I recognize you 👋 It seems like you can override .csproj properties using a .targets file? It might help if you specify exactly what you want to override https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-your-build
10 replies
CC#
Created by Ted Bunny on 8/23/2022 in #help
Abstract List of KeyValuePairs
Depending on the performance requirements of this code, I'd be inclined to suggest just implementing your own MultiDictionary type. Sounds like it'd make for a cleaner end product
15 replies
CC#
Created by Binto86 on 8/18/2022 in #help
set default value of parameter to other parameter [Answered]
I'd definitely opt for my initial chunk of code there. It'll be half the typing to document
16 replies
CC#
Created by Binto86 on 8/18/2022 in #help
set default value of parameter to other parameter [Answered]
Irrelevant if you aren't adding XML docs
16 replies
CC#
Created by Binto86 on 8/18/2022 in #help
set default value of parameter to other parameter [Answered]
Yep, both can be used exactly the same ways, though the first would be more DRY to document imo
16 replies
CC#
Created by Binto86 on 8/18/2022 in #help
set default value of parameter to other parameter [Answered]
public void MyMethod(string x, string y=null)
{
if(y==null)
x=y;
//some code
}
public void MyMethod(string x, string y=null)
{
if(y==null)
x=y;
//some code
}
16 replies
CC#
Created by Binto86 on 8/18/2022 in #help
set default value of parameter to other parameter [Answered]
Or null, since it's a string
16 replies
CC#
Created by Binto86 on 8/18/2022 in #help
set default value of parameter to other parameter [Answered]
There could absolutely be cases in which that makes sense. You can do that at the beginning of the method and use a sentinel value for the default argument value
16 replies