You searched for how does c# work
. We found 81
results in 0.272 seconds.
You could make the interface internal, and use InternalsVisibleToAttribute to allow B access to the internal members of A (by adding the attribute to A). It's very coarse-grained though - you can't do it for individual members; it's all or... more
How does the compiler know that I can't use SystemDefault on .NET 4.5 but can use it on 4.7? Is this done via some kind of API file known to the compiler? Yes, I'd expect it to be done via the reference assemblies. A reference... more
It looks like VB has built-in support for DataTable. Here's a short but complete example: Option Strict On Imports System Imports System.Data Imports System.Linq Public Class LinqTest Shared Sub Main() Dim table as... more
It sounds like you just want to implement IEqualityComparer<ActivitiesActivity>: public class ActivitiesActivityEqualityComparer : IEqualityComparer<ActivitiesActivity> { public bool Equals(ActivitiesActivity x,... more
I think you're confused by what Func<T, TResult> is meant to be. The first parameter (T) is the input to the delegate; TResult is the output. So you probably want: Func<Appointment, DateTime> appointmentFunction = x =>... more
No. In the example you've given, the compiler will only use TaskCompletionSource<T> (indirectly) for the overall asynchronous operation (DownloadDataAndRenderImageAsync). It's up to the two methods that are called to decide how... more
Sounds like you want something more like: // Warning: you should think about time zones... DateTime today = DateTime.Today; DateTime startOfMonth = new DateTime(today.Year, today.Month, 1); DateTime endOfPreviousMonth =... more
If you're nervous that the compiler will optimize out the operator (although I doubt that it would ever do so) you could just call the Add method directly. Note that you don't need to add and then subtract - you can just add 0.000m. So for... more
The simplest approach is to use MethodInfo.IsDefined - quite possibly with LINQ as well: var testMethods = from assembly in assemblies from type in assembly.GetTypes() from method in type.GetMethods() ... more
The problem is that the VTEST_FSUB<V> constructor body is executing before the VTEST_RUN constructor body. So when do_virtual is called, localSMT is still null. Then do_virtual tries to call a method on localSMT, hence the... more