public static void CheckExistenceBinding <TBinding>(IBindingRepository bindingRepository) { if (bindingRepository.GetBinding <TBinding>() == null) { throw new BindingNotExistException($"{typeof(TBinding).Name} not founded in current module. Module: {bindingRepository.GetType().Name}"); } }
public static ObjectDescriptor AddDisposableBinding(this IBindingRepository @this, string name, IDisposable obj) { return(@this.AddDisposableBinding(obj, new AnalyzeOptions { Name = name, AnalyzeProperties = true })); }
public static void CheckViewModelBinding <TView, TViewModel>(IBindingRepository bindingRepository) where TView : FrameworkElement where TViewModel : class { Type serviceType = bindingRepository.GetBinding <TView>().ServiceType; if (!serviceType.IsEquivalentTo(typeof(TViewModel))) { throw new ServiceNotExistException($"{typeof(TViewModel).Name} is not a binding to {typeof(TView).Name}. Binding service: {serviceType.Name}"); } }
public RpcBindingHost(IConnection <TMarshal> connection, IPlatformBinder <TMarshal> parameterBinder, IScheduler baseScheduler) { this.connection = connection; bindingRepository = new BindingRepository(new IntIdGenerator()); if (baseScheduler is IDisposable disposable) { disposables.Add(disposable); } // ReSharper disable once InvokeAsExtensionMethod var baseMessages = Observable.ObserveOn(connection, baseScheduler); callbackExecutor = new CallbackExecutor <TMarshal>(new IntIdGenerator(), connection, baseMessages.Select(m => m.CallbackResult) .Where(m => m != null)); var callbackFactory = new CallbackFactory <TMarshal>(callbackExecutor); var binder = new ObjectBinderBuilder <TMarshal>().Use(typeof(CallbackBinder <TMarshal>), callbackFactory) .Use(typeof(OutgoingValueBinder <TMarshal>), bindingRepository) .Use(typeof(PlatformBinder <TMarshal>), parameterBinder).Build(); methodExecutor = new MethodExecutor <TMarshal>(bindingRepository.Objects, binder); propertyExecutor = new PropertyExecutor <TMarshal>(bindingRepository.Objects, binder); disposables.Add(Observable.ObserveOn((callbackExecutor as IObservable <DeleteCallback>), baseScheduler) .Subscribe(OnDeleteCallback)); disposables.Add(Observable.ObserveOn((callbackExecutor as IObservable <CallbackExecution <TMarshal> >), baseScheduler) .Subscribe(OnCallbackExecution)); // ReSharper disable once InvokeAsExtensionMethod disposables.Add(baseMessages .Select(m => m.MethodExecution) .Where(m => m != null) .Subscribe(OnMethodExecution)); disposables.Add(baseMessages .Select(m => m.PropertyGet) .Where(m => m != null) .Subscribe(OnPropertyGetExecution)); disposables.Add(baseMessages .Select(m => m.PropertySet) .Where(m => m != null) .Subscribe(OnPropertySetExecution)); disposables.Add(baseMessages .Select(m => m.DynamicObjectRequest) .Where(m => m != null) .Subscribe(OnDyanmicObjectRequest)); disposables.Add(connection); }
public static List <IBinding> SearchBindings(this IBindingRepository bindingRepository, IEnumerable <Type> typeBindings) { List <IBinding> bindings = new List <IBinding>(); foreach (Type bindingType in typeBindings) { IBinding binding = bindingRepository.GetBinding(bindingType); if (binding != null) { bindings.Add(binding); } } return(bindings); }
public ContainerModule(IBindingRepository bindings) : base(bindings) { _bindings = bindings; }
public Container(IBindingRepository repository) { Repository = repository; }
public Container() { Repository = BindingRepository(); }
public BindableBase(IBindingRepository repository) { _bindingRepository = repository; }
public BookController(IBookView view, IBookRepository bookRepository, IBindingRepository bindingRepository) { _view = view; _bookRepository = bookRepository; _bindingRepository = bindingRepository; }
public static IBindingRepository AsReadOnly(this IBindingRepository @this) { return(new ReadOnlyBindingRepositry(@this)); }
public Component(IBindingRepository repository, Type bindingType) { _repository = repository; _bindingType = bindingType; }
public ViewRegister(IBindingRepository bindingRepository) { _bindableBase = new BindableBase(bindingRepository); }
public void Init() { _swordBinding = new Binding(typeof(IWeapon), typeof(Sword)); _repository = new Repository(); }
public ViewFactory(IModule controllerModule, IImplementor implementor) { _viewModelsBindings = controllerModule.Bindings; _implementor = implementor; }
public Configuration(IBindingRepository repository) { _repository = repository; }
public OutgoingValueBinder(BindingDelegate <TMarshal> next, IBindingRepository bindingRepository) { this.next = next; this.bindingRepository = bindingRepository; }
public ReadOnlyBindingRepositry(IBindingRepository wrapped) { this.wrapped = wrapped; }