.net

Ideas for good class name

How would you name a class with the following public interface: /// <summary> /// Enqeues and exectutes actions synchronously on seperated threads using the <see cref="ThreadPool"/>. /// </summary> /// <remarks> /// Syncronism is guaranteed on a per-instance base in that each enqued action will be executed /// after the pre...

Binary vs. Soap Binding - WCF Service Performance

For my thesis I need to measure the performance of Binary Binding vs. basicHttp(Soap) Binding in WCF Services and a Silverlight Client for a specific object. I already found some example performance data for these bindings. I wonder how to measure them by myself for a specific object. Are there any tools which make this process easy o...

Binding Label and Value to ComboBox Winforms

I have this code Public Sub FillCategoryCombobox(ByVal categoryList As List(Of tblCategory), ByVal LvName As ComboBox) LvName.Items.Clear() Dim itemValue = New Dictionary(Of Integer, String)() For Each category As tblCategory In categoryList itemValue.Add(category.CategoryID, category.CategoryName) Next category ...

Own event for custom UserControl in XAML!

I want to create an own event (which I'll fire via code) for a CustomControl via XAML. This would allow me to add a trigger for an animation which I create in XAML. ...

COM+: ApplicationException instead of thrown exception

I got a ASP.net webservice which calls a COM+ component. A class in the COM+ component throws an exception which I want to handle. But ApplicationException is caught by the webbservice instead of the real exception. Why is that? Edit: Exception details System.ApplicationException: Error in the application. at System.Runtime.Intero...

Get string property name from expression

I'm trying to write a strongly typed helper which would be something like this: Html.Lookup(x => x.FooId); for now I have this: public static MvcHtmlString Lookup<T,TReturn>(this HtmlHelper<T> html, Func<T, TReturn> expression) { // get string "FooId" here } anybody knows how to get this ? ...

Is it possible to use WCF to communicate with Windows kernel mode software?

WCF supports some interoperability bindings. Does any of these bindings allow to communicate with kernel mode sw? AFAIK kernel mode sw can open named pipes, in the Local System security context. Are those named pipes interoperable with WCF? ...

How to circumvent sender's write-protection in events?

I have a ColorAnimation inside a Storyboard. After that Storyboard finishes I want to change a property of the ColorAnimation within it. Sadly all sender's attributes seem to be write-protected, so how can I circumvent it? Here is the code: storyboard.Completed += new EventHandler(storyboard_Completed); void storyboard_Completed(ob...

calling java axis2 webservice (with omelement params) from c#

Hey guys, I want to call a webservice which expects a OMElement-parameter. How can I serve this with c# / .net? The signature of the generated client looks like this: client.ExecuteMethod(object param); Thx in advance, macx ...

Divide Array value with Array value

So I need to divide array value with array value. I'm using float multi-dimensional arrays. Here is the code: myNumbers = new float[3, 4]; float[] tempNumbers; myNumbers[0, 0] = 3; myNumbers[0, 1] = -6; myNumbers[0, 2] = 3; myNumbers[0, 3] = -12; /* for (int i = 0; i < 4; i++) { myNumbers[0, i] = myNumbers[0, i] / myNumbers[0, 0]...

WPF - Mixing style defined in dictionary with style defined in parent control

I define custom look for Button control in resource dictionary: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; <Style TargetType="Button" x:Key="BaseButtonStyle"> <Setter Property="Background" Value="Blue"/> </St...

WebClient.OpenRead exception: "Value cannot be null."

I'm developing a scraper that scrapes one web page for links, then creates threads which execute scraping of subpages. This is what a thread does: Dim client As New WebClient() Dim stream As Stream = client.OpenRead(_Address) Dim streamReader As New StreamReader(stream, True) _Content = streamReader.ReadToEnd() streamReader.Close() st...

.Net MVC: Set Model property from Javascript

So this seems like it should be simple. I'd like to set a public model property from javascript that's fired on the mouseover of an image. So something like this: Html: ...img src="<%=Model.AppDetails.Logo%>" onmouseover="showMenu(this);... Javascript: function showMenu(app) { <%Model.CurrentId = app.id%> //app.id is of course u...

XMLDocument, problem reading Node...

Hello, I am doing the following: System.Net.WebRequest myRequest = System.Net.WebRequest.Create("http://www.atlantawithkid.com/feed/"); System.Net.WebResponse myResponse = myRequest.GetResponse(); System.IO.Stream rssStream = myResponse.GetResponseStream(); System.Xml.XmlDocument rssDoc = new System.Xml.XmlDocument(); rssDoc.Load(...

.Net naming conventions vs W3C specifications

I'm having a hard time resolving a naming convention conflict I'm having with implementing part of the W3C HTML5 specification using .Net. The issue is that I like to conform to standard .Net naming conventions, which use UpperCamelCasing, but the W3C specifications indicate that the naming conventions should use lowerCamelCasing. Shou...

membership profile properties

Hello, I have a bunch of site's that use the .net membership profile. Some of the sites have 1000+ users with profiles. Is it safe to add new profile elements? Like if I want to add: twitter account as a profile element. Will this have any conflicts with existing profiles? http://msdn.microsoft.com/en-us/library/ms164644.aspx from m...

Is there any way to get smooth (preferably Windows default) animations in my .NET winforms app?

In my application I'd like to provide some animations while a lengthy operation is in progress. Currently I'm at the "connecting to server" stage, which typically takes over 5 seconds. During this I'd like to display some animation to the user. I've already implemented the popular solution with a PictureBox and an AJAX loading gif, but ...

How can I get Audiere to output to a file?

My (C#, .NET) application uses the Audiere library for audio output. The requirements have grown to include output to a file (i.e. wav or mp3). Is there anyway for Audiere to do this natively? Or is there a way to capture its output and write it to a file? ...

How do I need to modify my WinForms app to also run in the console?

I have a .NET WinForms app written in C#. In order to support batch operations, I'd now like to make the app able to run in the console. Is it possible to have an app that detects on startup whether it is running in the console or not? What modifications do I need to make in order to achieve this behaviour? ...

How to keep user settings on uninstall

I'm using .NET user settings feature and I'm facing a problem. When the application is uninstalled, then installed back, the user settings are lost. I understand it's by design, and I want to be able to give the choice to the user in the installer. Could you please give me some pointers to articles or documentation that will helps me?...