c# - Porting achartengine to Xamarin -
i'm trying port achrtengine library xamarin.droid.
what did is:-
1- create new android java bindings library project. 2- add .jar jars folder. 3- set build action embededjar
but got error:-
'pan': member names cannot same enclosing type
in line:
public event eventhandler pan { add { global::java.interop.eventhelper.addeventhandler<global::org.achartengine.tools.ipanlistener, global::org.achartengine.tools.ipanlistenerimplementor>( ref weak_implementor_addpanlistener, __createipanlistenerimplementor, addpanlistener, __h => __h.handler += value); } remove { global::java.interop.eventhelper.removeeventhandler<global::org.achartengine.tools.ipanlistener, global::org.achartengine.tools.ipanlistenerimplementor>( ref weak_implementor_addpanlistener, global::org.achartengine.tools.ipanlistenerimplementor.__isempty, removepanlistener, __h => __h.handler -= value); } }
i think because class name pan too
// metadata.xml xpath class reference: path="/api/package[@name='org.achartengine.tools']/class[@name='pan']" [global::android.runtime.register ("org/achartengine/tools/pan", donotgenerateacw=true)] public partial class pan : global::org.achartengine.tools.abstracttool {
update:-
i inserted line solve problem
<attr path="/api/package[@name='org.achartengine.tools']/class[@name='pan']" name="name">panclass</attr>
to change name of class.
but got these errors:-
error cs0019: operator '==' cannot applied operands of type 'achartengine.renderer.xyseriesrenderer.filloutsideline.type' , 'system.type' (cs0019) (achartenginebindings) error cs1503: argument 2: cannot convert 'string' 'system.intptr' (cs1503) (achartenginebindings)
anyone knows how solve ?!
any useful. thanks.
i found answer here: http://forums.xamarin.com/discussion/1935/achartengine-org-jar-binding-error
you should add metadata:
<attr path="/api/package[@name='org.achartengine.renderer']/class[@name='xyseriesrenderer.filloutsideline']/method[@name='gettype' , count(parameter)=0]" name="managedname">getbehaviortype</attr> <attr path="/api/package[@name='org.achartengine.renderer']/class[@name='xyseriesrenderer.filloutsideline.type']" name="managedname">filloutsidelinebehaviortype</attr> <attr path="/api/package[@name='org.achartengine']" name="managedname">achartengine</attr> <attr path="/api/package[@name='org.achartengine.chart']" name="managedname">achartengine.chart</attr> <attr path="/api/package[@name='org.achartengine.model']" name="managedname">achartengine.model</attr> <attr path="/api/package[@name='org.achartengine.renderer']" name="managedname">achartengine.renderer</attr> <attr path="/api/package[@name='org.achartengine.tools']" name="managedname">achartengine.tools</attr> <attr path="/api/package[@name='org.achartengine.util']" name="managedname">achartengine.util</attr> <attr path="/api/package[@name='org.achartengine.tools']/class[@name='pan']/method[@name='addpanlistener']" name="eventname">panevent</attr>
to rename filloutsideline.gettype() , filloutsideline.type getbehaviortype() , filloutsidelinebehaviortype.
and change event name too.
i've added source code github example too: https://github.com/mostafa-elabady/xamarin_achartengine
Comments
Post a Comment