System.ComponentModel.Design.ServiceContainer.RemoveService C# (CSharp) Method

RemoveService() public method

public RemoveService ( Type serviceType ) : void
serviceType System.Type
return void
        public void RemoveService(Type serviceType) {
            RemoveService(serviceType, false);
        }

Same methods

ServiceContainer::RemoveService ( Type serviceType, bool promote ) : void

Usage Example

Example #1
0
		[Test] // RemoveService (Type, Boolean)
		public void RemoveService2_ServiceType_Null ()
		{
			ServiceContainer sc = new ServiceContainer ();

			try {
				sc.RemoveService ((Type) null, false);
				Assert.Fail ("#A1");
			} catch (ArgumentNullException ex) {
				Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#A2");
				Assert.IsNull (ex.InnerException, "#A3");
				Assert.IsNotNull (ex.Message, "#A4");
				Assert.AreEqual ("serviceType", ex.ParamName, "#A5");
			}

			try {
				sc.RemoveService ((Type) null, true);
				Assert.Fail ("#B1");
			} catch (ArgumentNullException ex) {
				Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#B2");
				Assert.IsNull (ex.InnerException, "#B3");
				Assert.IsNotNull (ex.Message, "#B4");
				Assert.AreEqual ("serviceType", ex.ParamName, "#B5");
			}
		}
All Usage Examples Of System.ComponentModel.Design.ServiceContainer::RemoveService