Ejemplo n.º 1
0
		/// <summary>
		/// Instantiates a new Formula predicate.
		/// </summary>
		/// <param name="resolutionType">The type of resolution for the formula.</param>
		/// <param name="bob">The business object binder to use when evaluating the formula, or null.</param>
		/// <param name="expression">The expression value, i.e. the C# code source that should be computable.</param>
		/// <param name="evaluator">A precompiled evaluator, or null.</param>
		private Formula(FormulaResolutionType resolutionType, IBinder bob, string expression, IDictionaryEvaluator evaluator):base(expression) {
			this.resolutionType = resolutionType;
			this.bob = bob;
			this.expression = expression;
			this.evaluator = evaluator;
			this.functionSignature = null;
		}
Ejemplo n.º 2
0
 public static void RecordTime_Manual(
     DateTime startTime,
     IBinder binder,
     TextWriter logger)
 {
     RecordTime(binder, logger);
 }
Ejemplo n.º 3
0
 protected RibNinjectModule([NotNull] IBinderHelper binderHelper, [NotNull] IBinder binder)
 {
     if (binderHelper == null) throw new ArgumentNullException(nameof(binderHelper));
     if (binder == null) throw new ArgumentNullException(nameof(binder));
     _binderHelper = binderHelper;
     _binder = binder;
 }
Ejemplo n.º 4
0
		// This gets called once, the first time any client bind to the Service
		// and returns an instance of the LocationServicethis._binder. All future clients will
		// reuse the same instance of the this._binder
		public override IBinder OnBind (Intent intent)
		{
			Log.Debug (this._LogTag, "Client now bound to service");

			this._binder = new TaskBinder (this);
			return this._binder;
		}
Ejemplo n.º 5
0
		public override IBinder OnBind(Intent intent)
		{
			// This method must always be implemented
			Log.Debug(TAG, "OnBind");
			this.Binder = new TimestampBinder(this);
			return this.Binder;
		}
Ejemplo n.º 6
0
 /// <summary>
 /// Private constructor used for cloning.
 /// </summary>
 /// <param name="source">The source AtomFunction to use for building the new one.</param>
 private AtomFunction(AtomFunction source)
     : base(source)
 {
     this.bob = source.bob;
     this.functionSignature = source.functionSignature;
     this.resolutionType = source.resolutionType;
 }
        public void OnServiceConnected(ComponentName name, IBinder binder)
        {
            _binder = binder as AndroidSensusServiceBinder;

            if (_binder != null && ServiceConnected != null)
                ServiceConnected(this, new AndroidServiceConnectedEventArgs(_binder));
        }
Ejemplo n.º 8
0
        public void PerformProcess(IBinder binder)
        {
            // generate dummy business objects
            IDictionary businessObjects = DummyData.GetInstance().GetBusinessObjects(nbDecaCustomers);

            // instantiate an inference engine, bind my data and process the rules
            IInferenceEngine ie = new IEImpl(binder);
            ie.LoadRuleBase(new RuleML09NafDatalogAdapter(ruleBaseFile, System.IO.FileAccess.Read));
            ie.Process(businessObjects);

            // processing is done, let's analyze the results
            IList<IList<Fact>> qrs = ie.RunQuery("Fraudulent Customers");
            Console.WriteLine("\nDetected {0} fraudulent customers.", qrs.Count);
            if (qrs.Count != 2 * nbDecaCustomers)
                Console.WriteLine("\nError! " + 2* nbDecaCustomers + " was expected.");

            // check if the customer objects have been flagged correctly
            int flaggedCount = 0;
            foreach(Customer customer in (ArrayList)businessObjects["CUSTOMERS"])
                if (customer.Fraudulent)
                    flaggedCount++;

            if (flaggedCount != 2 * nbDecaCustomers)
                throw new Exception("\nError! " + 2* nbDecaCustomers + " flagged Customer objects were expected.\n");
            else
                Console.WriteLine("\nCustomer objects were correctly flagged\n");
        }
Ejemplo n.º 9
0
		// This gets called once, the first time any client bind to the Service
		// and returns an instance of the LocationServiceBinder. All future clients will
		// reuse the same instance of the binder
		public override IBinder OnBind (Intent intent)
		{
			Log.Debug (logTag, "Client now bound to service");

			binder = new LocationServiceBinder (this);
			return binder;
		}
		public void OnServiceConnected (ComponentName name, IBinder service)
		{
			Service =   IAdditionServiceStub.AsInterface(service);
			_activity.Service = (IAdditionService) Service;
			_activity.IsBound = Service != null;

		}
