Skip to content

Commit fe87e40

Browse files
Add import export example
1 parent 2c6c4c3 commit fe87e40

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

Doc.Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM mono:latest
2+
3+
ENV DOCFX_VER 2.43.2
4+
5+
RUN apt-get update && apt-get install unzip wget git -y && \
6+
wget -q -P /tmp https://github.com/dotnet/docfx/releases/download/v${DOCFX_VER}/docfx.zip && \
7+
mkdir -p /opt/docfx && \
8+
unzip /tmp/docfx.zip -d /opt/docfx && \
9+
echo '#!/bin/bash\nmono /opt/docfx/docfx.exe $@' > /usr/bin/docfx && \
10+
chmod +x /usr/bin/docfx && \
11+
rm -f /tmp/*
12+
13+
WORKDIR /docs
14+
15+
COPY api/ .
16+
17+
CMD ["docfx", "-h"]

api/AltV.Net.Example/SampleResource.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,19 @@ async delegate(string s, string s1, long i1, string[] arg3, object[] arg4, IMyVe
207207

208208
Alt.Export("GetBla", () => { Alt.Log("GetBla called"); });
209209

210+
Action action;
211+
212+
Alt.Import("example", "GetBla", out action);
213+
214+
action();
215+
216+
Alt.Export("functionExport", delegate(string name) { Alt.Log("called with:" + name); });
217+
218+
Action<string> action2;
219+
220+
Alt.Import("example", "functionExport", out action2);
221+
222+
action2("123");
210223
/*if (Alt.Import("Bla", "GetBla", out Action value))
211224
{
212225
value();

0 commit comments

Comments
 (0)