Re: [ADVANCED-DOTNET] Loading Entities & Reporting Problems

2007-05-11 Thread Ron Young
You mention "notification" which is key, I think, in finding a solution. Say the data access class has an event: class EmployeeDAL { event void DataLoadFailed(object sender, DataLoadFailedEventArgs e); List GetList() { // data access returns data reader while (reader.Read()) {

[ADVANCED-DOTNET] Loading Entities & Reporting Problems

2007-05-11 Thread Shane Courtrille
I've been working with loading entities from databases lately. One of the problems you sometimes run into is an entry that can't be loaded properly. For some reason or other some of the data associated with it is bad. Now at this point you could throw an exception but you might not want to inter

Re: [ADVANCED-DOTNET] NetworkStream.BeginWrite: Does it write all the requested bytes ??

2007-05-11 Thread Stoyan Damov
On 5/11/07, Tony Hal <[EMAIL PROTECTED]> wrote: If that's the case, NetworkStream does not add much value to me. It's just a decorator/adapter, it's purpose is not to replace Socket, but to adapt it to Stream's "interface" so that you can easily use it with readers/writes, such as BinaryReader/

Re: [ADVANCED-DOTNET] NetworkStream.BeginWrite: Does it write all the requested bytes ??

2007-05-11 Thread Tony Hal
If that's the case, NetworkStream does not add much value to me.> Date: Fri, 11 May 2007 09:05:52 +0300> From: [EMAIL PROTECTED]> Subject: Re: [ADVANCED-DOTNET] NetworkStream.BeginWrite: Does it write all the requested bytes ??> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM> > The docs on Socket.Begi

Re: [ADVANCED-DOTNET] Displaying an image in a WebBrowser without saving it to disk first (WinForms)

2007-05-11 Thread Zac Bowling
You can use my tiny little HTTP server I wrote in C# and have it bind against localhost to some random port. You can steal the source here: http://www.polystimulus.com/newshout.zip (I'm using it here to transform one XML format used by older Winamp clients from the new format used by the new ver

Re: [ADVANCED-DOTNET] Displaying an image in a WebBrowser without saving it to disk first (WinForms)

2007-05-11 Thread Fernando Tubio
I'm not 100% sure but I don't believe that this is necessary if you are registering a temporary protocol handler for your own process. Regards, Fernando Tubio - Original Message - From: "Efran Cobisi" <[EMAIL PROTECTED]> To: Sent: Friday, May 11, 2007 10:04 AM Subject: Re: [ADVANCED-DO

Re: [ADVANCED-DOTNET] Displaying an image in a WebBrowser without saving it to disk first (WinForms)

2007-05-11 Thread Eyvind Axelsen
-Opprinnelig melding- Fra: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] På vegne av Efran Cobisi < That's a good point but, afaik, it would require access to the registry with administrative privileges to be set up. And it seems the target user of this app could not have

Re: [ADVANCED-DOTNET] Displaying an image in a WebBrowser without saving it to disk first (WinForms)

2007-05-11 Thread Efran Cobisi
That's a good point but, afaik, it would require access to the registry with administrative privileges to be set up. And it seems the target user of this app could not have those privileges granted. Or I'm wrong here, Eyvind? -- Efran Cobisi http://www.cobisi.com Fernando Tubio wrote: How about

Re: [ADVANCED-DOTNET] Displaying an image in a WebBrowser without saving it to disk first (WinForms)

2007-05-11 Thread Fernando Tubio
How about implementing an asynchronous pluggable protocol [1]? This is what is used to implement the res:// protocol except that in your case, instead of retrieving your resource from your executable, you can do it from a database. The images could then be displayed by using an appropriate url wi

Re: [ADVANCED-DOTNET] Grayscale images in WPF

2007-05-11 Thread Gregory Miley
Wasn't paying attention when I type this out... // int newColor = (int)(color.R/3 + color.G/5.9 + color.B/1.1); Should actually be // int newColor = (int)(color.R*0.3 + color.G*0.59 + color.B*0.11); Sorry, was trying to type that out from memory. Obviously that didn't work out quite righ

Re: [ADVANCED-DOTNET] Grayscale images in WPF

2007-05-11 Thread Gregory Miley
You can convert an image to grayscale simply by creating an average of each pixels color components. Bitmap bmp = new Bitmap(oldBmp.Width, oldBmp.Height) for(int x = 0; bm.Width; x++) { for(int y = 0; bm.Height; y++) { Color color = oldBmp.GetPixel(x,y); int newColor = (int)(color.R/3

Re: [ADVANCED-DOTNET] Displaying an image in a WebBrowser without saving it to disk first (WinForms)

2007-05-11 Thread Eyvind Axelsen
-Opprinnelig melding- Fra: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] På vegne av Efran Cobisi < A possible solution could be to expose a custom web server (like Cassini [1], for example) inside your own application > We did, actually, at one pint host Cassini within o

Re: [ADVANCED-DOTNET] Displaying an image in a WebBrowser without saving it to disk first (WinForms)

2007-05-11 Thread Efran Cobisi
Okay, this issue has disturbed my sleep too much this night. :) A possible solution could be to expose a custom web server (like Cassini [1], for example) inside your own application and serve from it all of the contents you require. This way, coupled with a proper settings of your WebBrowser con