Doombox
Doombox
CC#
Created by sashok on 6/28/2024 in #help
Unable to get the FieldInfo's value
but if you know for sure it's a Unity problem it might be a bit easier to find a solution with google at least
7 replies
CC#
Created by sashok on 6/28/2024 in #help
Unable to get the FieldInfo's value
might have to use type.GetFields(BindingFlags.Instance | BindingFlags.Public) but I'm not 100%, I try to avoid reflection in Unity
7 replies
CC#
Created by sashok on 6/28/2024 in #help
Unable to get the FieldInfo's value
very much a "works on my machine" moment
7 replies
CC#
Created by sashok on 6/28/2024 in #help
Unable to get the FieldInfo's value
No description
7 replies
CC#
Created by Somgör from Human Resources on 6/18/2024 in #help
Avalonia ViewLocator not ViewLocating
or calling new MainViewModel() somewhere
9 replies
CC#
Created by Somgör from Human Resources on 6/18/2024 in #help
Avalonia ViewLocator not ViewLocating
How is ContentViewModel being bound in your view? Though that shouldn't really matter, if you're setting that property to a value, Avalonia shouldn't be setting it back to null
9 replies
CC#
Created by IVIICHAELxx on 3/9/2024 in #help
How can I fetch identical strings concatenated with 1 and so on at the end through this dictionary
or if you know 100% that the maximum number of any instance is say 10, you could just do a query for all 10 in a for loop, which may or may not be a bit more efficient too, ymmv
10 replies
CC#
Created by IVIICHAELxx on 3/9/2024 in #help
How can I fetch identical strings concatenated with 1 and so on at the end through this dictionary
if you know 100% that att2 would only exist if att1 also definitely existed you could use the first solution I posted which would be a bit more efficient
10 replies
CC#
Created by IVIICHAELxx on 3/9/2024 in #help
How can I fetch identical strings concatenated with 1 and so on at the end through this dictionary
it's a little inefficient because you're doing a string comparison on the entire dictionary, but it would get everything that starts with a given name
10 replies
CC#
Created by IVIICHAELxx on 3/9/2024 in #help
How can I fetch identical strings concatenated with 1 and so on at the end through this dictionary
yup
foreach(var result in someDictionary.Where(x => x.Key.StartsWith("keyframe_rope"))
{
// do something with the key/value pair "result" here.
}
foreach(var result in someDictionary.Where(x => x.Key.StartsWith("keyframe_rope"))
{
// do something with the key/value pair "result" here.
}
would do that
10 replies
CC#
Created by IVIICHAELxx on 3/9/2024 in #help
How can I fetch identical strings concatenated with 1 and so on at the end through this dictionary
var baseName = "keyframe_rope";
var searchName = baseName;
var i = 1;
while(someDictionary.TryGetValue(searchName, out var res))
{
// do something with the result here
searchName = $"{baseName}{i++}";
}
var baseName = "keyframe_rope";
var searchName = baseName;
var i = 1;
while(someDictionary.TryGetValue(searchName, out var res))
{
// do something with the result here
searchName = $"{baseName}{i++}";
}
would work with the dictionary itself and prevent you just querying every key this assumes that every index is in there with no gaps or you could do this:
foreach(var result in someDictionary.Where(x => x.Key.StartsWith("keyframe_rope"))
{
// do something with the key/value pair "result" here.
}
foreach(var result in someDictionary.Where(x => x.Key.StartsWith("keyframe_rope"))
{
// do something with the key/value pair "result" here.
}
which would just broadly get them all regardless of that, whilst being a bit easier to read :catshrug:
10 replies
CC#
Created by IVIICHAELxx on 3/9/2024 in #help
How can I fetch identical strings concatenated with 1 and so on at the end through this dictionary
are you looking for basically every instance of keyframe_rope_n in a dictionary where n is unknown?
10 replies
CC#
Created by toast12 on 2/23/2024 in #help
How to create a button that makes a sound when pressed in C#
WPF has MediaPlayer
5 replies
CC#
Created by toast12 on 2/23/2024 in #help
How to create a button that makes a sound when pressed in C#
you can use SoundPlayer to play .wav files
5 replies
CC#
Created by toast12 on 2/23/2024 in #help
How to create a button that makes a sound when pressed in C#
it depends which framework you are using and what file type you want to play
5 replies
CC#
Created by Kavika on 12/27/2023 in #help
Deploy Kiosk App to Windows 10
2 replies
CC#
Created by Indeed on 12/24/2023 in #help
WPF with html-css alike framework?
Yup, mentioned that, one of the best things about Avalonia
14 replies
CC#
Created by Indeed on 12/24/2023 in #help
WPF with html-css alike framework?
the only other major downside is the horrendous payload bloat, but that's completely irrelevant on a desktop app
14 replies
CC#
Created by Indeed on 12/24/2023 in #help
WPF with html-css alike framework?
Blazor mainly sucks because of the performance more than anything else, I'm not sure how well it runs under MAUI
14 replies
CC#
Created by Indeed on 12/24/2023 in #help
WPF with html-css alike framework?
ASP.NET MVC is another option if you're dead set on Html/Css, and that isn't going anywhere
14 replies