When creating a cirrus project should I select .NET class library?
You mean to implement your own aspect? yes, a .NET Class library; any .NET 4 version should do, as the compiler runs on . NET 4.0 and higher.
Thank you. @mh
To screen (out) for constructor and finalizer, should I use “.” for constructor name, and “~” for finalizer name? It seems so but I just want to confirm.
In the Cirrrus sample CirrusInterface, it uses “.ctor”, which doesn’t do work of screening for constructor.
C:\Users\Public\Documents\RemObjects Samples\RemObjects Oxygene for .NET\Cirrus\CirrusInterface
@mh,
another question, how can I inject a parent class method call inside SetBody?
method RaiseOnDIsposedAttribute.HandleImplementation(Services: IServices; aMethod: IMethodDefinition);
begin
if
String.Equals(aMethod.Name, ‘.’, StringComparison.OrdinalIgnoreCase) or
String.Equals(aMethod.Name, ‘~’, StringComparison.OrdinalIgnoreCase) or
(aMethod.Visibility <> Visibility.Public)
then begin
exit;
end;
aMethod.SetBody(Services,
method begin
// Want to call the subject class’s parent’s method, how?
Aspects.OriginalBody;
end);
end;
It’s a bit trickier than that. It’s called . or .ctor or <init>
or initName. I’ll add a property to read this info properly. Inherited:
you should be able to use:
public ProcValue(Value aSelf, IMethod aMethod, IType[] aGenericParameters, bool aInherited, params Value[] aParameters)
Make the name match.
Yes