Join collection of objects into comma-separated string
string.Join(“, “, Array.ConvertAll(somelist.ToArray(), i => i.ToString()))
string.Join(“, “, Array.ConvertAll(somelist.ToArray(), i => i.ToString()))
void Foo() { throw new OutOfMemoryException(); } :)))
Deadlock in System.Component.TypeDescriptor [closed]
They didn’t add a default mechanism for binding to dynamic objects and instead added a new interface ICustomTypeProvider. And that interface wasn’t added to an ExpandoObject either, but with expando you should be able to use the indexer binding since it is an IDictionary<string, object> that implements INotifyPropertyChanged. <TextBlock Text=”{Binding [Foo]}”/>
Microsoft Connect Discussion Here is some code to workaround: static int CompareStringUsingSortKey(string s1, string s2) { SortKey sk1 = CultureInfo.InvariantCulture.CompareInfo.GetSortKey(s1); SortKey sk2 = CultureInfo.InvariantCulture.CompareInfo.GetSortKey(s2); return SortKey.Compare(sk1, sk2); }
There is the C# 5 CTP, which performs a continuation-passing-style transformation over methods declared with the new async keyword, and continuation-passing based calls when using the await keyword. This is not actually a new CLR feature but rather a set of directives for the compiler to perform the CPS transformation over your code and a … Read more
If you have virtual members that are going to be invoked during construction (against best advice, but we’ve already agreed on that), then you need to move your initialization into a separate method, that can protect itself against multiple calls (i.e. if init has already happened, return immediately). That method will then be invoked by … Read more
Would the better solution be to just use F# where you want true immutability?
Pretty old question. Wonder why anyone hasn’t answered it till now. OK, I’ll try and share things from my experience. A BindingSource is more than just a way to bind controls to collections. After having worked in WinForms for over a decade, the best features of a BindingSource that I like the most include: Binding … Read more
We have recently had a similar problem on the machines of several customers. The problem turned out to be a bug in the MSHTML control in certain environments. A common symptom for the problem seems to be the broken registration of the jscript.dll library. Symptoms that may help to diagnose if it’s the same problem … Read more