コード例 #1
0
        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
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: A2Access/examples
        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();
            });
        }
コード例 #5
0
        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
        }
コード例 #6
0
		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();
		}
コード例 #7
0
        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);
        }
コード例 #8
0
        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(','));
            }
        }
コード例 #9
0
 protected StereoApplication(ApplicationOptions opts) : base(opts)
 {
 }
コード例 #10
0
 public WorldView(ApplicationOptions options = null) : base(options)
 {
 }
コード例 #11
0
 public HelloGUI(ApplicationOptions options = null) : base(options)
 {
 }
コード例 #12
0
 public SignedDistanceFieldText(ApplicationOptions options = null) : base(options)
 {
 }
コード例 #13
0
 public UrhoApp(ApplicationOptions opts) : base(opts)
 {
 }
コード例 #14
0
ファイル: Ragdolls.cs プロジェクト: cianmulville/urho-samples
		public Ragdolls(ApplicationOptions options = null) : base(options) { }
コード例 #15
0
 public ARCoreSample(ApplicationOptions options) : base(options)
 {
 }
コード例 #16
0
 private static ApplicationOptions SetOptions(ApplicationOptions options)
 {
     options.TouchEmulation = true;
     return(options);
 }
コード例 #17
0
		public Urho2DPhysics(ApplicationOptions options = null) : base(options) { }
コード例 #18
0
		public Urho2DSpriterAnimation(ApplicationOptions options = null) : base(options) { }
コード例 #19
0
		public SkeletalAnimation(ApplicationOptions options = null) : base(options) { }
コード例 #20
0
ファイル: Actions.cs プロジェクト: jiailiuyan/urho-samples
		public Actions(ApplicationOptions options = null) : base(options) { }
コード例 #21
0
		public StaticScene(ApplicationOptions options = null) : base(options) { }
コード例 #22
0
		public DynamicGeometry(ApplicationOptions options = null) : base(options) { }
コード例 #23
0
		public BasicTechniques(ApplicationOptions options = null) : base(options) { }
コード例 #24
0
		public LightAnimation(ApplicationOptions options = null) : base(options) { }
コード例 #25
0
 public SearchController(IOptions <ApplicationOptions> applicationOptions, ElasticsearchClient elasticsearchClient)
 {
     this.applicationOptions  = applicationOptions.Value;
     this.elasticsearchClient = elasticsearchClient;
 }
コード例 #26
0
		public CrowdNavigation(ApplicationOptions options = null) : base(options) { }
コード例 #27
0
ファイル: Charts.cs プロジェクト: cianmulville/urho-samples
		public Charts(ApplicationOptions options = null) : base(SetOptions(options)) {}
コード例 #28
0
 public UIDrag(ApplicationOptions options = null) : base(options)
 {
 }
コード例 #29
0
		public SceneAndUILoad(ApplicationOptions options = null) : base(options) { }
コード例 #30
0
ファイル: Sample.cs プロジェクト: cianmulville/urho-samples
		protected Sample (ApplicationOptions options = null) : base (options) {}
コード例 #31
0
 public TGame Run <TGame>(ApplicationOptions options = null) where TGame : Urho.Application
 {
     return((TGame)Run(typeof(TGame), options));
 }
コード例 #32
0
		public Urho2DConstraints(ApplicationOptions options = null) : base(options) { }
コード例 #33
0
ファイル: Program.cs プロジェクト: yangli6217/urho-samples
 public HelloWorldApplication(ApplicationOptions opts) : base(opts)
 {
 }
コード例 #34
0
		public HelloWorld(ApplicationOptions options = null) : base(options) {}
コード例 #35
0
 //###################################################################################################################
 /// <summary>
 /// Application constructor.
 /// </summary>
 /// <param name="opts"> options that are used to launch application </param>
 public CollisionApplication(ApplicationOptions opts) : base(opts)
 {
 }
コード例 #36
0
		public CharacterDemo(ApplicationOptions options = null) : base(options) { }
コード例 #37
0
ファイル: Water.cs プロジェクト: scbwin/UrhoSamples2019
 public Water(ApplicationOptions options = null) : base(options)
 {
 }
コード例 #38
0
		public PhysicsStressTest(ApplicationOptions options = null) : base(options) { }
コード例 #39
0
 public ApplicationThreadingProfiler(ICollector collector, IOptionAccessor <ApplicationOptions> optionAccessor)
 {
     _collector          = collector ?? throw new ArgumentNullException(nameof(collector));
     _applicationOptions = optionAccessor.Value;
 }
コード例 #40
0
 public ThreeDModelViewer(ApplicationOptions options) : base(options)
 {
 }
コード例 #41
0
 //private Token _token;
 public BimProjectFoldersApi(Token token, ApplicationOptions options) : base(token, options)
 {
     ContentType = "application/json";
     //_token = token;
 }
コード例 #42
0
		public MaterialAnimation(ApplicationOptions options = null) : base(options) { }
コード例 #43
0
 public MemoryBookDbContextFactory()
 {
     this.applicationOptions = CreateConfiguration().GetSection("Application").Get <ApplicationOptions>();
 }
コード例 #44
0
 public Task ImportProject(ProjectImportedEvent @event, ApplicationOptions options)
 {
     return(Task.CompletedTask);
 }
コード例 #45
0
ファイル: Sample.cs プロジェクト: zeadion/urho-samples
 protected Sample(ApplicationOptions options = null) : base(options)
 {
 }
コード例 #46
0
 public PBRMaterials(ApplicationOptions options = null) : base(options)
 {
 }
コード例 #47
0
 public Charts(ApplicationOptions options = null) : base(SetOptions(options))
 {
 }
コード例 #48
0
 public CreateIdentityHandler(AppDbContext identityDBContext, IOptions <ApplicationOptions> options, UtilsService utils)
 {
     this.IdentityDBContext = identityDBContext;
     this.Utils             = utils;
     this.Options           = options?.Value ?? throw new NullReferenceException(nameof(ApplicationOptions));
 }
コード例 #49
0
 public RenderToTexture(ApplicationOptions options = null) : base(options)
 {
 }
コード例 #50
0
 public MyGame(ApplicationOptions opts) : base(opts)
 {
 }
コード例 #51
0
 public Actions(ApplicationOptions options = null) : base(options)
 {
 }
コード例 #52
0
        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));
        }
コード例 #53
0
		public ConsoleInput(ApplicationOptions options = null) : base(options) { }
コード例 #54
0
 public AppDebug(ApplicationOptions options = null) : base(options)
 {
 }
コード例 #55
0
ファイル: Charts.cs プロジェクト: cianmulville/urho-samples
		private static ApplicationOptions SetOptions(ApplicationOptions options)
		{
			options.TouchEmulation = true;
			return options;
		}
コード例 #56
0
 public SoundEffects(ApplicationOptions options = null) : base(options)
 {
 }
コード例 #57
0
		public PBRMaterials(ApplicationOptions options = null) : base(options) { }
コード例 #58
0
 public MockFactoryWithDefaults(ApplicationOptions options) : base(options)
 {
 }
コード例 #59
0
ファイル: Decals.cs プロジェクト: yuki629/urho-samples
 public Decals(ApplicationOptions options = null)
     : base(options)
 {
 }
コード例 #60
0
 public EarthGlobeView(ApplicationOptions options = null) : base(options) { }