interface

How do you find all implementations of an interface, in code?

My question is very similar in concept to this question. However, I was wondering how I would programmatically identify every class in a given namespace that implements a specific interface in a method (so I can add an object of each to a List), similar to how the Stripes Framework (in Java) finds all the classes that implement the Actio...

Is there any equivalent of C#'s Assembly.GetExecutingAssembly() in ActionScript 3?

Is there any equivalent of C#'s Assembly.GetExecutingAssembly() in ActionScript 3? I am attempting to iterate over each class in a namespace that implements a specific interface. ...

NotSupportedException when using lambda against a DataContext and a generic function constraint of interface

I'm not entirely sure the title is properly worded, but here's the situation... I noticed today while trying to create a generic save function for Linq to Sql that when I use lambda against a data context select. It breaks within a generic function with a type constraint of another generic interface. However, it works fine with LINQ syn...

Need of interfaces in c#

What is need of interfaces in c# ? as we are writing abstract method in interfaces. instead of that we can directly implement those methods in class. ...

Generic Interface

Hi All, Let's say I wanted to define an interface which represents a call to a remote service. Now, the call to the remote service generally returns something, but might also include input parameters. Suppose that an implementing class will typically only implement one service method. Given the above information, is the following a poor...

Exposing collection through interface

I am new to C#.I wish to know the differences of using Collections. I suspect ,the following question may be asked before(If so kindly show me the link). What is the Difference between IList<int> intCollection = new List<int>(); and List<int> intCollection = new List<int>(); Why should i expose my collection through interface. I...

Interfaces with different getter and setter for the same propertie

I've made the following declaration for interfaces: public interface IBasic { int Data { get; } } public interface IChangeable : IBasic { int Data { set; } } The compiler says that IChangeable.Data hides IBasic.Data. It's reasonable. The alternative I've found is: public interface IBasic { int Data { get; } } public interface...

Should I use inherit or interface ?

What is the difference between: type IFooable = interface IDisposable abstract Foo : (unit -> unit) and type IFooable = inherit IDisposable abstract Foo : (unit -> unit) ? If equivalent, in which cases should I use one over the other ? Thanks! ...

interface classes

i"m new to interfaces i have this code example : public class DALF { public class Car { public int AddEdit(int? CarId, string Name) { .... } public DataTable Get(int? CarId) { ..... return CarD.Get(obj); } } public class Worker {...

.NET 3.5 - Object not implementing IComparable?

When converting a project (in which a template method of IComparable was used a few times) from VS 2005 to VS 2008 I've got some errors: Error 12 Type argument 'Object' does not inherit from or implement the constraint type 'System.IComparable'. Is this an actual fact that System.Object no longer implements that interface, or somethi...

Inheritance + Interface problem

I have an interface to describe when a class can create a "next" version of itself: public interface Prototypeable<Type extends Prototypeable<Type>> { public Type basePrototype(); // the zeroth raw instance of Type public Type nextPrototype(); // the next instance of Type } to be used with public class Prototyper { public static <...

Can I make an existing (fixed) class implement a new interface?

I have a feeling I already know the answer people are going to give, but here goes anyway: Say I'm writing a new class, let's call it PooledQueue<T>, in the constructor of which I want to accept an argument that implements the interface IResourcePool<T>. The idea here is that I'm fine with using any underlying pool object, as long as it...

How to share constants between Interface Builder and the code ?

I wonder if there is a way to use constants in Interface Builder, in order to avoid manually setting the same color at different places for example (it could be a very tedious job sometimes...) Currently I set the color in the code and use #define to setup the color, but obviously IB can't use #define... ...

Any hints on programming Dia with Python extensions?

I'm searching for documentation on how to do it properly. Any hints? ...

Should interfaces be in a separate project from their implementation?

My question isn't so much about use of interfaces but more of a project organization nature. Note: I am using VisualStudio in a multi-layered application. Should my Interface files live in a separate project from their implementations? My initial thought is that it would be useful to separate out all my service interfaces into their ...

Interfaces separated from the class implementation in separate projects?

We work on a middle-size project (3 developers over more than 6 months) and need to make following decision: We'd like to have interfaces separated from concrete implementation. The first is to store the interface in a separate file. We'd like to go further and separate the data even more: We'd like to have one project (CSPROJ) with in...

PIMPL problem: How to have multiple interfaces to the impl w/o code duplication

I have this pimpl design where the implementation classes are polymorphic but the interfaces are supposed to just contain a pointer, making them polymorphic somewhat defeats the purpose of the design. So I create my Impl and Intf base classes to provide reference counting. And then the user can create their implementations. An example: ...

Implementing two interfaces or not?

I'm writing a class that returns both a DataTable and a IEnumerable. I cannot define the interface methods exactly the same except for return type. So, I wish I could create this interface (obviously, it doesn't compile): interface IMyInterface { DataTable GetResults(); IEnumerable<string> GetResults(); } So, h...

AJAX and prediction of actions.

Hello, I'd like to ask your opinion on this. This is a theoretical question. I'm in a situation where I have an interface shown to a user that uses AJAX to talk to the server. The server-side language does not matter here. I have a form with fields and each of them are deletable. If the user selects a few "delete" -checkboxes and press...

How to list all ActiveX controls?

Is there a way to list/browse all ActiveX controls in the system or for particular application? Can this be done from some administration screen as well as in code? Thx for any help. ...