public void Dispose() { container.RemoveService(serviceType); if (originalService != null) { if (serviceInstance is IServiceContainer) { //Make sure to remove the originalService from the temporary service ((IServiceContainer)serviceInstance).RemoveService(serviceType); } container.AddService(serviceType, originalService); } }
public void ExecuteSimpleTemplate1csWithoutValueInfoService() { // fields string templateName = "ValidTemplate1cs"; sc.RemoveService(typeof(IValueInfoService)); // Create Action TextTemplateAction action = new TextTemplateAction(); action.Template = GetTemplateFileName(templateName); sc.Add(action); // Execute action.Execute(); }