.net

.net library for displaying dicom structured reports

I am using clearcanvas library to read and work with dicom files. However, as stated here http://www.clearcanvas.ca/dnn/Community/Forums/tabid/69/aff/8/aft/14041/afv/topic/afpg/1/Default.aspx they don't support dicom structured reports yet. Do you know any other free .net library or dll which I can use for that? Do you have any other sug...

Sorting and paging compiled queries

Is it possible to compile queries which will be used with paging and sorting? For example does this make sense: this.query = CompiledQuery.Compile<...>( .. from row in dbx.Table select row ) .. var select = this.query.OrderBy(..).Skip(..).Take(..); Is this plausible? Or will it recompile every time Order, Skip, Take parameters chang...

Windows Workflow 4.0 & implementing activity timeouts

I have a scenario whereby we need an activity to have a timeout associated with it so that if the activity doesn't complete within a defined period then we move on to a different activity. How would i go about implementing this with Windows Workflow 4.0? Clearly a parallel activity doesn't give me what we want? e.g. If i had an activi...

Select only the lowest values with Linq

Hi I got the following linq for ordering my input after lowest value. But i would like it to only output the lowest values. var sortedDict = (from entry in x where entry.Value > 0 orderby entry.Value ascending select entry); Now if it gets the following input. 3 4 2 6 2 This would be my output 2 2 3 4 6 What do I need to...

"My" namespace has disappeared, and other weirdness.

Hi, I'm currently having to use someone else's login on this PC, basically because I'm the guy who replaced him at the company, and he's now living somewhere on another continent, and nobody can get this project he was working on to set up on any other machine... Anyway, I'm trying to access the "My" namespace, and it's missing everyth...

Setting focus to already opened Tab of Internet Explorer from C# program using .net 2.0

I have two questions. How can I set focus to already opened Tab of Internet Explorer from C# program using .net 2.0. How can I open a new URL in a new Tab of running Internet Explorer instance (not in new window.) from C# program. I can only use .net up to 2.0. Your help will be appreciated. ...

How to name methods that trigger events?

Are there design guidelines on how to name methods that trigger an event in .NET? In different examples I've seen all of: OnPropertyChanged() FirePropertyChanged() TriggerPropertyChanged() RaisePropertyChanged() Of course this is not hugely important, but I'd like to do it the "right" way and not confuse others with unusual naming con...

Having one method wait until a specific event has finished

I have a problem that I have found many similar problems related to multi threading, but noone linked to me specific problem. I have a method that does something, but when the method has been called, I don't want it to return untill a button is clicked. So basically, at the end of the method, I would like it to stay put and wait for th...

How to manage worker thread who wait until they have work to do ?

I have a program that does the following: Call webservice (there are many calls to the same web service) Process the result of 1. Insert result of 2. in a DB So I think it should be better to do some multithreading. I think I can do it like this: one thread is the master (let's call it A) it creates some thread which calls the webs...

sqldatasource insert return identity value

Im using SqlDataSource sds = new SqlDataSource(); in code behind and inserting using sds.Insert(); Please tell me how to get inserted record primary key value? Please note im not using stored procedure. ...

Passing ComObjects in Powershell

Hi! I am trying to call some COM method which uses another COM object as argument via Powershell but I can't get it to work. $dbc = New-Object -ComObject "BMS.MOL.DBConnector" $client = New-Object -ComObject "BMS.MOL.Client" Calling $dbc.GetClient(1, $client) results in an unknown error (translated): Exception during call of "Get...

Castle windsor registering component problem

Hi I've been using Castle project for the first time and facing a problem in registering a component with the container in a console application. Following is the castle.config file: <configuration> <configSections> <section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor" />...

Strange wpf binding

Hi all, I have a problem with bindings in wpf. I've discovered a strange problem. I have class ConfiugrationStringBuilder which inherits from DbConnectionStringBuilder. When I do smth like this public class ConfiugrationStringBuilder : DbConnectionStringBuilder { public string Directory { get;set; } } ConfiugrationStringBuilder buil...

How can I use "nu install ..." to install nhibernate 3 alpha?

Hi all, I've started using nu and I'm really starting to like the way it managed packages for .net libraries. On this page: http://nu.wikispot.org/Current_Packages it says that you can install the nhibernate alpha version with nu, however I can't for the life of me figure out how. Can anyone help me with the command I would need? Tha...

.net: Need samples written by .net in various aspects of programming like Ado.net, web service, user control, ect

hi I was wondering if there be a complete collection of .net code samples with covers various aspects of programming like Ado.net, web service, user control ? Actualy, What I want is some thing like this: Problem: How can we do ......? Solution: .............. .............. ...

Converting a 32 bit wave form to a 16 bit wave form

I've been capturing audio using the loopback capture mode. The captured waveform is a 32 bit waveform. I'm struggling with converting this to a 16 bit waveform so encoders like lame can deal with it (it says Unsupported data format: 0x0003). I've tried shifting the bits (not my strong point) in the wave stream itself from 32 bit to 16...

Difference between Image URI behaviour in code and in XAML

Hi, I have an Image declared in some XAML as: <Image Width="188" Height="56" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="10,0,0,10" Grid.ColumnSpan="2" Grid.Column="0" Source="..\Images\myImage.png" /> This is a static image and does not need to change during program execution. I also have an image which does need...

How to start `powercfg.exe -energy` from a .NET app?

When I using (var process = new Process { StartInfo = new ProcessStartInfo { FileName = "powercfg.exe", Arguments = "-energy", RedirectStandardOutput = true, UseShellExecute = false, } }) { process.Start(); process.WaitForExit(); } It outputs: A biblioteca de Diagnóstico de E...

Monitoring batch requests per second on SQL Server through WMI

I need to programmatically (.NET 3.5, C#) monitor a SQL Server 2008 machine through WMI. I want to measure the number of batch requests per second that the server is receiving; this is what the Windows 7 Performance Monitor tool will show you under the SQL Server:SQL Statistics category, Batch Requests/sec counter. If I monitor the serve...

Should or can Visual Studio run inside App-V and what are the repurcussions?

There is a debate going in our department to virtualize Visual Studio into App-V, Microsofts Application Virtualization. In the back of my mind, I think doing this will cause problems when trying to debug or run other tasks in Visual Studio but I can't put my finger on any one thing to support my argument. Has anyone had any experience...