I have a small (~2000 lines of code) class that I would like to use from both java & .NET. There are several approaches to do this - among them wrapping the class as a service, using some interop voodoo, or duplicating the code to both C# & java.
Do you know an out-of-the-box tool that accomplishes the latter - takes a simple C# class w...
I have a string[] arr. I want to make it like if I click the button once arr[0] goes to the textbox and If I click button again arr[1] goes to textbox.
I know it will be done using some counter and incrementing it on each click but im just confused with syntax. Help will be appreciated.
...
In this question @Jon skeet referenced this old blog post by the authority Chris Brumme.
I was wondering, do I need to follow all calls to GC.SuppressFinalize(this) with a GC.KeepAlive(this) to avoid weird race conditions where a finalizer can be invoked during the time a disposer is running in heavily multithreaded applications?
If ...
Hello,
I would like to create my base business class, something like EntityBase, to have some common behavior, such as implementing interface to track changes in the object (IsNew, IsDirty) and INotifyPropertyChanges interface.
But many people say it's a bad idea to have a base business class and derive all your business objects from i...
Hi,
Could someone try to recommend the best cause of action to solve the request below:
I have created a number of extended classes using the Repeater class as a Base and love the flexibility, the ease and the results of doing this. What I want to to do now is to make a similar Custom Web Control for a single object (i.e the DataSource...
Hello,
I heard that if I call form.ShowDialog() without specifying the owner, then there can be a case when I will not see the dialog form on screen (it will be hidden with other windows). Is it true? I used ShowDialog() without specifying the owner hundreds of times and I never had any problems with that.
Can you please explain in whi...
Hello everyone,
I am building a web site like Facebook. Not a competitor of a Facebook, just a mid-sized internal school alumni web site. :-)
Features I like is, each grade/class could organize itself as a group and have group administrator, each person belongs to one grade/class group, and there is a whole system administrator to mana...
I am running an external process in a custom msbuild task. This task is in assembly A which is called when I'm building project B. Everything works fine. However, when trying to clean the project. Visual Studio 2008 gives me an error saying "the process cannot access assembly A because it is being used by another process". Restarting Vis...
My UserControl references a C++/CLI wrapper to an unmanaged C++ dll. When I try to add the UserControl to a form, I get a Visual Studio error, which says "Failed to create component 'userControl'", giving a System.IO.FileNotFoundException as the cause.
From what I've been able to determine, the problem stems from visual studio not copyi...
I am coming from VB6 and I am starting to convert an existing VB6 code to VB.Net. What tools can I use to automate this task?
...
Here's another one of these LinqToSQL questions where I'm sure I must have missed the boat somewhere, because the behavior of the O/R Designer is very puzzling to me...
I have a base class for my LinqToSQL tables, which I called LinqedTable. I've successfully used reflection to get hold of all the properties of the descendant classes a...
What is the best way to check if there is atleast a selected item in a listview or not in an if statement?
...
C#: Is there a way to SET the selected index of an item in listview at runtime?
...
Can anyone tell me how to raise click event of button control (or for that matter for any event).
Platform: .net 2.0/3.0/3.5
Language: c#
Domain: Windows Application, WinForms, etc.
...
I have a problem, I am using the method in listview ListView.SelectedItems[0] to return the currently selected ListViewItem into an argument in a function that displays the text of the item into a textbox when selected. This method is set to the Listview_SelectedIndexChanged event. The problem is that when I selected a different item now...
Making my first steps with NHibernate, I'm trying to have it creating my Tables automatically from the hbm files. The database backend is SQL Server 2008 Developer Edition.
This is the common sample code I see in NHibernate Tutorials:
var cfg = new Configuration();
cfg.Configure();
cfg.AddAssembly(typeof(Posting).Assembly);
new SchemaE...
I have a VS 2008 solution with 2 projects. Project A builds into an assembly that is used by Project B (MVC project). I have created a custom task in Project A, which I call when building Project B.
I have come across 2 issues:
If my AssemblyFile property points to Project A's bin directory, everything works well. But when I want t...
Is there a way in C# to serialize a struct to a binary stream (MemoryStream) such that the binary representation is equivalent to how the struct is visually layed out (i.e. no padding)?
In C/C++, you use #pragma commands to tell the compiler to pack the struct's so that there is no padding between the fields. This is helpful if you hav...
Hello,
does anyone know about a document management system (or modules) that can be integrated with .NET?
Thanks.
...
I'd like to hear your opinions and maybe better suggestions for the following scenario:
I have define a custom ActionFilter that does some job and comes out with some value. I would like to use that value in controller actions and in models.
Now, I could use TempData to pass this value from the ActionFilter to any controller action met...