.net

TreeView Winforms if a node can bee seen ?

Hello all I have a treeView , and i want to know if some node can be seen by a user. I mean that no node abave it not needed to be expanded that that node will be seen . Any idea how i can check this with out rotating to upper lever for that ? Checked msdn but couldn't see property responsible for that .... Some Example will really h...

How can I avoid flicker in a WPF fullscreen app?

Hi all, I have a WPF application that is a fullscreen kiosk app. It's actually a pretty complicated app at this point, but here's some code that shows the basic idea. Essentially, whenever the user goes from one screen to the next, there's some serious flicker going on bringing up the new window. In severe cases, the desktop is displ...

How important is it to be fluent in both C# and VB.NET?

I started with VB4 way back in the day, so working in VB.NET isn't entirely new to me. Recently, I've been working mostly with C# (I also have a background in C++), but I started maintaining a project that was written in VB.NET. Most of my existing .NET and VB skills transferred over, which was nice, but I would imagine that other peopl...

unmanaged C program that statically links to a managed DLL: load failure

Yes, this is probably too long. Apologies in advance: This is another iteration of my previous question which was specific to remote desktop. We have an existing product consisting of many programs, which are built in (unmanaged) C. In the recent past we have started adding .NET (managed) applications to our product. A major part o...

Triggering an event every second

I have an application that needs to check a website feed every second. Sometimes the request to the server is longer than a second. In this case, the application needs to wait until the first request completes, then start a new request immediately. How could I implement this? Also, the request should not freeze the GUI. ...

WCF Different authentication method for each endpoint

I have a WCF service. My service has 2 endpoints each of which has a different contact. The service uses custom user name authentication (defined in the customUserNamePasswordValidatorType attribute of under ) The problem is that both endpoins will use the same anthentication method. Is there anyway I can define different anthenticatio...

Access files on a file server via IIS

In an application we are developing, I have access to a database table which gives me the path to some files that are available on a file server. This file server is accessible from the machine on which IIS is running. Is there a mechanism I can use to (on demand) copy a given file from the file server to the web server and make the file...

C# Buddy Classes / Meta Data and Reflection

I am trying to use reflection to check if properties on a given class have a ReadOnly attribute set. The classes I am using are MVC View Models (using a partial "buddy" class for the metadata. public partial class AccountViewModel { public virtual Int32 ID { get; set; } public virtual decimal Balance { get; set; } } [...

.net Trouble casting ints do decimals

Why does this: (new[]{1,2,3}).Cast<decimal>(); result in an InvalidCastException: Specified cast is not valid. ...

Exceptions in ListView rows

I have a ListView with the first column components being RadioButtons and the third column being TextBoxs. The second column is just a Label. I have all this working fine. The problem is that I want the last row to be different. All I wanted was the second column to be a TextBox instead of a label. The content of the listview is binded w...

Why does this object's type show no interfaces via reflection, despite implementing at least two?

First, an example of something that works as expected: (all code was executed in VS2008 immediate window) 25 is IComparable >> true 25.GetType().GetInterfaces() >> {System.Type[5]} >> [0]: {Name = "IComparable" FullName = ... >> [1]: {Name = "IFormattable" FullName = ... >> ... So far so good. Now let's try on an object where t...

Error When Running .NET 3.5 Web App: "The entry 'ScriptModule' has already been added."

Title pretty much says it all. The web.config, unchanged from how VS2008SP1 generated it, has the following lines. <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </httpModules> <system.webServer> ...

Is it possible to create a static dictionary in a C++/CLI environment?

I used in my C++/CLI project static array's like: static array < array< String^>^>^ myarray= { {"StringA"}, {"StringB"} }; Is it possible to create a dictionary the same way? I was not able to create and initialize one. static Dictionary< String^, String^>^ myDic= { {"StringA", "1"}, {"StringB", "2"} }; Thx ...

Preserving the type of a re-thrown exception.

I am writing a class that does operations to multiple streams. Here is a example of what I am doing now Dictionary<int, int> dict = new Dictionary<int, int>(_Streams.Count); for (int i = 0; i < _Streams.Count; i++) { try { dict.Add(i, _Streams[i].Read(buffer, offset, count)); } catch (System.IO.IOException e) ...

NHibernate with SQL Server - How to Process Next New type of Environment

I have an application (ASP.NET MVC) that uses a Next New method to get the next new piece of work. The user clicks on a Next New button, and my NHibernate code would go fetch the next piece of work with an Active status. As the number of users has increased, we have seen an issue arise where 2 users can get the same piece of work. This ...

Generating separate "model" classes from a WCF service

I'd like to be able to generate individual classes (one class per file) for each Data Contract or XML type in a WCF Web Service. I've read the svcutil documentation, and unless I skimmed a little too fast, it doesn't look like the tool supports this behaviour. The reason I want to do this is simple - I'm trying to isolate the service's...

Why do some .NET projects use an N- prefix in their name?

Probably a silly question, because I assume the N stands for ".NET", though I could be wrong. I'm interested in where this naming convention got started. Examples: NHibernate NLog NCover NDepend Ninject (I realize this is supposed to be a play on "ninja", but it still fits) ...

Validating a .NET 2.0 form with JQuery Validate() issues

I am trying to validate a form in .NET 2.0 using the JQuery Validate() plug-in and it’s not working. I know my Jquery code is working as I set up functions to clear the default text of a text field on focus() and that works as expected. The form.validate() method never seems to get called as I have alert() calls in a custom validation ...

How can i give css file into webpart components?

Hi my experts and Brain ;); Every thing is ok. But i try to add CssClass into myGridView.cs (i used webpart) but my component doesn't see css file. How to give path my css file. i added gvCustomers.CssClass = "tablestyle"; How can give path my StyleSheet.css? Don't give this link(http://stackoverflow.com/questions/2037681/how-to-use-jav...

Why .NET String is immutable?

As we all know, String is immutable. What are the reasons for String being immutable and the introduction of StringBuilder class as mutable? ...