Search Results

Search found 2 results on 1 pages for 'user322383'.

Page 1/1 | 1 

  • Dynamic access of classes of a given namespace

    - by user322383
    Hi! I'm writing an interface that will be implemented by a lot of classes, and I'm writing a class that will hold a collection of instances of these implementations. Every class will have a default constructor. So, is there a simple way (e.g. using some kind of reflection) to put an instance of each of these implementing classes to the collection? Besides doing it manually, which is simple, yes, but a lot of work and error prone (what if I missed an implementation while writing the method? What if a new implementation came and I forgot to update the given method?). So, what I would like is to be able to iterate through all classes of a given namespace or maybe through the list of all available classes. My method then would simply check, through reflection, if the given class implements the given interface, and if it does, puts it into the collection. Thank you.

    Read the article

  • Looking for a standard way to manage documents in a WPF application

    - by user322383
    Hi! I'm writing a WPF application that uses one document at a time. Is there any standard way to implement the management of the current document? What I mean are the following functions: New document: if there are not saved changes in the current document, a dialog box opens ('Do you want to save changes to {0}?') with Yes/No/Cancel buttons. If Cancel is hit, the operation stops. Open document: same dialog box as at new document, and an Open dialog opens after Save document: if the current document hasn't been saved, a Save dialog opens Save as: you can imagine... So, is there anything standard in the .NET framework like this or do I have to manually implement it?

    Read the article

1