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

◆ AddService() [4/4]

virtual void System.ComponentModel.Design.ServiceContainer.AddService ( Type serviceType,
ServiceCreatorCallback callback,
bool promote )
inlinevirtual

Implements System.ComponentModel.Design.IServiceContainer.

Definition at line 95 of file ServiceContainer.cs.

96 {
97 if (promote)
98 {
99 IServiceContainer container = Container;
100 if (container != null)
101 {
102 container.AddService(serviceType, callback, promote);
103 return;
104 }
105 }
106 if (serviceType == null)
107 {
108 throw new ArgumentNullException("serviceType");
109 }
110 if (callback == null)
111 {
112 throw new ArgumentNullException("callback");
113 }
115 {
116 throw new ArgumentException(System.SR.Format(System.SR.ErrorServiceExists, serviceType.FullName), "serviceType");
117 }
118 Services[serviceType] = callback;
119 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string ErrorServiceExists
Definition SR.cs:82
Definition SR.cs:7
void AddService(Type serviceType, object serviceInstance)

References System.ComponentModel.Design.IServiceContainer.AddService(), System.ComponentModel.Design.ServiceContainer.Container, System.Collections.Generic.Dictionary< TKey, TValue >.ContainsKey(), System.SR.ErrorServiceExists, System.SR.Format(), and System.ComponentModel.Design.ServiceContainer.Services.