.net

System.String - why doesn't it implement parameterless constructor?

Hi. I wanted to ask what is the idea behind the fact that System.String doesn't contain parameterless constructor. Because of this you cannot use this type when there is new() constraint. UPDATE Why do you think that new string() is useless and e.g. new int() is not useless. I really cannot see the difference. I really would like to ...

Is WinForms ListView in VirtualMode limited to 100,000,000 rows?

I have some grid scenario with > 500,000,000 rows I would like to display in ListView. If I artificially limit my ListView to display 100,000,000: _listView.VirtualListSize = _data.Count; if (_listView.VirtualListSize > 100000000) _listView.VirtualListSize = 100000000; Everything works fine (In VirtualMode naturally). When I cha...

Create normal zip file programmatically

Hi All I have seen many tutorials on how to compress a single file in c#. But I need to be able to create a normal *.zip file out of more than just one file. Is there anything in .NET that can do this? What would you suggest (baring in mind I'm under strict rules and cannot use other libraries) Thank you ...

WCF: WSDL-first approach: Problems with generating fault types

Hi, I'm currently in the process of creating a WCF webservice which should be compatible with WS-I Basic Profile 1.1. I'm using a wsdl-first approach (actually for the first time), defining first the xsd for the complex types, the WSDL and then using svcutil.exe for generating the according server as well as client-side interfaces/proxi...

Is the .Net HashSet uniqueness calculation completely based on Hash Codes?

I was wondering whether the .Net HashSet<T> is based completely on hash codes or whether it uses equality as well? I have a particular class that I may potentially instantiate millions of instances of and there is a reasonable chance that some hash codes will collide at that point. I'm considering using HashSet's to store some instance...

Check whether a folder is a local or a network resource in .NET

Is there a quick way to check whether a path I have is on a local disk or somewhere on the network? I can't just check to see if it's a drive letter vs. UNC, because that would incorrectly identify mapped drives as local. I assumed it would be a boolean in the DirectoryInfo object, but it appears that it's not. I've found classic VB cod...

Why is TreeSet<T> an internal type in .NET?

So, I was just digging around Reflector trying to find the implementation details of HashSet (out of sheer curiosity based on the answer to another question here) and noticed the following: internal class TreeSet<T> : ICollection<T>, IEnumerable<T>, ICollection, IEnumerable, ISerializable, IDeserializationCallback Without looking ...

Does casting an IList<T> to an array of type T[] cause enumeration?

I have a method that looks like: T[] field; public Method(IList<T> argument) { this.field = (T[])argument; } When the body of the method is executed does enumeration take place during the cast? Would that change if the underlying type was different? ...

Nhibernate HQL SQL Server 2005 / 2008 CONTAINSTABLE

Hi all, do you know anyway how I to use CONTAINSTABLEvia HQL? I need to use CONTAINSTABLE, not just CONTAINS. Currently I am using a SQL-query, but I need to use the multi-query feature which is not avaiable for SQL right now. If there is no such thing, would I be able to extend the MSSQL dialect? Or would that require to modify the co...

create and write to a text file in vb.net

I'm creating a small vb.net application, and I'm trying trying to write a list of results from a listview to a text file. I've looked online and found the code to open the save file dialog and write the text file. When I click save on the save file dialog, I receive an IOException with the message "The process cannot access the file 'C...

Best approch for building link in JQuery with paramaters

Hi, Very new to JQuery and MVC and webdevelopment over all. I'm now trying to accomplish this and is asking for a bit of advise: I'm basically trying to build a filter with 4 input elements, and 1 output. I have 4 select (drop down) elements in my page. As soon as one of them is changed, I need to build a href and get the partial vie...

Check with code if FinalBuilder is running a script

Is it possible to check if FinalBuilder is running a script with code? I would like to make a small application that can remotely start building a project on a remote machine, but only if its not running a script already. regards, -Vegar ...

What 'additional configuration' is necessary to reference a .NET 2.0 mixed mode assembly in a .NET 4.0 project?

I have a project in which I'd like to use some of the .NET 4.0 features but a core requirement is that I can use the System.Data.SQLite framework which is compiled against 2.X. I see mention of this being possible such as the accepted answer here but I don't see how to actually achieve this. When I just try and run my 4.0 project while ...

How to use "contains" or "like" in a dynamic linq query?

The help file that came with Dynamic Linq in the CSharpSamples.zip does not show any examples of using contains or like. Are there any simple workarounds for doing this? i.e where (col like @col) doesn't work. ...

Which open-source project management tools are written in .NET?

I am looking for project management tool in .NET which is open source (comes with source code for extension/customization). I Googled found few open source project management tools like: Redmine but it has source code in Ruby GanttProject but it looks like for individual usage dotProject, not good and lot many but with Java source...

Quick question about a reference type key in a generic dictionary in .Net

I have a mutable class that I'm using as a key to a generic dictionary. Two keys should be equal only if their references are equal. From what I've read, in this case, I don't need to override Equals, GetHashCode , or implement IEqualityComparer. Is this correct? ...

Get unused assemblies in bin

Is there any way or tool to detect all assemblies in BIN which are never used in the project? ...

Is there a way to allow a property of a user control to be modified only during design time?

I've looked into the DesignOnly attribute, but that doesn't seem to accomplish what I want*. Basically, I'm looking for some way to indicate that some property of a user control (let's say Text) can be modified during design time -- i.e., from the Windows Forms designer in VS (or presumably from any GUI designer that can be used to modi...

How to draw "on top" of hosted controls in .NET?

Hi all, I am working on a simple form builder which hosts "live" .NET objects as well as performing its own drawing for guidelines (grid), object selection etc. Things are going well but as you see below, the custom painting is not exactly optimal since it always paints behind the hosted controls. How can I modify my painting logic t...

i want active my program when user click on folder in "explorer"

hi i`m C# programmer i want to active my program when user click on folder in "explorer". TNX ...