The name is a little blurry, so here's the situation:
I'm writing code to use some 'trajectories'. The trajectories are an abstract thing, so I describe them with different interfaces. So I have a code as this:
namespace Trajectories {
public interface IInitial<Atom>
{
Atom Initial { get; set; }
}
public interf...
Hi everybody I have been reading documents during the last two days about the advantages that you have using INTERFACES PATTERNS (no design patterns), but I can catch the disadvantages especially when the analysis involves the comparison with guidelines.
Thank you very much in advance for all your comments.
Daniel
...
The official documentation says they are optional. I know COM interop requires a unique identifier for each interface but every interface example I see has a GUID whether it's used with COM or not? Is there any benefit to including a GUID if its not going to be used with COM?
...
I'm working on an Interface Builder-type app for interface design. I would like to be able to align NSView's along their layout frames. Is there a way to access the ibLayoutInset property from my code?
...
I'm trying to fetch an interface using D2010 RTTI.
program rtti_sb_1;
{$APPTYPE CONSOLE}
{$M+}
uses
SysUtils,
Rtti,
mynamespace in 'mynamespace.pas';
var
ctx: TRttiContext;
RType: TRttiType;
MyClass: TMyIntfClass;
begin
ctx := TRttiContext.Create;
MyClass := TMyIntfClass.Create;
// This prints a list of all kn...
Example A:
// pseudo code
interface IFoo {
void bar();
}
class FooPlatformA : IFoo {
void bar() { /* ... */ }
}
class FooPlatformB : IFoo {
void bar() { /* ... */ }
}
class Foo : IFoo {
IFoo m_foo;
public Foo() {
if (detectPlatformA()} {
m_foo = new FooPlatformA();
} else {
...
So, first I have my command property interface
public interface ICommandProperty<T, U>
{
Func<T> CreateCommand { get; set; }
Func<T, U> ParseResponse { get; set; }
}
The idea is that I can create a simple parser that takes a string and returns an IPAddress for example.
This interface is then used in another interface:
public...
Ok, I'm on the verge of overthinking this. Is there a way to combine interfaces and attributes such that an attributed property in the implementing class fulfills the interface contract?
In my app I'd like to show a list of activities, which is an aggregation of events in the system such as a new message, a new task being created/assig...
I have some user controls which I want to specify properties and methods for.
They inherit from a base class, because they all have properties such as "Foo" and "Bar", and the reason I used a base class is so that I dont have to manually implement all of these properties in each derived class.
However, I want to have a method that is o...
Can anyone please tell me how to implement IEditableCollectionView interface?
I am trying to use a custom list for data binding to a data grid in WPF (C#) and need to implement this interface for editing data.
Thanks.
...
I'm developing a class to compare two directories and run an action when a directory/file in the source directory does not exist in destination directory.
Here is a prototype of the class:
public abstract class IdenticalDirectories
{
private DirectoryInfo _sourceDirectory;
private DirectoryInfo _destinationDirectory;
prot...
I've recently been able to fetch a TRttiType for an interface using TRttiContext.FindType using Robert Loves "GetType"-workaround ("registering" the interface by an explicit call to ctx.GetType, e.g. RType := ctx.GetType(TypeInfo(IMyPrettyLittleInterface));).
One logical next step would be to iterate the methods of said interface. Consi...
Hi,
I'm working on the exception handling layer for my application.
I have read few articles on interfaces and generics. I have used inheritance before quite a lot and I'm comfortable with in that area.
I have a very brief design that I'm going to implement:
public interface IMyExceptionLogger
{
public void LogException();
// ...
Hi
This is ongoing issue to something I posted yesterday.
I have a .net object that I want to use in Excel. I have an existing VBA script that i need to alter to call this the object from. I have then converted the object to a TLB. I've not really touched on this area before so any help will be appreciated.
I have created an interfac...
I have an interface for logging the exceptions, i.e. IExceptionLogger.
This interface has 3 implementations: DBExceptionLogger, XMLExceptionLogger, CSVExceptionLogger.
I have an application that will make a use of DBExceptionLogger.
The application references only IExceptionLogger. How do I create an instance of DBExceptionLogger wit...
Possible Duplicate:
Java Interfaces?
What is the use of interface in java? Is interface helps to provide multiple inheritance actually?
...
Can someone explain to me when it is necessary to define your ivars as pointers?
I've seen many code samples that don't use pointers, while others do.
...
Say I have an enum something like:
enum OrderStatus
{
AwaitingAuthorization,
InProduction,
AwaitingDespatch
}
I've also created an extension method on my enum to tidy up the displayed values in the UI, so I have something like:
public static string ToDisplayString(this OrderStatus status)
{
switch (status)
{
...
I have a c# project GenericBusinessObject and a project WebRole, which uses GenericBusinessObject. WebRole has a BusinessObject Workitem, that implements the Interface method IFastSearchable.IndexDocument that is called from within GenericBusinessObject.
Actually the WorkitemBusinesObject is declared in WebRole as GenericBusinessObject. ...
I've recently experimented extensively with interfaces and D2010 RTTI. I don't know at runtime the actual type of the interface; although I will have access to it's qualified name using a string.
Consider the following:
program rtti_sb_1;
{$APPTYPE CONSOLE}
uses
SysUtils, Rtti, TypInfo, mynamespace in 'mynamespace.pas';
var
ctx: ...