computed

MarkupExtension as computed property in Template

Having such MarkupExtension public class Extension1 : MarkupExtension { private static int _counter = 0; public override object ProvideValue(IServiceProvider serviceProvider) { return string.Format("Item {0}", _counter++); } } and this XAML <ListBox> <ListBoxItem Content="{my:Extension1}"></ListBoxItem> <...

Get actual margins of an html element in c#

I need to get the actual number of pixels that an IHTMLElements margin is taking up, in my c# code. I've looked in it's style and currentStyle members, but the relevant parts are either null or set to "auto". Searching the internet has shown up the getCurrentStyle function in javascript, but I need these numbers in my c# code. Obvious...

SQL -- Derive Date Difference Column

+------+-------------------------+ | proc | endTime | +------+-------------------------+ | A | 2010/01/01 12:10:00.000 | | B | 2010/01/01 12:08:00.000 | | C | 2010/01/01 12:05:00.000 | | D | 2010/01/01 12:02:00.000 | | ...| ... | So basically the data I pull from SQL will look somethin...

XQuery wrap result in computed node

Hi I am trying to do some simple pagination in XQuery. I would like my root element of the returned XML to have (as attributes) various properties about the pagination (current page etc). However I can't seem to find a way to add these dynamic attributes to my root element. I've tried playing with the element name {expr} and attribute ...

Best getComputedStyle() scripts?

I've heard of a few scripts that can return the computed/rendered style of an HTML element. I've found that simply using currentStyle and computedStyle will often be buggy. In addition, simple scripts that find the total offsetLeft/Width will go awry in many cases. Instead of trying to reinvent the wheel (if one exists at all), what are ...