-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wondering how can i add a new function like "slide hyperlink" #17
Comments
A good question, because unfortunately there is no documentation yet on how to contribute to the project. Add the function in C#In your case you want to add this function as a shape function.
/// <summary>
/// Add a hyperlink to the shape
/// </summary>
/// <param name="parameters"></param>
private void AddHyperlink(Dictionary<string, object> parameters)
{
// Some code to add a Hyperlink to a schape
} Make the function public to JavascriptAdd a new async function to the return object of public object Invoke()
{
return new
{
attr = (Func<object, Task<object>>)(
async (input) =>
{
if (input is string)
{
var tmp = new Dictionary<string, object>();
tmp.Add("name", input);
input = tmp;
}
return Util.Attr(this, (input as IDictionary<string, object>).ToDictionary(d => d.Key, d => d.Value), Invoke);
}),
// . . . other code . . .
// your new hyperlink function
addHyperlink = (Func<object, Task<object>>)(
async (input) =>
{
this.AddHyperlink((input as IDictionary<string, object>).ToDictionary(d => d.Key, d => d.Value));
return this.Invoke(); // return the shape.Invoke() result for chaining
})
};
} Compile the C# code
Create a javascript wrapper
shape.addHyperlink = function (address, subAddress) {
return nativeShape.addHyperlink({
address: address,
subAddress: subAddress
}, true)
} Make a pull requestsI would love to add your new function to the library! |
Hi @Miramac , it would be greater if you add the function about "shape.Table add rows/delete rows". |
Yes, the function for adding/deleting rows/columns in tables is missing. |
No description provided.
The text was updated successfully, but these errors were encountered: