Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to Container.RegisterInitializer<TService>(Action<TService>) to use Jot. #25

Unanswered
michalciolek asked this question in Q&A
Discussion options

I would like to RegisterInitializer (like SimpleInjector) using PureDI. It is possible?
I need Integrate Jot with my DI: https://github.com/anakic/Jot#ioc-integration (call tracker.Track() on all Form instances after ctor)

You must be logged in to vote

Replies: 3 comments 1 reply

Comment options

Yes, it is possible using some implementation of IFactory or generic IFactory. Please see this sample or this.

You must be logged in to vote
0 replies
Comment options

Yes, this is what I looking for.
Now I use nongeneric IFactory, with [Include(".*View$")] but I cannot filter some classes.
I have Forms and UserControls whose names end with View. How I can filter using base class instead of class name?
When I create a generic IFactory<T> where T : Form) I get There is no implicit reference conversion from SomeUserControlView to Form.

You must be logged in to vote
0 replies
Comment options

The "Include" filter works at compile time, but at run time you can perform additional filtering on already filtered types:

var val = factory();
if (val is BaseType) { }

This will work quite efficiently if you reduce the number of types at compile time, type checking is fast.

You must be logged in to vote
1 reply
Comment options

It would be nice if V2 could filter by BaseType during complication :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /