Quantcast
Channel: User Sinatr - Stack Overflow
Browsing all 601 articles
Browse latest View live
↧

Comment by Sinatr on How to hide base class method from derived class when...

The inheritance is useful if B is A. Maybe in your case it's not a case and you need composition?

View Article


Comment by Sinatr on Using a static AsyncLocal for an "AsyncFlowId"

_asyncFlowId.Value should be thread safe, according to docs: "AsyncLocal<T> instances can be used to persist data across threads". The changes from other thread shouldn't be seen, no need to sync.

View Article


Comment by Sinatr on Trying to get the number of weeks as displayed in a...

@David, June, 2025 in Germany, should be indeed culture related.

View Article

Comment by Sinatr on WinUI 3 Published Application loads then nothing

Similar issue? You need to add more details to question, namely how you publish. I guess you don't have <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained and that likely require...

View Article

Comment by Sinatr on Thread safe Dictionary with items usage count and auto...

Consider using code-review.

View Article


Answer by Sinatr for Trying to get the number of weeks as displayed in a...

You are missusing GetWeekOfYear parameters, the last one should be same value for both calls, e.g. DayOfWeek.Monday.The correct value of firstWeek is 22, not 23 (fiddle).

View Article

Comment by Sinatr on Is there a C# attribute on a record field to exclude a...

With too many fields you may want to extract ignored fields into another record. This new record can work as a wrapper to hold ignored fields and original record (without ignored fields) as a new...

View Article

Comment by Sinatr on Correct use of ThrowIfCancellationRequested

IsCancellationRequested is useful when you need to do something before throw. It's mentioned on msdn (comment in example).

View Article


Comment by Sinatr on Dynamically extending/loading a formular

Creating controls in another tread is bad idea. To speed up form loading you can make it asynchronous: don't create/initialize ALL controls at once, rather one by one (or in small groups), giving...

View Article


Comment by Sinatr on What's the meaning of the following C++ code?

ChatGPT is particularly good at explaining written code.

View Article

Comment by Sinatr on Debug in VS2017. Can't watch constant value that...

@Logarr, that's correct, you forced me to try on a new project and .. it works. So can't reproduce.

View Article

Comment by Sinatr on Using AI to determine which function to execute

Those are requirements, not a question. What doesn't work or first thing you don't know? That might be a good question and likely already answered.

View Article

Comment by Sinatr on Using a breakpoint in a multi-threaded C# application

If question is what is freeze/thaw, then according to docs, it's suspend/resume. I don't understand your explanation of those to confirm if it's correct or not.

View Article


Comment by Sinatr on What is the purpose of empty try block in the...

Don't be confused by code which does nothing. Why this construct is still in code? Probabaly it had some code in try-block, code was removed, try/finally wasn't.

View Article

Comment by Sinatr on NamedPipeClientStream cannot connect without UAC

" Is there really no way to connect to a pipe without admin permissions?" - yes, there is a way, when pipes are used strictly for IPC. Using server and client constructor with just pipe name will...

View Article


Answer by Sinatr for Images Layout in FlowDocument

You need to put multiple images into same BlockUIContainer, using WrapPanel as its child.Here is xaml to demonstrate, converting it to code-behind should be fairly straightforward, you will need to...

View Article

Comment by Sinatr on FileNotFoundException: Could not load file or assembly...

It may be a good case to "report a problem" to microsoft. They may look into it, ask for logs, instruct you how to get logs, look at first error in logs (totally unrelated), tell you something...

View Article


Comment by Sinatr on What is the correct way to set up...

XY problem, don't use generic interface as base class for any T, that won't work. Nor it's clear why dictionary, the database would be more correct approach here. If you want dictionary, use...

View Article

Comment by Sinatr on Adding controls to a table layout panel on an unselected...

Your code isn't working. There is a bug. To find the bug one needs to be able to go through. Please refer to minimal reproducible example. We don't know what is tableLayoutPanel2, nor what results2 is....

View Article

Comment by Sinatr on .NET 8 runtime installed without admin rights

Is the "manage the runtime installation" original problem? It's not clear what scenario you have, but I see no problem to inform user about update and help them to get it, but let installer completely...

View Article
Browsing all 601 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>