public void ShouldGetApplicationAsynchronously() { manualResetEvent = new ManualResetEvent(false); var client = new TwilioRestClient(Credentials.AccountSid, Credentials.AuthToken); ApplicationOptions options = new ApplicationOptions(); var originalApplication = client.AddApplication(Utilities.MakeRandomFriendlyName(), options); Assert.IsNotNull(originalApplication.Sid); Application result = null; client.GetApplication(originalApplication.Sid, app => { result = app; manualResetEvent.Set(); }); manualResetEvent.WaitOne(); Assert.IsNotNull(result); Assert.IsNull(result.RestException); Assert.AreEqual(originalApplication.Sid, result.Sid); client.DeleteApplication(result.Sid); //cleanup }
public void ShouldAddNewApplicationAsynchronously() { RestRequest savedRequest = null; mockClient.Setup(trc => trc.ExecuteAsync<Application>(It.IsAny<RestRequest>(), It.IsAny<Action<Application>>())) .Callback<RestRequest, Action<Application>>((request, action) => savedRequest = request); var client = mockClient.Object; manualResetEvent = new ManualResetEvent(false); var options = new ApplicationOptions(); var friendlyName = Utilities.MakeRandomFriendlyName(); client.AddApplication(friendlyName, options, app => { manualResetEvent.Set(); }); manualResetEvent.WaitOne(1); mockClient.Verify(trc => trc.ExecuteAsync<Application>(It.IsAny<RestRequest>(), It.IsAny<Action<Application>>()), Times.Once); Assert.IsNotNull(savedRequest); Assert.AreEqual("Accounts/{AccountSid}/Applications.json", savedRequest.Resource); Assert.AreEqual("POST", savedRequest.Method); Assert.AreEqual(1, savedRequest.Parameters.Count); var friendlyNameParam = savedRequest.Parameters.Find(x => x.Name == "FriendlyName"); Assert.IsNotNull(friendlyNameParam); Assert.AreEqual(friendlyName, friendlyNameParam.Value); }
public async Task ShouldAddNewApplication() { RestRequest savedRequest = null; var tcs = new TaskCompletionSource<Application>(); tcs.SetResult(new Application()); mockClient.Setup(trc => trc.Execute<Application>(It.IsAny<RestRequest>())) .Callback<RestRequest>((request) => savedRequest = request) .Returns(tcs.Task); var client = mockClient.Object; var options = new ApplicationOptions(); var friendlyName = Utilities.MakeRandomFriendlyName(); await client.AddApplicationAsync(friendlyName, options); mockClient.Verify(trc => trc.Execute<Application>(It.IsAny<RestRequest>()), Times.Once); Assert.IsNotNull(savedRequest); Assert.AreEqual("Accounts/{AccountSid}/Applications.json", savedRequest.Resource); Assert.AreEqual("POST", savedRequest.Method); Assert.AreEqual(1, savedRequest.Parameters.Count); var friendlyNameParam = savedRequest.Parameters.Find(x => x.Name == "FriendlyName"); Assert.IsNotNull(friendlyNameParam); Assert.AreEqual(friendlyName, friendlyNameParam.Value); }
public void onReady() { setConnectButtonState("Disconnect", true, true); interAppBus_ = controller_.getInterApplicationBus(); interAppBus_.addSubscribeListener((uuid, topic) => { bool exists = false; if (!subscriptionMap.TryGetValue(topic, out exists)) { subscriptionMap.Add(topic, true); if (subscriptionCallback != null) subscriptionCallback(); } }); Console.WriteLine("OnReady."); ApplicationOptions mainAppOptions = new ApplicationOptions(htmlDemoUuid_, htmlDemoUuid_, "https://developer.openf.in/htmlinterappcommdemo/1/index.html"); mainAppOptions.Version = "v1.0.0.0b"; mainAppOptions.IsAdmin = true; WindowOptions mainWindowOptions = mainAppOptions.MainWindowOptions; mainWindowOptions.AutoShow = true; mainWindowOptions.DefaultLeft = 100; mainWindowOptions.DefaultTop = 100; mainWindowOptions.DefaultWidth = 510; mainWindowOptions.DefaultHeight = 350; mainWindowOptions.Maximizable = false; mainWindowOptions.ShowTaskbarIcon = true; AckCallback afterAppCreation = (ack) => { Console.WriteLine("afterAppCreation"); Console.WriteLine(ack.getJsonObject().ToString()); AckCallback afterRun = (runAck) => { Console.WriteLine("afterRun"); Console.WriteLine(runAck.getJsonObject().ToString()); }; Console.WriteLine("app.run()"); // Using same callback for success and error in case app is already running htmlApplication_.run(afterRun, afterRun); }; // Using same callback for success and error in case app already exists Console.WriteLine("Creating App"); htmlApplication_ = new Application(mainAppOptions, controller_, afterAppCreation, afterAppCreation); htmlApplication_.addEventListener("closed", (ack) => { controller_.disconnect(); System.Windows.Forms.Application.ExitThread(); }); }
public void ShouldAddNewApplication() { var client = new TwilioRestClient(Credentials.AccountSid, Credentials.AuthToken); ApplicationOptions options = new ApplicationOptions(); var result = client.AddApplication(Utilities.MakeRandomFriendlyName(), options); Assert.IsNotNull(result); Assert.IsNull(result.RestException); Assert.IsNotNull(result.Sid); client.DeleteApplication(result.Sid); //cleanup }
async void RunGame(TypeInfo value) { currentApplication?.Exit(); if (value == null) return; await semaphoreSlim.WaitAsync(); //urho will destroy our Panel on Exit so let's create it for each sample var urhoSurface = new Panel { Dock = DockStyle.Fill }; //TODO: capture mouse inside the control WindowsFormsHost.Child = urhoSurface; WindowsFormsHost.Focus(); urhoSurface.Focus(); await Task.Yield(); var appOptions = new ApplicationOptions(assetsFolder: "Data") { ExternalWindow = RunInSdlWindow.IsChecked.Value ? IntPtr.Zero : urhoSurface.Handle, LimitFps = false, //true means "limit to 200fps" }; currentApplication = Urho.Application.CreateInstance(value.Type, appOptions); currentApplication.Run(); semaphoreSlim.Release(); }
public void ShouldAddNewApplication() { IRestRequest savedRequest = null; mockClient.Setup(trc => trc.Execute<Application>(It.IsAny<IRestRequest>())) .Callback<IRestRequest>((request) => savedRequest = request) .Returns(new Application()); var client = mockClient.Object; var options = new ApplicationOptions(); var friendlyName = Utilities.MakeRandomFriendlyName(); client.AddApplication(friendlyName, options); mockClient.Verify(trc => trc.Execute<Application>(It.IsAny<IRestRequest>()), Times.Once); Assert.IsNotNull(savedRequest); Assert.AreEqual("Accounts/{AccountSid}/Applications.json", savedRequest.Resource); Assert.AreEqual(Method.POST, savedRequest.Method); Assert.AreEqual(1, savedRequest.Parameters.Count); var friendlyNameParam = savedRequest.Parameters.Find(x => x.Name == "FriendlyName"); Assert.IsNotNull (friendlyNameParam); Assert.AreEqual (friendlyName, friendlyNameParam.Value); }
public override void OnCreate() { base.OnCreate(); Options = new ApplicationOptions(); Runner.Instance.Options.TimeoutMessage = Resources.GetString(Resource.String.TimeoutMessage); Runner.Instance.Options.UsingMessage = Resources.GetString(Resource.String.UsingMessage); Runner.Instance.Options.ClassMessage = Resources.GetString(Resource.String.ClassMessage); _preferenceChangeListener = new SharedPreferenceChangeListener(this); var preferences = PreferenceManager.GetDefaultSharedPreferences(this); preferences.RegisterOnSharedPreferenceChangeListener(_preferenceChangeListener); if (preferences.GetBoolean(PreferenceKeys.SaveNamespaces, false)) { string namespaces = preferences.GetString(PreferenceKeys.SavedNamespaces, ""); if (!string.IsNullOrEmpty(namespaces)) Runner.Instance.Options.DefaultNamespaces = new List<string>(namespaces.Split(',')); } }
protected StereoApplication(ApplicationOptions opts) : base(opts) { }
public WorldView(ApplicationOptions options = null) : base(options) { }
public HelloGUI(ApplicationOptions options = null) : base(options) { }
public SignedDistanceFieldText(ApplicationOptions options = null) : base(options) { }
public UrhoApp(ApplicationOptions opts) : base(opts) { }
public Ragdolls(ApplicationOptions options = null) : base(options) { }
public ARCoreSample(ApplicationOptions options) : base(options) { }
private static ApplicationOptions SetOptions(ApplicationOptions options) { options.TouchEmulation = true; return(options); }
public Urho2DPhysics(ApplicationOptions options = null) : base(options) { }
public Urho2DSpriterAnimation(ApplicationOptions options = null) : base(options) { }
public SkeletalAnimation(ApplicationOptions options = null) : base(options) { }
public Actions(ApplicationOptions options = null) : base(options) { }
public StaticScene(ApplicationOptions options = null) : base(options) { }
public DynamicGeometry(ApplicationOptions options = null) : base(options) { }
public BasicTechniques(ApplicationOptions options = null) : base(options) { }
public LightAnimation(ApplicationOptions options = null) : base(options) { }
public SearchController(IOptions <ApplicationOptions> applicationOptions, ElasticsearchClient elasticsearchClient) { this.applicationOptions = applicationOptions.Value; this.elasticsearchClient = elasticsearchClient; }
public CrowdNavigation(ApplicationOptions options = null) : base(options) { }
public Charts(ApplicationOptions options = null) : base(SetOptions(options)) {}
public UIDrag(ApplicationOptions options = null) : base(options) { }
public SceneAndUILoad(ApplicationOptions options = null) : base(options) { }
protected Sample (ApplicationOptions options = null) : base (options) {}
public TGame Run <TGame>(ApplicationOptions options = null) where TGame : Urho.Application { return((TGame)Run(typeof(TGame), options)); }
public Urho2DConstraints(ApplicationOptions options = null) : base(options) { }
public HelloWorldApplication(ApplicationOptions opts) : base(opts) { }
public HelloWorld(ApplicationOptions options = null) : base(options) {}
//################################################################################################################### /// <summary> /// Application constructor. /// </summary> /// <param name="opts"> options that are used to launch application </param> public CollisionApplication(ApplicationOptions opts) : base(opts) { }
public CharacterDemo(ApplicationOptions options = null) : base(options) { }
public Water(ApplicationOptions options = null) : base(options) { }
public PhysicsStressTest(ApplicationOptions options = null) : base(options) { }
public ApplicationThreadingProfiler(ICollector collector, IOptionAccessor <ApplicationOptions> optionAccessor) { _collector = collector ?? throw new ArgumentNullException(nameof(collector)); _applicationOptions = optionAccessor.Value; }
public ThreeDModelViewer(ApplicationOptions options) : base(options) { }
//private Token _token; public BimProjectFoldersApi(Token token, ApplicationOptions options) : base(token, options) { ContentType = "application/json"; //_token = token; }
public MaterialAnimation(ApplicationOptions options = null) : base(options) { }
public MemoryBookDbContextFactory() { this.applicationOptions = CreateConfiguration().GetSection("Application").Get <ApplicationOptions>(); }
public Task ImportProject(ProjectImportedEvent @event, ApplicationOptions options) { return(Task.CompletedTask); }
protected Sample(ApplicationOptions options = null) : base(options) { }
public PBRMaterials(ApplicationOptions options = null) : base(options) { }
public Charts(ApplicationOptions options = null) : base(SetOptions(options)) { }
public CreateIdentityHandler(AppDbContext identityDBContext, IOptions <ApplicationOptions> options, UtilsService utils) { this.IdentityDBContext = identityDBContext; this.Utils = utils; this.Options = options?.Value ?? throw new NullReferenceException(nameof(ApplicationOptions)); }
public RenderToTexture(ApplicationOptions options = null) : base(options) { }
public MyGame(ApplicationOptions opts) : base(opts) { }
public static ISomaticVariantCaller CreateMockVariantCaller(VcfFileWriter vcfWriter, ApplicationOptions options, ChrReference chrRef, MockAlignmentExtractor mockAlignmentExtractor, IStrandBiasFileWriter biasFileWriter = null, string intervalFilePath = null) { var config = new AlignmentSourceConfig { MinimumMapQuality = options.MinimumMapQuality, OnlyUseProperPairs = options.OnlyUseProperPairs, }; //var mateFinder = options.StitchReads ? new AlignmentMateFinder() : null; AlignmentMateFinder mateFinder = null; var alignmentSource = new AlignmentSource(mockAlignmentExtractor, mateFinder, config); var variantFinder = new CandidateVariantFinder(options.MinimumBaseCallQuality, options.MaxSizeMNV, options.MaxGapBetweenMNV, options.CallMNVs); var coverageCalculator = new CoverageCalculator(); var alleleCaller = new AlleleCaller(new VariantCallerConfig { IncludeReferenceCalls = options.OutputgVCFFiles, MinVariantQscore = options.MinimumVariantQScore, MaxVariantQscore = options.MaximumVariantQScore, VariantQscoreFilterThreshold = options.FilteredVariantQScore > options.MinimumVariantQScore ? options.FilteredVariantQScore : (int?)null, MinCoverage = options.MinimumDepth, MinFrequency = options.MinimumFrequency, EstimatedBaseCallQuality = options.AppliedNoiseLevel == -1 ? options.MinimumBaseCallQuality : options.AppliedNoiseLevel, StrandBiasModel = options.StrandBiasModel, StrandBiasFilterThreshold = options.StrandBiasAcceptanceCriteria, FilterSingleStrandVariants = options.FilterOutVariantsPresentOnlyOneStrand, ChrReference = chrRef }, coverageCalculator: coverageCalculator, variantCollapser: options.Collapse ? new VariantCollapser(null, coverageCalculator) : null); var stateManager = new RegionStateManager( expectStitchedReads: mockAlignmentExtractor.SourceIsStitched, trackOpenEnded: options.Collapse, trackReadSummaries: options.CoverageMethod == CoverageMethod.Approximate); //statmanager is an allele source Assert.Equal(0, stateManager.GetAlleleCount(1, AlleleType.A, DirectionType.Forward)); return(new SomaticVariantCaller( alignmentSource, variantFinder, alleleCaller, vcfWriter, stateManager, chrRef, null, biasFileWriter)); }
public ConsoleInput(ApplicationOptions options = null) : base(options) { }
public AppDebug(ApplicationOptions options = null) : base(options) { }
private static ApplicationOptions SetOptions(ApplicationOptions options) { options.TouchEmulation = true; return options; }
public SoundEffects(ApplicationOptions options = null) : base(options) { }
public MockFactoryWithDefaults(ApplicationOptions options) : base(options) { }
public Decals(ApplicationOptions options = null) : base(options) { }
public EarthGlobeView(ApplicationOptions options = null) : base(options) { }