This file contains hidden or 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
| private void ShutdownComputer(IDevice computer, ISecurityCredentials credentials) | |
| { | |
| ServiceHelper.Call<ShutdownResponse>(computer, new Shutdown(), credentials, (shutdownResponse, exception) => | |
| { | |
| if (exception is API.Exceptions.PermissionDeniedException) | |
| { | |
| // pincode required for call, prompt user for it in full version | |
| if (credentials == null) | |
| { | |
| var dummyCredentials = new API.Security.PinCode |
This file contains hidden or 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
| using FragLabs.Adjutant.API; | |
| using FragLabs.Adjutant.API.Attributes; | |
| using FragLabs.Adjutant.API.Services; | |
| using FragLabs.Adjutant.API.Location; | |
| using FragLabs.Adjutant.API.Devices; | |
| using FragLabs.Adjutant.API.Web; | |
| using FragLabs.Adjutant.API.Apps; | |
| namespace OfficeControlScript | |
| { |
This file contains hidden or 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
| Imports System | |
| Imports FragLabs.Adjutant.API.Helpers | |
| Namespace ScriptingExample | |
| Public Class Script | |
| Sub Run | |
| Services.Call("/scripts/csharp", Sub(str as String, ex as Exception) | |
| Console.WriteLine("CSharp says: {0}", str) | |
| End Sub | |
| ) |
This file contains hidden or 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
| Imports System | |
| Imports FragLabs.Adjutant.API.Helpers | |
| Namespace ScriptingExample | |
| Public Class Script | |
| Sub Run | |
| Services.Add(""/scripts/vbnet"", Function() | |
| return ""Hello Scripts From VB.NET"" | |
| End Function | |
| ) |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Net; | |
| using System.Net.Sockets; | |
| using FragLabs.Adjutant.Network.Exceptions; | |
| using FragLabs.Adjutant.Network.Interfaces; | |
| namespace FragLabs.Adjutant.Network.Sockets | |
| { | |
| /// <summary> |
This file contains hidden or 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
| public void Send(Message message) | |
| { | |
| if (message == null) throw new ArgumentNullException("message"); | |
| if (!IsConnected) | |
| throw new Exception("Socket not connected"); | |
| var rawMessage = message.Encode(); | |
| if (rawMessage.Length > uint.MaxValue) | |
| throw new Exception("Message too long"); | |
| var fullMessage = new byte[rawMessage.Length + 4]; | |
| var len = BitConverter.GetBytes((uint)rawMessage.Length); |
This file contains hidden or 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
| private void SetupSpeechCommands() | |
| { | |
| var recognizer = Speech.GetRecognizer(); | |
| if (recognizer == null) | |
| { | |
| throw new SpeechRecognitionException("Recognizer not available."); | |
| } | |
| var locationNames = new List<string>(); | |
| foreach (var location in Locations.Get()) |
This file contains hidden or 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
| using ServiceStack.ServiceInterface; | |
| namespace OAuth.Services | |
| { | |
| [TwoLegged] | |
| [ThreeLegged] | |
| public class Friends : OAuth.Service | |
| { | |
| public object Get(DTOs.Friends friends) | |
| { |
This file contains hidden or 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
| var i = 0; | |
| var upperBound = itemsToDisplay + startOffset; | |
| foreach (var item in Items) | |
| { | |
| if (i < startOffset || i >= upperBound) | |
| { | |
| if (item.IsDisplayed) | |
| { | |
| _layout.Remove(item.ProxyDrawable); | |
| item.IsDisplayed = false; |
This file contains hidden or 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
| using FragLabs.Adjutant.API.Services; | |
| using FragLabs.Adjutant.Modules.Video.Dtos; | |
| namespace FragLabs.Adjutant.Modules.Video.Services | |
| { | |
| public class BrowseService : Service<Browse> | |
| { | |
| public override object Execute(Browse request) | |
| { | |
| var app = (VideoApp)Context.App; |