Ejemplo n.º 11
0
 public static void RecordTime_Queue(
     [QueueTrigger("test")] object args,
     IBinder binder,
     TextWriter logger)
 {
     RecordTime(binder, logger);
 }
        public override async Task BindAsync(IBinder binder, Stream stream, IReadOnlyDictionary<string, string> bindingData)
        {
            string boundQueueName = QueueName;
            if (bindingData != null)
            {
                boundQueueName = _queueNameBindingTemplate.Bind(bindingData);
            }

            if (FileAccess == FileAccess.Write)
            {
                Stream queueStream = binder.Bind<Stream>(new QueueAttribute(boundQueueName));
                await queueStream.CopyToAsync(stream);
            }
            else
            {
                IAsyncCollector<byte[]> collector = binder.Bind<IAsyncCollector<byte[]>>(new QueueAttribute(boundQueueName));
                byte[] bytes;
                using (MemoryStream ms = new MemoryStream())
                {
                    stream.CopyTo(ms);
                    bytes = ms.ToArray();
                }
                await collector.AddAsync(bytes);
            }
        }
 /// <summary>
 /// Handles the before add binding container event.
 /// 
 /// Used to ensure the binding value is a <see cref="UnityEngine.MonoBehaviour"/>.
 /// </summary>
 /// <param name="source">Source.</param>
 /// <param name="binding">Binding.</param>
 protected void OnBeforeAddBinding(IBinder source, ref BindingInfo binding)
 {
     if (binding.value is Type &&
         TypeUtils.IsAssignable(typeof(MonoBehaviour), binding.value as Type)) {
         throw new BindingException(CANNOT_RESOLVE_MONOBEHAVIOUR);
     }
 }
