Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ _exported_templates

!/build

/samples/scichart-dotnet-android-bindings/.idea/
/samples/scichart-dotnet-android-bindings/bin/
/samples/scichart-dotnet-android-bindings/obj/
/samples/scichart-dotnet-android-bindings/*.aar

**/local.properties
1 change: 1 addition & 0 deletions samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Examples and Tutorials used in documentation for [SciChart.Android](https://www.
- [Documentation Samples Sandbox](sandbox)
- [SciChart Android Native Tutorials](tutorials-native)
- [SciChart Android Xamarin Tutorials](tutorials-xamarin)
- [SciChart .NET Android Bindings Project](scichart-dotnet-android-bindings)
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Additions allow you to add arbitrary C# to the generated classes
before they are compiled. This can be helpful for providing convenience
methods or adding pure C# classes.

== Adding Methods to Generated Classes ==

Let's say the library being bound has a Rectangle class with a constructor
that takes an x and y position, and a width and length size. It will look like
this:

public partial class Rectangle
{
public Rectangle (int x, int y, int width, int height)
{
// JNI bindings
}
}

Imagine we want to add a constructor to this class that takes a Point and
Size structure instead of 4 ints. We can add a new file called Rectangle.cs
with a partial class containing our new method:

public partial class Rectangle
{
public Rectangle (Point location, Size size) :
this (location.X, location.Y, size.Width, size.Height)
{
}
}

At compile time, the additions class will be added to the generated class
and the final assembly will a Rectangle class with both constructors.


== Adding C# Classes ==

Another thing that can be done is adding fully C# managed classes to the
generated library. In the above example, let's assume that there isn't a
Point class available in Java or our library. The one we create doesn't need
to interact with Java, so we'll create it like a normal class in C#.

By adding a Point.cs file with this class, it will end up in the binding library:

public class Point
{
public int X { get; set; }
public int Y { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Com.Scichart.Charting3d.Visuals.Axes;

namespace Com.Scichart.Charting3d.Utility.PropertyHelpers {
public partial class AxisPropertyHelper {
protected override void Attach(global::Java.Lang.Object? target)
{
Attach(target as IAxis3D);
}

protected override void Detach(global::Java.Lang.Object? target)
{
Detach(target as IAxis3D);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using Android.Runtime;

namespace Com.Scichart.Charting.Model.Datadistributioncalculator {
public abstract partial class BaseDataDistributionCalculator {
[Register("onAppendValue", "(Lcom/scichart/data/model/ISciList;Ljava/lang/Comparable;Z)V", "GetOnAppendValue_Lcom_scichart_data_model_ISciList_Ljava_lang_Comparable_ZHandler")]
public abstract void OnAppendValue(global::Com.Scichart.Data.Model.ISciList? values, global::Java.Lang.Object? newValue, bool acceptUnsortedData);

[Register("onAppendValues", "(Lcom/scichart/data/model/ISciList;ILcom/scichart/core/model/IValues;Z)V", "GetOnAppendValues_Lcom_scichart_data_model_ISciList_ILcom_scichart_core_model_IValues_ZHandler")]
public abstract void OnAppendValues(global::Com.Scichart.Data.Model.ISciList? values, int countBeforeAppending, global::Com.Scichart.Core.Model.IValues? newValues, bool acceptUnsortedData);

[Register("onAppendValues", "(Lcom/scichart/data/model/ISciList;ILjava/lang/Iterable;Z)V", "GetOnAppendValues_Lcom_scichart_data_model_ISciList_ILjava_lang_Iterable_ZHandler")]
public abstract void OnAppendValues(global::Com.Scichart.Data.Model.ISciList? values, int countBeforeAppending, global::Java.Lang.IIterable? newValues, bool acceptUnsortedData);

[Register("onAppendValues", "(Lcom/scichart/data/model/ISciList;I[Ljava/lang/Comparable;Z)V", "GetOnAppendValues_Lcom_scichart_data_model_ISciList_IarrayLjava_lang_Comparable_ZHandler")]
public abstract void OnAppendValues(global::Com.Scichart.Data.Model.ISciList? values, int countBeforeAppending, global::Java.Lang.Object[]? newValues, bool acceptUnsortedData);

[Register("onInsertValue", "(Lcom/scichart/data/model/ISciList;ILjava/lang/Comparable;Z)V", "GetOnInsertValue_Lcom_scichart_data_model_ISciList_ILjava_lang_Comparable_ZHandler")]
public abstract void OnInsertValue(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereInserted, global::Java.Lang.Object? newValue, bool acceptUnsortedData);

[Register("onInsertValues", "(Lcom/scichart/data/model/ISciList;IILcom/scichart/core/model/IValues;Z)V", "GetOnInsertValues_Lcom_scichart_data_model_ISciList_IILcom_scichart_core_model_IValues_ZHandler")]
public abstract void OnInsertValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereInserted, int insertedCount, global::Com.Scichart.Core.Model.IValues? newValues, bool acceptUnsortedData);

[Register("onInsertValues", "(Lcom/scichart/data/model/ISciList;IILjava/lang/Iterable;Z)V", "GetOnInsertValues_Lcom_scichart_data_model_ISciList_IILjava_lang_Iterable_ZHandler")]
public abstract void OnInsertValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereInserted, int insertedCount, global::Java.Lang.IIterable? newValues, bool acceptUnsortedData);

[Register("onInsertValues", "(Lcom/scichart/data/model/ISciList;II[Ljava/lang/Comparable;Z)V", "GetOnInsertValues_Lcom_scichart_data_model_ISciList_IIarrayLjava_lang_Comparable_ZHandler")]
public abstract void OnInsertValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereInserted, int insertedCount, global::Java.Lang.Object[]? newValues, bool acceptUnsortedData);

[Register("onUpdateValue", "(Lcom/scichart/data/model/ISciList;ILjava/lang/Comparable;Z)V", "GetOnUpdateValue_Lcom_scichart_data_model_ISciList_ILjava_lang_Comparable_ZHandler")]
public abstract void OnUpdateValue(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, global::Java.Lang.Object? newValue, bool acceptUnsortedData);

[Register("onUpdateValues", "(Lcom/scichart/data/model/ISciList;IILcom/scichart/core/model/IValues;Z)V", "GetOnUpdateValues_Lcom_scichart_data_model_ISciList_IILcom_scichart_core_model_IValues_ZHandler")]
public abstract void OnUpdateValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, int updatedCount, global::Com.Scichart.Core.Model.IValues? newValues, bool acceptUnsortedData);

[Register("onUpdateValues", "(Lcom/scichart/data/model/ISciList;IILjava/lang/Iterable;Z)V", "GetOnUpdateValues_Lcom_scichart_data_model_ISciList_IILjava_lang_Iterable_ZHandler")]
public abstract void OnUpdateValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, int updatedCount, global::Java.Lang.IIterable? newValues, bool acceptUnsortedData);

[Register("onUpdateValues", "(Lcom/scichart/data/model/ISciList;II[Ljava/lang/Comparable;Z)V", "GetOnUpdateValues_Lcom_scichart_data_model_ISciList_IIarrayLjava_lang_Comparable_ZHandler")]
public abstract void OnUpdateValues(global::Com.Scichart.Data.Model.ISciList? values, int indexWhereUpdate, int updatedCount, global::Java.Lang.Object[]? newValues, bool acceptUnsortedData);
}
}

Loading