It took some time to get encoding to match content and xml, so I'm posting this extension method for future reference:
I had access to part of a sharepoint site at http://sharepointserver/areas/myarea (in norwegian http://sharepointserver/omrader/myarea, I think it's called area in english translation) Within the area there was a list I wanted to extract some data from. Started up .Net and created a new winforms-project. Add service reference - Advanced - Add web reference In url I added the string /_vti_bin/Lists.asmx resulting in something like http://sharepointserver/areas/myarea/_vti_bin/Lists.asmx there are other services...
I was changing some code from Silverlight to WPF and ran into this error: Cannot convert lambda expression to type ‘System.Windows.Threading.DispatcherPriority’ because it is not a delegate type The code was something like this gui.BeginInvoke( ()=> { Orders = new ObservableCollection(x); } , null ); The problem is described in detail here: http://visualstudiomagazine.com/articles/2009/02/01/use-lambda-expressions-fo... The article suggests a couple of...
I want to check if a variable contains one of several values, and if so do something about it. Here’s the usual switch way: switch (value) { case 1: case 2: case 3: //do some stuff break; case 4: case 5: case 6: //do some different stuff break; default: //default stuff break; } Does that feel ok to you? To me it’s just feels too verbose and cludgy. In VB it’s possible to write like this: Select Case value Case 1 To 3...
I recently was in a situation where I had to add and change files in a solution that was originally in TFS, but where TFS was unavailable because of migration to new hardware. So I removed source...
I have a list as a result of a join, and it contains duplicates. private IEnumerable LagListeMedSaker(IEnumerable korr, IEnumerable liste) { result = from l in liste join k in korr on l.Saksnummer equals k.Saksnummer select new Sak { Saksnr = l.Saksnummer, Tag = l.Tag }; return result; } The list korr can contain duplicates of the same Saksnummer, even though the korr liste entries are unique in it self, i.e they contain other properties that are different. Now...
Sorry for the title of this post, but a little bit frustrated after using a looong time to find out why my animations didn’t work. I tried rotating two usercontrols on a page, and I constantly got this runtime-error: Cannot resolve TargetProperty (UIElement.Projection).(PlaneProjection.RotationY) on specified object. My setup was a kind of Master-Detail story, where I wanted the details usercontrol to rotate in when selecting an item in my master-control. So I already had my ViewModel, my States and Messages setup...
When changing from manually defining my fields and values in xaml, to defining a custom/templated usercontrol some of my bindings stopped working. I created a custom control with two properties, FeltLabel and FeltVerdi FeltVerdi was defined as a textbox, and in my generic.xaml I had content bound like this: This worked ok for most of the fields I bound to the ViewModel, but for a couple of fields it seemed as if the binding wasn't working anymore. After doublechecking my code and bindings I couldn't...
So I have a class with a method that calls a webservice. I want to bring my class under test, so I have/want to remove the dependency on the webservice. So the usual routine is: - create an interface around dependencies in your class (DLs, Webservicecalls etc) - let the dependencies implement their interface - create constructor in your class that takes in instances of the new interfaces But I just use this one method on the ws, and if I follow this I get - one file for the interface...