Assuming the following hypothetical inheritance hierarchy:
public interface IA
{
int ID { get; set; }
}
public interface IB : IA
{
string Name { get; set; }
}
Using reflection and making the following call:
typeof(IB).GetProperties(BindingFlags.Public | BindingFlags.Instance)
will only yield the properties of interface IB, wh...
I am wondering if Unittesting and using statements can really go hand in hand as there is no way to mock the disposable object instantiated in the using statement. How would I be able to effectively unittest a method containing the following using statement?
public void MyMethod()
{
using(MyDisposableClass disp = new MyDisposableCla...
My program run fine from anywhere else on my drive apart from the Program Files directory (windows XP), I am logged on as administrator so I have full permissions to the drive. It runs fine from the root of c: the windows directory basically anywhere else apart from Program Files. I have recreated this problem on 4 different machines 2 X...
Hi,
i'm trying to create a ObjectDataSource which I can use to bind to a BindingSource which on his turn should be bound to a ComboBox.
I've created a simple class and a simple list for this class (see below)
The Times list class is not showing up at my toolbox, so I cannot drag it to the form so I can select it as the datasource for...
How do I create a .Net Web Service in IronPython?
Preferably dynamically without any pre- or post-processing.
...
Hi,
I have seen these two approaches for constant declaration which are to be used in the project.
Constants in a public module.
Constants in a NonInheritable(Sealed) class
Does anybody uses any other approach for the constant declartion ?
Is there any difference between these approaches, any pros and cons ?
Thanks.
...
I have data from a table in a database (string) that contain text and price. I extract the price from the data but my problem is that sometime I can Convert it to float and sometime not.
I have noticed that :
Convert.ToSingle(m.Groups[1].Value);
It works but not always because sometime the period is the problem (it requires a comma)....
I have an x64 server which, since my libraries are compiled to AnyCPU, run under x64. We are needing to access a COM component which is registered under x86. I don't know enough about COM and my google searches are leading me nowhere.
Question: Can I use a symbolic registry link from x64 back to x86 for the COM component? Do I need t...
I created a windows service that's basically a file watcher that wont run unless a user is logged into the machine its on. The service is running on a Windows Server 2003 machine. It is designed to move the files that are put into one directory into a different directory based on keywords in the file names, but none of the files move u...
I'm trying to use the EntLib 3.1 within .net code for a dll which is registered for COM interop. Where do I put the config file?
Alternatively, is there a way to specify within the dll code where it should get the entlib config from? Since my dll will be called from COM I don't always know what exe will be calling it.
I created a simp...
Why is list1Instance and p lists in the Main method of the below code pointing to the same collection?
class Person
{
public string FirstName = string.Empty;
public string LastName = string.Empty;
public Person(string firstName, string lastName) {
this.FirstName = firstName;
this.Las...
"Assembly [AssemblyName] must have a shared name to be installed globally"
I am getting this error message when I try to deploy some component DLLs for my application to the Global Assembly Cache.
What is a shared name and how do i make sure my DLLs have one?
...
I am trying to set up my tab order on the html side of my project. How do I set the tab order. Usually in visual basic, the option is in the menu bar under view/tab Order. How do I do this in asp?
...
I have a small dataset with a few datatables. I load the datatables from various DBs and have a config file that I read to determine the primary keys I want to enforce on the given datatables. If the config doesn't contain a proper (non unique) primary key, how can I catch this event when applying the primary key to the datatable? Cur...
In a .NET application, how can I identify which network interface is used to communicate to a given IP address?
I am running on workstations with multiple network interfaces, IPv4 and v6, and I need to get the address of the "correct" interface used for traffic to my given database server.
...
I'm trying to create a master detail view of a linq to sql relationship in wpf. The view will have two comboboxes. One for selecting the master item and another for selecting the detail item.
I have achieved this using an ADO.Net Dataset containing two tables and a relationship between the tables. where the first combobox binds to the ...
I have a class with a string property, having both a getter and a setter, that is often so long that the PropertyGrid truncates the string value. How can I force the PropertyGrid to show an ellipsis and then launch a dialog that contains a multiline textbox for easy editing of the property? I know I probably have to set some kind of attr...
I'm trying to debug a workflow project that's using the default WF SQL persistence schema. Does anyone know of a good explanation for what the data in each table represents?
...
Short version
How do i use an API call when i cannot guarantee that the window
handle will remain valid?
i can guarantee that i'm holding a reference to my form (so the form is not being disposed). That doesn't guarantee that the form's handle will stay valid all that time.
How can a form's window handle become invalid even though ...
I have a chunk of MDX that I'd like to throw into a Asp.Net form. Hopefully just bind the results to a gridview. Anyone know of any good links or snippets? I'm using VB.Net, but am able to port from C# if no VB is available.
...