mtreit
mtreit
CC#
Created by RobG66 on 4/30/2025 in #help
Enumerating "Open With" applications and populating a menu
I don't know anything about UWP unfortunately.
20 replies
CC#
Created by RobG66 on 4/30/2025 in #help
Enumerating "Open With" applications and populating a menu
It might need some cleanup to handle edge cases, errors, etc.
20 replies
CC#
Created by RobG66 on 4/30/2025 in #help
Enumerating "Open With" applications and populating a menu
20 replies
CC#
Created by RobG66 on 4/30/2025 in #help
Enumerating "Open With" applications and populating a menu
Here is a sample console program that show the basic idea:
20 replies
CC#
Created by RobG66 on 4/30/2025 in #help
Enumerating "Open With" applications and populating a menu
You need to get the progids for a given extension and use that to look up the handler.
20 replies
CC#
Created by RobG66 on 4/30/2025 in #help
Enumerating "Open With" applications and populating a menu
If you are on Windows and want to look up the available file type handlers, you can do that via the Windows registry.
20 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
Like a classic bug is this:
public struct Point
{
public int X { get; set; }
public int Y { get; set; }
}

public class Widget
{
public Point Location { get; set; }
}
public struct Point
{
public int X { get; set; }
public int Y { get; set; }
}

public class Widget
{
public Point Location { get; set; }
}
and then you have code like this:
var w = new Widget();
w.Location.X = 42;
var w = new Widget();
w.Location.X = 42;
...and it doesn't get "updated" because of copy semantics with value types.
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
Unless you have some struct copy thing happening.
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
I think you are either doing something wrong or completely mis-diagnosing the issue because changing the value of a member of a reference type will absolutely update the instance being referred to 🙂
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
Variable capture in a closure could be an issue, yeah.
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
Then the reference you are using is to change the value of the member must be pointing to a different instance.
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
There is no "snapshot" behavior for reference types.
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
Unless I'm missing something.
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
What you are describing only makes sense if it's a struct.
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
Is UdpConnection a struct?
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
I read this multiple times and don't quite understand what you are saying the problem is.
55 replies
CC#
Created by quarterwire on 3/31/2025 in #help
✅ LEARN C# in 2025
I have no opinion on Unity but it uses an older non-modern version of .NET and C# and folks here who are familiar with it say don't try to learn Unity until you have a good grasp of C# itself.
44 replies
CC#
Created by quarterwire on 3/31/2025 in #help
✅ LEARN C# in 2025
It's just terrible.
44 replies
CC#
Created by quarterwire on 3/31/2025 in #help
✅ LEARN C# in 2025
Avoid the Yellow Book at all costs.
44 replies
CC#
Created by quarterwire on 3/31/2025 in #help
✅ LEARN C# in 2025
I probably learned C# before you were born so I'm not too up to speed on the most recent books, but The C# Players Guide and Head First C# both have good reputations.
44 replies