-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from 2gis/open-close-app
Add launchApp, closeApp support
- Loading branch information
Showing
12 changed files
with
178 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
Winium/Winium.StoreApps.Driver/CommandExecutors/CloseAppExecutor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace Winium.StoreApps.Driver.CommandExecutors | ||
{ | ||
using System; | ||
using System.Threading; | ||
|
||
using Winium.StoreApps.Common; | ||
using Winium.StoreApps.Driver.Automator; | ||
|
||
internal class CloseAppExecutor : CommandExecutorBase | ||
{ | ||
#region Public Methods and Operators | ||
|
||
public static void CloseApp(Automator automator) | ||
{ | ||
var remoteCommand = new Command(DriverCommand.CloseApp); | ||
automator.CommandForwarder.ForwardCommand(remoteCommand); | ||
Thread.Sleep(TimeSpan.FromMilliseconds(500)); | ||
} | ||
|
||
#endregion | ||
|
||
#region Methods | ||
|
||
protected override string DoImpl() | ||
{ | ||
CloseApp(this.Automator); | ||
|
||
return this.JsonResponse(); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
Winium/Winium.StoreApps.Driver/CommandExecutors/LaunchAppExecutor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace Winium.StoreApps.Driver.CommandExecutors | ||
{ | ||
using Winium.StoreApps.Driver.Automator; | ||
|
||
internal class LaunchAppExecutor : CommandExecutorBase | ||
{ | ||
#region Public Methods and Operators | ||
|
||
public static void LaunchApp(Automator automator) | ||
{ | ||
automator.Deployer.Launch(); | ||
} | ||
|
||
#endregion | ||
|
||
#region Methods | ||
|
||
protected override string DoImpl() | ||
{ | ||
LaunchApp(this.Automator); | ||
|
||
return this.JsonResponse(); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Winium/Winium.StoreApps.InnerServer/Commands/CloseAppCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace Winium.StoreApps.InnerServer.Commands | ||
{ | ||
#region | ||
|
||
using Windows.UI.Xaml; | ||
|
||
#endregion | ||
|
||
internal class CloseAppCommand : CommandBase | ||
{ | ||
#region Public Methods and Operators | ||
|
||
public override string DoImpl() | ||
{ | ||
this.Automator.DoAfterResponseOnce = () => Application.Current.Exit(); | ||
|
||
return this.JsonResponse(); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters