From: Chihun Jeong Date: Mon, 9 Jan 2023 06:17:43 +0000 (+0900) Subject: Add CsharpGrpc Samples for Aurum Document X-Git-Tag: accepted/tizen/unified/20230210.160931~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=647f9d41e81cbd93582b87d31f7f6371b2bfc4a5;p=platform%2Fcore%2Fuifw%2Faurum.git Add CsharpGrpc Samples for Aurum Document Change-Id: I8446e4672c80a13ffd13e899ac2b8346569ffbf7 --- diff --git a/docs/docs/commands/application/closeapp.md b/docs/docs/commands/application/closeapp.md index 959ab83..fa3607d 100644 --- a/docs/docs/commands/application/closeapp.md +++ b/docs/docs/commands/application/closeapp.md @@ -18,6 +18,9 @@ Close application +
@@ -42,7 +45,16 @@ stub.closeApp({ packageName : 'EFL-Border-Sample' }, (err, response) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.closeApp(new ReqCloseApp{PackageName = packageName}); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/application/getactiveapptoolkitname.md b/docs/docs/commands/application/getactiveapptoolkitname.md index 46b3d81..a2c602a 100644 --- a/docs/docs/commands/application/getactiveapptoolkitname.md +++ b/docs/docs/commands/application/getactiveapptoolkitname.md @@ -12,12 +12,15 @@ Get the toolkit name of active application - +
@@ -42,7 +45,16 @@ stub.getActiveAppToolkitName({}, (err, response) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.getActiveAppToolkitName(new ReqGetActiveAppToolkitName{}); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/application/getappinfo.md b/docs/docs/commands/application/getappinfo.md index d63ce62..1f2dfe5 100644 --- a/docs/docs/commands/application/getappinfo.md +++ b/docs/docs/commands/application/getappinfo.md @@ -18,6 +18,9 @@ Get application info +
@@ -42,7 +45,17 @@ stub.getAppInfo({ packageName : 'packageName' }, (err, response) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +String packageName = "packageName"; +var response = client.getAppInfo(new ReqGetAppInfo{PackageName = packageName}); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/application/installapp.md b/docs/docs/commands/application/installapp.md index 71f1eb1..4d47aed 100644 --- a/docs/docs/commands/application/installapp.md +++ b/docs/docs/commands/application/installapp.md @@ -18,22 +18,25 @@ Install application +
{% capture code %} {% highlight python linenos %} -def get_file_chunks(filename): - CHUNK_SIZE = 1024 * 1024 - with open(filename, 'rb') as f: - while True: - piece = f.read(CHUNK_SIZE) - if len(piece) == 0: - return - yield ReqInstallApp(package = piece) - -tpkPath = './app.tpk' -tpkFile = get_file_chunks(tpkPath) +def get_file_chunks(filename): + CHUNK_SIZE = 1024 * 1024 + with open(filename, 'rb') as f: + while True: + piece = f.read(CHUNK_SIZE) + if len(piece) == 0: + return + yield ReqInstallApp(package = piece) + +tpkPath = './app.tpk' +tpkFile = get_file_chunks(tpkPath) response = stub.installApp(tpkFile) {% endhighlight %} {% endcapture %} @@ -60,7 +63,15 @@ tpk.on('data', (chunk) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/application/launchapp.md b/docs/docs/commands/application/launchapp.md index 0552588..055c6ff 100644 --- a/docs/docs/commands/application/launchapp.md +++ b/docs/docs/commands/application/launchapp.md @@ -18,6 +18,9 @@ Launch application +
@@ -48,7 +51,17 @@ stub.launchApp({ packageName : 'packageName' }, (err, response) => { {% endhighlight %} {% endcapture %} {% include fix_linenos.html code=code %} -{% assign code = nil %} +{% assign code = nil %} +
+
+{% capture code %} +{% highlight csharp linenos %} +String packageName = "packageName"; +var response = client.launchApp(new ReqLaunchApp{PackageName = packageName}); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/application/removeapp.md b/docs/docs/commands/application/removeapp.md index 1fd78c1..de6c371 100644 --- a/docs/docs/commands/application/removeapp.md +++ b/docs/docs/commands/application/removeapp.md @@ -18,6 +18,9 @@ Remove application +
@@ -42,7 +45,17 @@ stub.removeApp({ packageName : 'org.tizen.example.NUITizenGallery' }, (err, resp {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +String packageName = "packageName"; +var response = client.removeApp(new ReqRemoveApp{PackageName = packageName}); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/device/click.md b/docs/docs/commands/device/click.md index bd64984..6dd1037 100644 --- a/docs/docs/commands/device/click.md +++ b/docs/docs/commands/device/click.md @@ -18,6 +18,9 @@ Generate click event +
@@ -42,7 +45,16 @@ stub.click({ type: 'COORD', coordination: { x: 100, y: 100 } }, (err, response) {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.click(new ReqClick{ Type = ReqClick.Types.RequestType.Coord, Coordination = new Point{ X = 100, Y = 100 } }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/device/flick.md b/docs/docs/commands/device/flick.md index cd9e716..1a0d038 100644 --- a/docs/docs/commands/device/flick.md +++ b/docs/docs/commands/device/flick.md @@ -12,12 +12,15 @@ Generate flick event - +
@@ -42,7 +45,16 @@ stub.flick({ startPoint: { x: 100, y: 500 }, endPoint: { x: 100, y: 100 } }, (er {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.flick(new ReqFlick{ StartPoint = new Point{ X = 10, Y = 500 }, EndPoint = new Point{ X = 10, Y = 200 }, DurationMs = 150 }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/device/getdevicetime.md b/docs/docs/commands/device/getdevicetime.md index fb850cd..20794b4 100644 --- a/docs/docs/commands/device/getdevicetime.md +++ b/docs/docs/commands/device/getdevicetime.md @@ -18,6 +18,9 @@ Generate click event +
@@ -44,6 +47,15 @@ stub.getDeviceTime({ type: 'SYSTEM' }, (err, response) => {
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.getDeviceTime(new ReqGetDeviceTime{ Type = ReqGetDeviceTime.Types.TimeType.Wallclock }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %} +
diff --git a/docs/docs/commands/device/getscreensize.md b/docs/docs/commands/device/getscreensize.md index 603a5cd..b43753f 100644 --- a/docs/docs/commands/device/getscreensize.md +++ b/docs/docs/commands/device/getscreensize.md @@ -18,6 +18,9 @@ Get screen size +
@@ -42,7 +45,16 @@ stub.getScreenSize({}, (err, response) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.getScreenSize(new ReqGetScreenSize{}); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/device/longclick.md b/docs/docs/commands/device/longclick.md index 5384811..11b52b0 100644 --- a/docs/docs/commands/device/longclick.md +++ b/docs/docs/commands/device/longclick.md @@ -12,12 +12,15 @@ Generate longclick (500ms) event - +
@@ -42,7 +45,16 @@ stub.longClick({ type: 'COORD', coordination: { x: 100, y: 100 } }, (err, respon {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.longClick(new ReqClick{ Type = ReqClick.Types.RequestType.Coord, Coordination = new Point{ X = 100, Y = 100 } }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/device/sendkey.md b/docs/docs/commands/device/sendkey.md index 9e98060..b50821b 100644 --- a/docs/docs/commands/device/sendkey.md +++ b/docs/docs/commands/device/sendkey.md @@ -18,6 +18,9 @@ Generate key event +
@@ -42,7 +45,16 @@ stub.sendKey({ type: 'XF86', actionType: 'STROKE', XF86keyCode: 'Return'}, (err, {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.sendKey(new ReqKey{ Type = ReqKey.Types.KeyType.Xf86, ActionType = ReqKey.Types.KeyActionType.Stroke, XF86KeyCode = "Left" }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/device/takescreenshot.md b/docs/docs/commands/device/takescreenshot.md index 90fcdb9..f36d0cd 100644 --- a/docs/docs/commands/device/takescreenshot.md +++ b/docs/docs/commands/device/takescreenshot.md @@ -18,15 +18,18 @@ Take screenshot +
{% capture code %} {% highlight python linenos %} -response = stub.takeScreenshot(ReqTakeScreenshot()) -image = open("screenshot.png", "wb") -for r in response: - image.write(r.image) +response = stub.takeScreenshot(ReqTakeScreenshot()) +image = open("screenshot.png", "wb") +for r in response: + image.write(r.image) image.close() {% endhighlight %} {% endcapture %} @@ -49,7 +52,22 @@ result.on('data', (response) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +String path = "screenshot.png"; +FileStream fs = File.Create(path); +while(await responses.ResponseStream.MoveNext()) +{ + var response = responses.ResponseStream.Current; + fs.Write(response.Image.ToByteArray()); +} +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/device/touchdown.md b/docs/docs/commands/device/touchdown.md index 02f0c23..5206655 100644 --- a/docs/docs/commands/device/touchdown.md +++ b/docs/docs/commands/device/touchdown.md @@ -18,6 +18,9 @@ Generate touch down event +
@@ -42,7 +45,16 @@ stub.touchDown({ coordination: { x: 100, y: 100 } }, (err, response) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.touchDown(new ReqTouchDown{ Coordination = new Point{ X = 100, Y = 100 } }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/device/touchmove.md b/docs/docs/commands/device/touchmove.md index b45335d..764d20d 100644 --- a/docs/docs/commands/device/touchmove.md +++ b/docs/docs/commands/device/touchmove.md @@ -18,6 +18,9 @@ Generate touch move event +
@@ -50,7 +53,17 @@ stub.touchDown({ coordination: { x: 100, y: 100 } }, (err, response) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.touchDown(new ReqTouchDown{ Coordination = new Point{ X = 100, Y = 100 } }); +var response2 = client.touchMove(new ReqTouchMove{ SeqId = response.SeqId, Coordination = new Point{ X = 100, Y = 500 } }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/device/touchup.md b/docs/docs/commands/device/touchup.md index fd546c1..c9c00c9 100644 --- a/docs/docs/commands/device/touchup.md +++ b/docs/docs/commands/device/touchup.md @@ -18,6 +18,9 @@ Generate touch up event +
@@ -50,7 +53,17 @@ stub.touchDown({ coordination: { x: 100, y: 100 } }, (err, response) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.touchDown(new ReqTouchDown{ Coordination = new Point{ X = 100, Y = 100 } }); +var response2 = client.touchUp(new ReqTouchUp{ SeqId = response.SeqId, Coordination = new Point{ X = 100, Y = 100 } }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/uiobject/actionandwaitevent.md b/docs/docs/commands/uiobject/actionandwaitevent.md index 649103f..a84f74c 100644 --- a/docs/docs/commands/uiobject/actionandwaitevent.md +++ b/docs/docs/commands/uiobject/actionandwaitevent.md @@ -18,6 +18,9 @@ Do action and wait event +
@@ -47,7 +50,17 @@ stub.actionAndWaitEvent({ type: 'KEY', XF86keyCode: 'Down', {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.actionAndWaitEvent(new ReqActionAndWaitEvent{ Type = ReqActionAndWaitEvent.Types.ActionType.Key, XF86KeyCode = "Down", + EventType = ReqActionAndWaitEvent.Types.EventType.EventStateChangedFocused, TimeoutMs = 500 }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/uiobject/clear.md b/docs/docs/commands/uiobject/clear.md index 82e7eb3..a72c10d 100644 --- a/docs/docs/commands/uiobject/clear.md +++ b/docs/docs/commands/uiobject/clear.md @@ -18,6 +18,9 @@ Clear value of the object +
@@ -50,7 +53,17 @@ stub.findElement({ widgetType: 'TextField' }, (err, element) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var element = client.findElement(new ReqFindElement{ WidgetType = "TextField" }); +var response = client.clear(new ReqClear{ ElementId = element.Element.ElementId }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/uiobject/dumpobjecttree.md b/docs/docs/commands/uiobject/dumpobjecttree.md index eb57caa..68a179c 100644 --- a/docs/docs/commands/uiobject/dumpobjecttree.md +++ b/docs/docs/commands/uiobject/dumpobjecttree.md @@ -18,13 +18,16 @@ Generate click event +
{% capture code %} {% highlight python linenos %} - element = stub.findElement(ReqFindElement(maxDepth = 1, isShowing = True)) - response = stub.dumpObjectTree(ReqDumpObjectTree(elementId = element.element.elementId)) + element = stub.findElement(ReqFindElement(maxDepth = 1, isShowing = True)) + response = stub.dumpObjectTree(ReqDumpObjectTree(elementId = element.element.elementId)) {% endhighlight %} {% endcapture %} {% include fix_linenos.html code=code %} @@ -50,7 +53,17 @@ stub.findElement({ maxDepth: 1, isShowing: true }, (err, element) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var element = client.findElement(new ReqFindElement { MaxDepth = 1, IsShowing = true }); +var response = client.dumpObjectTree(new ReqDumpObjectTree{ ElementId = element.Element.ElementId }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/uiobject/findElement.md b/docs/docs/commands/uiobject/findElement.md index 789f8dd..e73808c 100644 --- a/docs/docs/commands/uiobject/findElement.md +++ b/docs/docs/commands/uiobject/findElement.md @@ -18,6 +18,9 @@ If an object that satisfies a specific condition is searched on the screen and f +
@@ -42,7 +45,16 @@ stub.findElement({ widgetType: "TextField" }, (err, response) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.findElement(new ReqFindElement{ IsClickable = true, }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/uiobject/findElements.md b/docs/docs/commands/uiobject/findElements.md index 3f7ff8b..3a6e2ac 100644 --- a/docs/docs/commands/uiobject/findElements.md +++ b/docs/docs/commands/uiobject/findElements.md @@ -18,6 +18,9 @@ If objects that satisfies a specific condition are searched on the screen and fo +
@@ -32,7 +35,7 @@ response = stub.findElements(ReqFindElements(isClickable=True))
{% capture code %} {% highlight js linenos %} -stub.findElements({ isClickable: true }, (err, response) => { +stub.findElements({ isClickable: true }, (err, response) => { if (err) console.log(err); else console.log(response); }) @@ -42,7 +45,16 @@ stub.findElements({ isClickable: true }, (err, response) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.findElements(new ReqFindElements{ IsClickable = true, }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/uiobject/getattribute.md b/docs/docs/commands/uiobject/getattribute.md index 8998efb..f76f60b 100644 --- a/docs/docs/commands/uiobject/getattribute.md +++ b/docs/docs/commands/uiobject/getattribute.md @@ -17,6 +17,9 @@ Get attribute of the object## Example Usage +
@@ -49,7 +52,17 @@ stub.findElement({ maxDepth: 1, isShowing: true }, (err, element) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var element = client.findElement(new ReqFindElement{ MaxDepth = 1, IsShowing = true }); +var response = client.getAttribute(new ReqGetAttribute{ ElementId = element.Element.ElementId, Attribute = ReqGetAttribute.Types.RequestType.Showing }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/uiobject/getsize.md b/docs/docs/commands/uiobject/getsize.md index 23602fb..fd7769d 100644 --- a/docs/docs/commands/uiobject/getsize.md +++ b/docs/docs/commands/uiobject/getsize.md @@ -18,6 +18,9 @@ Get geometry of the object +
@@ -50,7 +53,17 @@ stub.findElement({ maxDepth: 1, isShowing: true }, (err, element) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var element = client.findElement(new ReqFindElement{ MaxDepth = 1, IsShowing = true }); +var response = client.getSize(new ReqGetSize{ Type = ReqGetSize.Types.CoordType.Screen, ElementId = element.Element.ElementId }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/uiobject/gettextminboundingrect.md b/docs/docs/commands/uiobject/gettextminboundingrect.md index 2603f86..8c7e0a7 100644 --- a/docs/docs/commands/uiobject/gettextminboundingrect.md +++ b/docs/docs/commands/uiobject/gettextminboundingrect.md @@ -18,6 +18,9 @@ Get the minium bounding rect size of text +
@@ -50,7 +53,17 @@ stub.findElement({ widgetType: 'TextLabel' }, (err, element) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var element = client.findElement(new ReqFindElement{ WidgetType = "TextLabel" }); +var response = client.getTextMinBoundingRect(new ReqGetTextMinBoundingRect{ ElementId = element.Element.ElementId }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/uiobject/getvalue.md b/docs/docs/commands/uiobject/getvalue.md index d1f675b..c8dbb90 100644 --- a/docs/docs/commands/uiobject/getvalue.md +++ b/docs/docs/commands/uiobject/getvalue.md @@ -18,6 +18,9 @@ Get the value of the object +
@@ -50,7 +53,17 @@ stub.findElement({ widgetType: 'TextField' }, (err, element) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var element = client.findElement(new ReqFindElement{ WidgetType = "TextField" }); +var response = client.getValue(new ReqGetValue{ ElementId = element.Element.ElementId, Type = ParamType.String }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/uiobject/setfous.md b/docs/docs/commands/uiobject/setfous.md index 564c909..2cde979 100644 --- a/docs/docs/commands/uiobject/setfous.md +++ b/docs/docs/commands/uiobject/setfous.md @@ -18,6 +18,9 @@ Set focus to specific UI Object +
@@ -50,7 +53,17 @@ stub.findElement({ isFocusable:true, isShowing: true }, (err, element) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var element = client.findElement(new ReqFindElement{ IsFocusable = true, IsShowing = true }); +var response = client.setFocus(new ReqSetFocus{ ElementId = element.Element.ElementId }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/uiobject/settimeout.md b/docs/docs/commands/uiobject/settimeout.md index 92d346e..2802b99 100644 --- a/docs/docs/commands/uiobject/settimeout.md +++ b/docs/docs/commands/uiobject/settimeout.md @@ -12,12 +12,15 @@ Set Timeout - +
@@ -42,7 +45,16 @@ stub.setTimeout({ timeout: 5000 }, (err, response) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var response = client.setTimeout(new ReqSetTimeout{ Timeout = 5000 }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/commands/uiobject/setvalue.md b/docs/docs/commands/uiobject/setvalue.md index 240e7a4..2434b31 100644 --- a/docs/docs/commands/uiobject/setvalue.md +++ b/docs/docs/commands/uiobject/setvalue.md @@ -12,12 +12,15 @@ Set the value of the object - +
@@ -50,7 +53,17 @@ stub.findElement({ widgetType: 'TextField' }, (err, element) => { {% assign code = nil %}
- + +
+
+{% capture code %} +{% highlight csharp linenos %} +var element = client.findElement(new ReqFindElement{ WidgetType = "TextField" }); +var response = client.setValue(new ReqSetValue{ ElementId = element.Element.ElementId, StringValue = "Test" }); +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %}
diff --git a/docs/docs/gettingstarted/C#.md b/docs/docs/gettingstarted/C#.md new file mode 100644 index 0000000..08051d3 --- /dev/null +++ b/docs/docs/gettingstarted/C#.md @@ -0,0 +1,74 @@ +--- +layout: default +title: C# +parent: Getting Started +nav_order: 34 +--- + +# Quick Start +{: .fs-8 } + +This guide gets you started with Aurum in C# with a simple working example. +This guide allows you to use Aurum on Tizen devices. +{: .fs-5 .fw-300 } + +## Prerequisites + +## Download the example +```bash +# Clone the repository to get the example code: +$ git clone -b tizen git://git.tizen.org/platform/core/uifw/aurum +# Navigate to the C# example: +$ cd aurum/examples/C# +# Install the example's dependencies +``` + +## Download the aurum.proto +From the examples/C# directory: +```bash +$ curl -L -O https://github.sec.samsung.net/pages/tizen/aurum/protocol/aurum.proto +``` + +## Connect to target +```bash +$ sdb shell app_launcher -s org.tizen.aurum-bootstrap +$ sdb forward tcp:50051 tcp:50051 +``` + +## Run a Aurum example +From the examples/C# directory: +```bash +$ dotnet run +``` +Congratulations! You’ve just run a UI automation test application with Aurum. + +## Introduce an example code +{% capture code %} +{% highlight csharp linenos %} +using System; +using Grpc.Core; +using Aurum; + +namespace GrpcSample +{ + static class Program + { + [STAThread] + static void Main(string[] args) + { + Environment.SetEnvironmentVariable("GRPC_CSHARP_EXT_OVERRIDE_LOCATION", "/usr/lib/libgrpc_csharp_ext.so", EnvironmentVariableTarget.Process); + Channel channel = new Channel("127.0.0.1:50051", ChannelCredentials.Insecure); + var client = new Bootstrap.BootstrapClient(channel); + var response = client.getDeviceTime(new ReqGetDeviceTime{ Type = ReqGetDeviceTime.Types.TimeType.Wallclock }); + Console.WriteLine(response.LocaleDatetime); + } + } +} +{% endhighlight %} +{% endcapture %} +{% include fix_linenos.html code=code %} +{% assign code = nil %} + +## What’s next +- Explore the [API reference](/tizen/aurum/docs/commands/). +- The Aurum [issue tracker](https://github.sec.samsung.net/tizen/aurum/issues) - let the Aurum maintainers know here if you think you've found a bug \ No newline at end of file diff --git a/docs/docs/gettingstarted/java.md b/docs/docs/gettingstarted/java.md index 7553fbe..b45da7f 100644 --- a/docs/docs/gettingstarted/java.md +++ b/docs/docs/gettingstarted/java.md @@ -21,13 +21,13 @@ $ git clone -b tizen git://git.tizen.org/platform/core/uifw/aurum # Navigate to the Java example: $ cd aurum/examples/java # Install the example's dependencies -$ npm install +$ npm install ``` ## Download the aurum.proto From the examples/node directory: ```bash -$ curl -L -O https://github.sec.samsung.net/pages/tizen/aurum/protocol/aurum.proto +$ curl -L -O https://github.sec.samsung.net/pages/tizen/aurum/protocol/aurum.proto ``` ## What’s next diff --git a/docs/docs/gettingstarted/node.md b/docs/docs/gettingstarted/node.md index b4ca87e..33b1c07 100644 --- a/docs/docs/gettingstarted/node.md +++ b/docs/docs/gettingstarted/node.md @@ -21,13 +21,13 @@ $ git clone -b tizen git://git.tizen.org/platform/core/uifw/aurum # Navigate to the Node example: $ cd aurum/examples/node # Install the example's dependencies -$ npm install +$ npm install ``` ## Download the aurum.proto From the examples/node directory: ```bash -$ curl -L -O https://github.sec.samsung.net/pages/tizen/aurum/protocol/aurum.proto +$ curl -L -O https://github.sec.samsung.net/pages/tizen/aurum/protocol/aurum.proto ``` ## Connect to target diff --git a/docs/docs/gettingstarted/python.md b/docs/docs/gettingstarted/python.md index 993af78..0f32c23 100644 --- a/docs/docs/gettingstarted/python.md +++ b/docs/docs/gettingstarted/python.md @@ -41,7 +41,7 @@ $ cd aurum/examples/python ## Generate gRPC code from aurum.proto From the examples/python directory: ```bash -$ curl -L -O https://github.sec.samsung.net/pages/tizen/aurum/protocol/aurum.proto +$ curl -L -O https://github.sec.samsung.net/pages/tizen/aurum/protocol/aurum.proto $ python3 -m grpc_tools.protoc --python_out=. --grpc_python_out=. --proto_path=. aurum.proto ``` diff --git a/docs/index.md b/docs/index.md index efb087e..29f17fb 100644 --- a/docs/index.md +++ b/docs/index.md @@ -9,7 +9,7 @@ permalink: / # Aurum {: .fs-9 } -Aurum is a UI automation framework without UI Toolkit dependency. +Aurum is a UI automation framework without UI Toolkit dependency. {: .fs-6 .fw-300 } [Learn more](/tizen/aurum/docs/introduction){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } @@ -17,8 +17,8 @@ Aurum is a UI automation framework without UI Toolkit dependency. Get started now! {: .fs-6 .fw-300 } -[Python](/tizen/aurum/docs/gettingstarted/python){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } [Node](/tizen/aurum/docs/gettingstarted/node){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } ---- +[Python](/tizen/aurum/docs/gettingstarted/python){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } [Node](/tizen/aurum/docs/gettingstarted/node){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } [C#](/tizen/aurum/docs/gettingstarted/C#){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } +--- ### License diff --git a/examples/C#/GrpcSample.csproj b/examples/C#/GrpcSample.csproj new file mode 100644 index 0000000..dea3bb3 --- /dev/null +++ b/examples/C#/GrpcSample.csproj @@ -0,0 +1,34 @@ + + + + Exe + netcoreapp3.1 + + + + portable + + + None + + + + + + + + + Runtime + + + + + + + + + + True + + + diff --git a/examples/C#/helloworld.cs b/examples/C#/helloworld.cs new file mode 100644 index 0000000..69dfe01 --- /dev/null +++ b/examples/C#/helloworld.cs @@ -0,0 +1,19 @@ +using System; +using Grpc.Core; +using Aurum; + +namespace GrpcSample +{ + static class Program + { + [STAThread] + static void Main(string[] args) + { + Environment.SetEnvironmentVariable("GRPC_CSHARP_EXT_OVERRIDE_LOCATION", "/usr/lib/libgrpc_csharp_ext.so", EnvironmentVariableTarget.Process); + Channel channel = new Channel("127.0.0.1:50051", ChannelCredentials.Insecure); + var client = new Bootstrap.BootstrapClient(channel); + var response = client.getDeviceTime(new ReqGetDeviceTime{ Type = ReqGetDeviceTime.Types.TimeType.Wallclock }); + Console.WriteLine(response.LocaleDatetime); + } + } +} diff --git a/examples/C#/tizen-manifest.xml b/examples/C#/tizen-manifest.xml new file mode 100644 index 0000000..5ee289d --- /dev/null +++ b/examples/C#/tizen-manifest.xml @@ -0,0 +1,12 @@ + + + + + GrpcSample.png + + + + + http://tizen.org/privilege/window.priority.set + +