Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetService()

virtual ? object System.ComponentModel.Design.ServiceContainer.GetService ( Type serviceType)
inlinevirtual

Implements System.IServiceProvider.

Definition at line 147 of file ServiceContainer.cs.

148 {
149 object value = null;
151 for (int i = 0; i < defaultServices.Length; i++)
152 {
153 if (serviceType != null && serviceType.IsEquivalentTo(defaultServices[i]))
154 {
155 value = this;
156 break;
157 }
158 }
159 if (value == null && serviceType != null)
160 {
162 }
164 {
166 if (value != null && !value.GetType().IsCOMObject && !serviceType.IsInstanceOfType(value))
167 {
168 value = null;
169 }
171 }
172 if (value == null && _parentProvider != null)
173 {
175 }
176 return value;
177 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
object? GetService(Type serviceType)
delegate? object ServiceCreatorCallback(IServiceContainer container, Type serviceType)

References System.ComponentModel.Design.ServiceContainer._parentProvider, System.ComponentModel.Design.ServiceContainer.DefaultServices, System.IServiceProvider.GetService(), System.ComponentModel.Design.ServiceCreatorCallback(), System.ComponentModel.Design.ServiceContainer.Services, System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.