Ejemplo n.º 14
0
 public void Init()
 {
     XmlConfigurator.Configure(new FileInfo("log4net_binderbackend.config"));
     binder = BinderSingleton.Instance;
     binder.Init();
     binder.Start();
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Reads a message from the "orders" queue and writes a blob in the "orders" container
 /// </summary>
 public static void QueueToBlob(
     [QueueTrigger("orders")] string orders, 
     IBinder binder)
 {
     TextWriter writer = binder.Bind<TextWriter>(new BlobAttribute("orders/" + orders));
     writer.Write("Completed");
 }
 public void OnServiceConnected(ComponentName name, IBinder service)
 {
     var mediaPlayerServiceBinder = service as MediaPlayerServiceBinder;
     if (mediaPlayerServiceBinder != null)
     {
        instance.OnServiceConnected(mediaPlayerServiceBinder);
     }
 }
Ejemplo n.º 17
0
        public void SetUp()
        {
            testCommand = Substitute.For<CommandTest>();
            testBinder = Substitute.For<IBinder>();

            testSignal = new TestSignal();
            testSignal.injector = testBinder;
        }
Ejemplo n.º 18
0
        public void Init()
        {
            this.binder = new Binder();

            //Binds some objects to use on tests.
            binder.Bind<IMockInterface>().To<MockIClassWithAttributes>();
            binder.Bind(typeof(MockClassWithDependencies)).ToSelf();
        }
		public void OnServiceConnected (ComponentName name, IBinder service)
		{
			var serviceBinder = service as StepServiceBinder;
			if (serviceBinder != null) {
				activity.Binder = serviceBinder;
				activity.IsBound = true;
			}
		}
Ejemplo n.º 20
0
        /// <summary>
        /// Instantiates a new AtomFunction.
        /// </summary>
        /// <param name="resolutionType">The type of resolution for the atom relation function.</param>
        /// <param name="negative">Negative Atom.</param>
        /// <param name="bob">The business object binder to use when evaluating the function.</param>
        /// <param name="type">The relation type of the Atom.</param>
        /// <param name="members">Array of predicates associated in the Atom.</param>
        public AtomFunction(RelationResolutionType resolutionType,
		                    bool negative,
		                    IBinder bob,
		                    string type,
		                    params IPredicate[] members)
            : this(resolutionType, negative, bob, type, members, null)
        {
        }
Ejemplo n.º 21
0
 public void Setup()
 {
     XmlConfigurator.Configure(new FileInfo("log4net_binderfrontend.config"));
     BinderSingleton.Simple = true;
     binder = BinderSingleton.Instance;
     //Testing the Init lifecycle
     binder.Init();
 }
Ejemplo n.º 22
0
		public override void OnDestroy()
		{
			// This method is optional to implement
			Log.Debug(TAG, "OnDestroy");
			Binder = null;
			timestamper = null;
			base.OnDestroy();
		}
Ejemplo n.º 23
0
 public void OnServiceConnected(ComponentName name, IBinder service)
 {
     if (service is CompassServiceBinder)
     {
         _compassServiceBinder = (CompassServiceBinder)service;
         OpenOptionsMenu();
     }
 }
		/// <summary>
		/// This is called when the connection with the service has been established.
		/// </summary>
		/// <param name="name">Name.</param>
		/// <param name="service">Service.</param>
		public void OnServiceConnected(ComponentName name, IBinder service)
		{
			LocationServiceBinder serviceBinder = service as LocationServiceBinder;

			if (serviceBinder != null) {
				this.binder = serviceBinder;
				ConnectionChanged(this, new ServiceConnectionEventArgs(true));
			}
		}
Ejemplo n.º 25
0
		/// <summary>
		/// Instantiates a new function predicate.
		/// </summary>
		/// <param name="resolutionType">The type of resolution for the function.</param>
		/// <param name="predicate">The predicate value, i.e. the string representation of the function predicate.</param>
		/// <param name="bob">The business object binder to use when evaluating the function, or null.</param>
		/// <param name="name">The name of the function, as it was analyzed by the binder.</param>
		/// <param name="arguments">The array of arguments of the function, as it was analyzed by the binder.</param>
		public Function(FunctionResolutionType resolutionType, string predicate, IBinder bob, string name, params string[] arguments):base(predicate) {
			this.resolutionType = resolutionType;
			this.bob = bob;
			this.name = name;
			this.arguments = arguments;
			
			// precalculate the function signature to use in the binder to evaluate the function
			functionSignature = Parameter.BuildFunctionSignature(name, arguments);
		}
Ejemplo n.º 26
0
		public void OnServiceConnected (ComponentName name, IBinder service)
		{
			DataSyncBinderServiceProperty = service as DataSyncBinderService;
			this.IsBackgroundSyncBound = true;
			Task.Run (() => {
				DataSyncBinderServiceProperty.Service.SyncData (App.WorkoutCreatorContext.StaffMember.GymID);
			});

		}
Ejemplo n.º 27
0
 // This function will get triggered/executed when a new message is written
 // on an Azure Queue called queue.
 public static void ProcessQueueMessage([QueueTrigger("afro")] String message, TextWriter log, IBinder binder, Int32 dequeueCount)
 {
     log.WriteLine("este es el intento numero{0}", dequeueCount);
     if (dequeueCount <= 5)
     {
         binder.Bind<QueueAttribute>(new QueueAttribute("afro-poison"));
     }
     throw new Exception("throw perra");
 }
Ejemplo n.º 28
0
		public void OnServiceConnected (ComponentName name, IBinder service)
		{
            var serviceBinder = service as ServiceBinder;
			if (serviceBinder != null) {
                Binder = serviceBinder;
                Binder.IsBound = true;
				ServiceConnected(this, new ServiceConnectedEventArgs { Binder = service } );
			}
		}
Ejemplo n.º 29
0
        public void OnServiceConnected(ComponentName name, IBinder service)
        {
            playbackBinder = service as PlaybackBinder;
              if (playbackBinder == null) {
            throw new InvalidOperationException("Cannot bind to any service other than " + nameof(PlaybackService));
              }

              OnPlaybackServiceBound();
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultModelBinderLocator"/> class.
        /// </summary>
        /// <param name="binders">Available model binders</param>
        /// <param name="fallbackBinder">Fallback binder</param>
        public DefaultModelBinderLocator(IEnumerable<IModelBinder> binders, IBinder fallbackBinder)
        {
            this.fallbackBinder = fallbackBinder;

            if (binders != null)
            {
                this.binders = binders.ToArray();
            }
        }
Ejemplo n.º 31
0
        public static async Task Run([CosmosDBTrigger("StockBackend", "StockTransaction", ConnectionStringSetting = "CosmosDBConnection", LeaseCollectionName = "leases", LeaseDatabaseName = "StockBackend",
                                                      LeasesCollectionThroughput = 400, CreateLeaseCollectionIfNotExists = true, FeedPollDelay = 500)]
                                     JArray input,
                                     IBinder binder,
                                     ILogger log)
        {
            if (input == null || input.Count <= 0)
            {
                return;
            }

            // StockDocument �փf�V���A���C�Y
            var documents = input.ToObject <StockDocument[]>();

            // �݌ɏ��� SQL DB �ɏ�������
            var entities = documents.SelectMany(x => x.Items.Select(xs => new StockEntity
            {
                DocumentId      = x.Id,
                TransactionId   = x.TransactionId,
                TransactionDate = x.TransactionDate,
                TransactionType = x.TransactionType,
                LocationCode    = x.LocationCode,
                CompanyCode     = x.CompanyCode,
                StoreCode       = x.StoreCode,
                TerminalCode    = x.TerminalCode,
                LineNo          = xs.LineNo,
                ItemCode        = xs.ItemCode,
                Quantity        = -xs.Quantity
            }));

            using (var context = new StockDbContext())
            {
                await context.Stocks.AddRangeAsync(entities);

                await context.SaveChangesAsync();
            }

            // SignalR Service �ւ̐ڑ������񂪃Z�b�g����Ă���ꍇ�̂ݗL����
            if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SignalRConnection", EnvironmentVariableTarget.Process)))
            {
                var signalRMessages = binder.Bind <IAsyncCollector <SignalRMessage> >(new SignalRAttribute {
                    ConnectionStringSetting = "SignalRConnection", HubName = "monitor"
                });

                // �ύX�ʒm�� SignalR �ő��M����
                foreach (var document in documents)
                {
                    foreach (var item in document.Items)
                    {
                        await signalRMessages.AddAsync(new SignalRMessage
                        {
                            Target    = "update",
                            Arguments = new object[] { document.TerminalCode, item.ItemCode }
                        });
                    }
                }
            }

            // Application Insights �ɒʒm
            foreach (var document in documents)
            {
                _telemetryClient.TrackTrace("End Stock Processor", new Dictionary <string, string> {
                    { "ActivityId", document.ActivityId }
                });
            }
        }
Ejemplo n.º 32
0
 static void TernaryThenCollect(IBinder windowToken)
 {
     System.IntPtr ptr = windowToken == null ? System.IntPtr.Zero : System.IntPtr.Zero;
     // `windowToken` should not be eligible for collection during this GC, but it is.
     System.GC.Collect();
 }
Ejemplo n.º 33
0
 private void OnGeneratorSelectorAttaching(GeneratorSelectorVM context,
                                           IBinder <IContextWrapper <GeneratorSelectorVM> > binder)
 {
     binder.AttachChild(context, _generatorSelectorV);
 }
Ejemplo n.º 34
0
 static void BindAudioSource(IBinder Binder)
 {
     Binder.Bind <IAudioSource, NAudioSource>();
 }
Ejemplo n.º 35
0
        public static Task SubmitOrderAsync([ServiceBusTrigger("input-queue")] Message message, IBinder binder, Microsoft.Extensions.Logging.ILogger logger,
                                            CancellationToken cancellationToken)
        {
            logger.LogInformation("Creating brokered message receiver");

            var handler = Bus.Factory.CreateBrokeredMessageReceiver(binder, cfg =>
            {
                cfg.CancellationToken = cancellationToken;
                cfg.SetLog(logger);
                cfg.InputAddress = new Uri("sb://masstransit-build.servicebus.windows.net/input-queue");

                cfg.UseRetry(x => x.Intervals(10, 100, 500, 1000));
                cfg.Consumer(() => new SubmitOrderConsumer(cfg.Log));
            });

            return(handler.Handle(message));
        }
        /// <summary>
        /// Raises the <see cref="E:ElementChanged" /> event.
        /// </summary>
        /// <param name="e">The <see cref="ElementChangedEventArgs{Entry}"/> instance containing the event data.</param>
        protected override void OnElementChanged(ElementChangedEventArgs <Entry> e)
        {
            base.OnElementChanged(e);

            if (!((Control != null) & (e.NewElement != null)))
            {
                return;
            }

            if (!(e.NewElement is EnhancedEntry entryExt))
            {
                return;
            }
            {
                Control.ImeOptions = getValueFromDescription(entryExt.ReturnKeyType);

                Control.SetImeActionLabel(entryExt.ReturnKeyType.ToString(), Control.ImeOptions);

                _gradientDrawable = new GradientDrawable();
                _gradientDrawable.SetShape(ShapeType.Rectangle);
                _gradientDrawable.SetColor(entryExt.BackgroundColor.ToAndroid());
                _gradientDrawable.SetCornerRadius(entryExt.CornerRadius);
                _gradientDrawable.SetStroke((int)entryExt.BorderWidth, entryExt.BorderColor.ToAndroid());

                Rect padding = new Rect
                {
                    Left   = entryExt.LeftPadding,
                    Right  = entryExt.RightPadding,
                    Top    = entryExt.TopBottomPadding / 2,
                    Bottom = entryExt.TopBottomPadding / 2
                };
                _gradientDrawable.GetPadding(padding);

                e.NewElement.Focused += (sender, evt) =>
                {
                    _gradientDrawable.SetStroke(
                        (int)entryExt.BorderWidth,
                        entryExt.FocusBorderColor.ToAndroid());
                };

                e.NewElement.Unfocused += (sender, evt) =>
                {
                    _gradientDrawable.SetStroke((int)entryExt.BorderWidth, entryExt.BorderColor.ToAndroid());
                };

                if (entryExt.EntryHeight != -1)
                {
                    Control.SetHeight((int)DpToPixels(_context, entryExt.EntryHeight));
                }

                Control.SetBackground(_gradientDrawable);

                if (Control != null && !string.IsNullOrEmpty(PackageName) && !string.IsNullOrEmpty(entryExt.LeftIcon))
                {
                    int identifier = Context.Resources.GetIdentifier(
                        entryExt.LeftIcon,
                        "drawable",
                        PackageName);
                    if (identifier != 0)
                    {
                        Drawable drawable = ContextCompat.GetDrawable(_context, identifier);
                        if (drawable != null)
                        {
                            Control.SetCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null);
                            Control.CompoundDrawablePadding = entryExt.PaddingLeftIcon;

                            entryExt.IconDrawableColorChanged += (sender, args) =>
                            {
                                foreach (Drawable d in Control.GetCompoundDrawables())
                                {
                                    if (args.IsValid)
                                    {
                                        d?.SetColorFilter(new PorterDuffColorFilter(args.Color.ToAndroid(), PorterDuff.Mode.SrcIn));
                                    }
                                    else
                                    {
                                        d?.ClearColorFilter();
                                    }
                                }
                            };
                        }
                    }
                }

                Control.EditorAction += (sender, args) =>
                {
                    if (entryExt.NextEntry == null)
                    {
                        if (_context.GetSystemService(Context.InputMethodService) is InputMethodManager inputMethodManager && _context is Activity)
                        {
                            Activity activity = (Activity)_context;
                            IBinder  token    = activity.CurrentFocus?.WindowToken;
                            inputMethodManager.HideSoftInputFromWindow(token, HideSoftInputFlags.None);

                            activity.Window.DecorView.ClearFocus();
                        }
                    }

                    entryExt.EntryActionFired();
                };
            }
        }
Ejemplo n.º 37
0
 internal BinderExpression(IBinder output, IBinder input)
 {
     this.Output = output;
     this.Input  = input;
 }
Ejemplo n.º 38
0
 public void OnServiceConnected(ComponentName name, IBinder service)
 {
     _musicPlayerService = ((MusicPlayerService.MusicPlayerServiceBinder)service).GetService();
 }
Ejemplo n.º 39
0
 public async Task <IActionResult> CustomerGroupDeletion([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req, ILogger log, IBinder binder)
 {
     return(await ValidateAndRouteMessage(req, "customergroupdeletion", binder, log));
 }
Ejemplo n.º 40
0
 public async Task <IActionResult> CollectionUpdate([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req, ILogger log, IBinder binder)
 {
     return(await ValidateAndRouteMessage(req, "collectionupdate", binder, log));
 }
Ejemplo n.º 41
0
        private async Task <IActionResult> ValidateAndRouteMessage(HttpRequest req, string messageTypeIdentifier, IBinder binder, ILogger log)
        {
            log.LogInformation("ShopifyWebhook recevied", messageTypeIdentifier);

            (bool requestIsValid, string requestBody) = await _validator.ValidateRequestAsync(req, shopifySharedSecret);

            if (!requestIsValid)
            {
                log.LogError("Invalid ShopifyWebhook recevied", messageTypeIdentifier);
                return(new BadRequestResult());
            }

            var collector = await binder.BindAsync <IAsyncCollector <string> >(new ServiceBusAttribute(messageTypeIdentifier)
            {
                Connection = serviceBusConnectionSetting,
                EntityType = EntityType.Topic
            });

            await collector.AddAsync(requestBody);

            return(new OkResult());
        }
Ejemplo n.º 42
0
 public async Task <IActionResult> ProductCreation([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req, ILogger log, IBinder binder)
 {
     return(await ValidateAndRouteMessage(req, "productcreation", binder, log));
 }
Ejemplo n.º 43
0
 // This gets called once, the first time any client bind to the Service
 // and returns an instance of the LocationServiceBinder. All future clients will
 // reuse the same instance of the binder
 public override IBinder OnBind(Intent intent)
 {
     binder = new LocationServiceBinder(this);
     return(binder);
 }
Ejemplo n.º 44
0
        public object PerformInsert(SqlCommandInfo insertSQL, ISessionImplementor session, IBinder binder)
        {
            try
            {
                // prepare and execute the insert
                IDbCommand insert = session.Batcher.PrepareCommand(insertSQL.CommandType, insertSQL.Text, insertSQL.ParameterTypes);
                try
                {
                    binder.BindValues(insert);
                    session.Batcher.ExecuteNonQuery(insert);
                }
                finally
                {
                    session.Batcher.CloseCommand(insert, null);
                }
            }
            catch (DbException sqle)
            {
                throw ADOExceptionHelper.Convert(session.Factory.SQLExceptionConverter, sqle,
                                                 "could not insert: " + persister.GetInfoString(), insertSQL.Text);
            }

            SqlString selectSQL = SelectSQL;

            using (new SessionIdLoggingContext(session.SessionId))
                try
                {
                    //fetch the generated id in a separate query
                    IDbCommand idSelect = session.Batcher.PrepareCommand(CommandType.Text, selectSQL, ParametersTypes);
                    try
                    {
                        BindParameters(session, idSelect, binder.Entity);
                        IDataReader rs = session.Batcher.ExecuteReader(idSelect);
                        try
                        {
                            return(GetResult(session, rs, binder.Entity));
                        }
                        finally
                        {
                            session.Batcher.CloseReader(rs);
                        }
                    }
                    finally
                    {
                        session.Batcher.CloseCommand(idSelect, null);
                    }
                }
                catch (DbException sqle)
                {
                    throw ADOExceptionHelper.Convert(session.Factory.SQLExceptionConverter, sqle,
                                                     "could not retrieve generated id after insert: " + persister.GetInfoString(),
                                                     insertSQL.Text);
                }
        }
Ejemplo n.º 45
0
        public void OnLoad(IBinder Binder)
        {
            Binder.BindSingleton <HotkeyActionRegisterer>();
            Binder.Bind <IIconSet, MaterialDesignIcons>();

            // Singleton View Models
            Binder.BindSingleton <MainViewModel>();
            Binder.BindSingleton <VideoViewModel>();
            Binder.BindSingleton <ProxySettingsViewModel>();
            Binder.BindSingleton <LicensesViewModel>();
            Binder.BindSingleton <CrashLogsViewModel>();
            Binder.BindSingleton <FFmpegCodecsViewModel>();
            Binder.BindSingleton <ScreenShotViewModel>();
            Binder.BindSingleton <RecentViewModel>();
            Binder.BindSingleton <RecordingViewModel>();
            Binder.BindSingleton <FileNameFormatViewModel>();

            Binder.Bind <IRecentList>(ServiceProvider.Get <RecentViewModel>);

            Binder.BindSingleton <CustomOverlaysViewModel>();
            Binder.BindSingleton <CustomImageOverlaysViewModel>();
            Binder.BindSingleton <CensorOverlaysViewModel>();

            // Settings
            Binder.BindSingleton <Settings>();
            Binder.Bind(() => ServiceProvider.Get <Settings>().Audio);
            Binder.Bind(() => ServiceProvider.Get <Settings>().FFmpeg);
            Binder.Bind(() => ServiceProvider.Get <Settings>().Gif);
            Binder.Bind(() => ServiceProvider.Get <Settings>().Proxy);
            Binder.Bind(() => ServiceProvider.Get <Settings>().Sounds);

            // Keymap
            Binder.BindSingleton <KeymapViewModel>();

            // Localization
            Binder.Bind(() => LanguageManager.Instance);

            // Hotkeys
            Binder.BindSingleton <HotKeyManager>();

            // Image Writers
            Binder.BindSingleton <DiskWriter>();
            Binder.BindSingleton <ClipboardWriter>();
            Binder.BindSingleton <ImgurWriter>();

            Binder.Bind <IImageWriterItem>(ServiceProvider.Get <DiskWriter>);
            Binder.Bind <IImageWriterItem>(ServiceProvider.Get <ClipboardWriter>);
            Binder.Bind <IImageWriterItem>(ServiceProvider.Get <ImgurWriter>);

            // Video Writer Providers
            Binder.BindSingleton <FFmpegWriterProvider>();
            Binder.BindSingleton <GifWriterProvider>();
            Binder.BindSingleton <StreamingWriterProvider>();
            Binder.BindSingleton <DiscardWriterProvider>();
            Binder.BindSingleton <SharpAviWriterProvider>();

            Binder.BindSingleton <FullScreenItem>();

            // Video Source Providers
            Binder.BindSingleton <ScreenSourceProvider>();
            Binder.BindSingleton <FullScreenSourceProvider>();
            Binder.BindSingleton <RegionSourceProvider>();
            Binder.BindSingleton <WindowSourceProvider>();
            Binder.BindSingleton <DeskDuplSourceProvider>();
            Binder.BindSingleton <NoVideoSourceProvider>();

            // Folder Browser Dialog
            Binder.Bind <IDialogService, DialogService>();

            // Clipboard
            Binder.Bind <IClipboardService, ClipboardService>();

            // FFmpeg Log
            Binder.BindSingleton <FFmpegLog>();

            // Recent Serializers
            Binder.Bind <IRecentItemSerializer, FileRecentSerializer>();
            Binder.Bind <IRecentItemSerializer, ImgurRecentSerializer>();

            // Check if Bass is available
            if (BassAudioSource.Available)
            {
                Binder.Bind <AudioSource, BassAudioSource>();
            }
            else
            {
                Binder.Bind <AudioSource, NoAudioSource>();
            }
        }
Ejemplo n.º 46
0
 public override IBinder OnBind(Intent intent)
 {
     _binder = new ServiceTestBinder(this);
     return(_binder);
 }
Ejemplo n.º 47
0
        public static Task AuditOrderAsync([EventHubTrigger("input-hub")] EventData message, IBinder binder, Microsoft.Extensions.Logging.ILogger logger,
                                           CancellationToken cancellationToken)
        {
            logger.LogInformation("Creating EventHub receiver");

            var handler = Bus.Factory.CreateEventDataReceiver(binder, cfg =>
            {
                cfg.CancellationToken = cancellationToken;
                cfg.SetLog(logger);
                cfg.InputAddress = new Uri("sb://masstransit-eventhub.servicebus.windows.net/input-hub");

                cfg.UseRetry(x => x.Intervals(10, 100, 500, 1000));
                cfg.Consumer(() => new AuditOrderConsumer(cfg.Log));
            });

            return(handler.Handle(message));
        }
Ejemplo n.º 48
0
        // This function will get triggered/executed when a new message is written
        // on an Azure Queue called invitations.
        public static void ProcessUserQueue([QueueTrigger("%queueName%")] BatchQueueItem batch, IBinder binder)
        {
            try
            {
                var mgr = new InviteManager(batch);

                BulkInviteResults res;
                var task = Task.Run(async() => {
                    res = await mgr.BulkInvitations(batch.BulkInviteSubmissionId);
                });
                task.Wait();
            }
            catch (Exception ex)
            {
                Logging.WriteToAppLog(String.Format("Error processing queue '{0}'", StorageRepo.QueueName), System.Diagnostics.EventLogEntryType.Error, ex);
                throw;
            }
        }
Ejemplo n.º 49
0
 private void _Join(IBinder binder)
 {
     this._Center.Join(binder);
 }
Ejemplo n.º 50
0
 public ServiceBusAttributePublishTransportProvider(IBinder binder, ILog log, CancellationToken cancellationToken)
 {
     _binder            = binder;
     _log               = log;
     _cancellationToken = cancellationToken;
 }
Ejemplo n.º 51
0
 private TypeValidator(ITypeManager typeManager, IBinder binder, IDiagnosticWriter diagnosticWriter)
 {
     this.typeManager      = typeManager;
     this.binder           = binder;
     this.diagnosticWriter = diagnosticWriter;
 }
Ejemplo n.º 52
0
 static void BindVideoWriterProviders(IBinder Binder)
 {
     Binder.BindAsInterfaceAndClass <IVideoWriterProvider, SharpAviWriterProvider>();
     Binder.BindAsInterfaceAndClass <IVideoWriterProvider, DiscardWriterProvider>();
 }
Ejemplo n.º 53
0
        public Model(IProgress <double> loadingProgress, string name, IBinder chrbnd, int modelIndex,
                     IBinder anibnd, IBinder texbnd = null, List <string> additionalTpfNames = null,
                     string possibleLooseTpfFolder  = null, int baseDmyPolyID         = 0,
                     bool ignoreStaticTransforms    = false, IBinder additionalTexbnd = null)
            : this()
        {
            Name = name;
            List <BinderFile> flverFileEntries = new List <BinderFile>();

            List <TPF> tpfsUsed = new List <TPF>();

            if (additionalTpfNames != null)
            {
                foreach (var t in additionalTpfNames)
                {
                    if (File.Exists(t))
                    {
                        tpfsUsed.Add(TPF.Read(t));
                    }
                }
            }

            FLVER2 flver = null;

            foreach (var f in chrbnd.Files)
            {
                var nameCheck = f.Name.ToLower();
                if (flver == null && (nameCheck.EndsWith(".flver") || FLVER2.Is(f.Bytes)))
                {
                    if (nameCheck.EndsWith($"_{modelIndex}.flver") || modelIndex == 0)
                    {
                        flver = FLVER2.Read(f.Bytes);
                    }
                }
                else if (nameCheck.EndsWith(".tpf") || TPF.Is(f.Bytes))
                {
                    tpfsUsed.Add(TPF.Read(f.Bytes));
                }
                else if (anibnd == null && nameCheck.EndsWith(".anibnd"))
                {
                    if (nameCheck.EndsWith($"_{modelIndex}.anibnd") || modelIndex == 0)
                    {
                        if (BND3.Is(f.Bytes))
                        {
                            anibnd = BND3.Read(f.Bytes);
                        }
                        else
                        {
                            anibnd = BND4.Read(f.Bytes);
                        }
                    }
                }
            }

            if (flver == null)
            {
                throw new ArgumentException("No FLVERs found within CHRBND.");
            }

            LoadFLVER2(flver, useSecondUV: false, baseDmyPolyID, ignoreStaticTransforms);

            loadingProgress.Report(1.0 / 4.0);

            AnimContainer = new NewAnimationContainer(this);

            if (anibnd != null)
            {
                LoadingTaskMan.DoLoadingTaskSynchronous($"{Name}_ANIBND", $"Loading ANIBND for {Name}...", innerProg =>
                {
                    AnimContainer.LoadBaseANIBND(anibnd, innerProg);
                });
            }
            else
            {
                // This just messes up the model cuz they're already in
                // reference pose, whoops
                //Skeleton.ApplyBakedFlverReferencePose();
            }

            loadingProgress.Report(2.0 / 3.0);

            if (tpfsUsed.Count > 0)
            {
                LoadingTaskMan.DoLoadingTaskSynchronous($"{Name}_TPFs", $"Loading TPFs for {Name}...", innerProg =>
                {
                    for (int i = 0; i < tpfsUsed.Count; i++)
                    {
                        TexturePool.AddTpf(tpfsUsed[i]);
                        MainMesh.TextureReloadQueued = true;
                        innerProg.Report(1.0 * i / tpfsUsed.Count);
                    }
                    MainMesh.TextureReloadQueued = true;
                });
            }

            loadingProgress.Report(3.0 / 4.0);

            if (texbnd != null)
            {
                LoadingTaskMan.DoLoadingTaskSynchronous($"{Name}_TEXBND", $"Loading TEXBND for {Name}...", innerProg =>
                {
                    TexturePool.AddTextureBnd(texbnd, innerProg);
                    MainMesh.TextureReloadQueued = true;
                });
            }

            loadingProgress.Report(3.5 / 4.0);

            if (additionalTexbnd != null)
            {
                LoadingTaskMan.DoLoadingTaskSynchronous($"{Name}_AdditionalTEXBND",
                                                        $"Loading extra TEXBND for {Name}...", innerProg =>
                {
                    TexturePool.AddTextureBnd(additionalTexbnd, innerProg);
                    MainMesh.TextureReloadQueued = true;
                });
            }

            loadingProgress.Report(3.9 / 4.0);
            if (possibleLooseTpfFolder != null && Directory.Exists(possibleLooseTpfFolder))
            {
                TexturePool.AddTPFFolder(possibleLooseTpfFolder);
                MainMesh.TextureReloadQueued = true;
            }

            MainMesh.TextureReloadQueued = true;

            loadingProgress.Report(1.0);
        }
Ejemplo n.º 54
0
 private void OnStructureSelectorAttaching(StructureSelectorVM context,
                                           IBinder <IContextWrapper <StructureSelectorVM> > binder)
 {
     binder.AttachChild(context, _structureSelectorV);
 }
Ejemplo n.º 55
0
 public EventHubAttributeSendTransportProvider(IBinder binder, CancellationToken cancellationToken)
 {
     _binder            = binder;
     _cancellationToken = cancellationToken;
 }
Ejemplo n.º 56
0
 public static void Run([QueueTrigger(QueueName)] QueueMessage message, IBinder binder)
 {
     TaskSource.TrySetResult(binder.Bind <string>(new QueueTriggerAttribute(QueueName)));
 }
Ejemplo n.º 57
0
 void IServiceConnection.OnServiceConnected(ComponentName name, IBinder binder)
 {
     _observer.OnNext((TBinder)binder);
 }
Ejemplo n.º 58
0
 public override IBinder OnBind(Intent intent)
 {
     binder = new TimerBackgroundingServiceBinder(this);
     return(binder);
 }
Ejemplo n.º 59
0
 public async Task <IActionResult> OrderFulfillment([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req, ILogger log, IBinder binder)
 {
     return(await ValidateAndRouteMessage(req, "orderfulfillment", binder, log));
 }
Ejemplo n.º 60
0
 public TypeAssignmentVisitor(IResourceTypeProvider resourceTypeProvider, TypeManager typeManager, IBinder binder)
 {
     this.resourceTypeProvider = resourceTypeProvider;
     this.typeManager          = typeManager;
     this.binder        = binder;
     this.assignedTypes = new Dictionary <SyntaxBase, TypeAssignment>();
 }