Suppose the .NET Component Model.
The Container class has GetService(Type service);
But I’m asking myself, how can I register Global Services accessible to all added Components ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In order to do this you’ll need to create a class that derives from
Container. The classContaineronly supports service for theGetServicecall and that’sIContainer. There is no way to extend this except for sub-typing and overriding the GetService method.However this is only of very limited value as the method
GetServiceis protected. This means it’s not usable by general components as they don’t have access to this member.