/// <summary> /// Creates a new <see cref="FirewallProduct" /> instance remotely to be registered later /// </summary> /// <param name="name">The name of the product</param> /// <param name="typeResolver">The object resolver for COM+ objects</param> public FirewallProduct(string name, COMTypeResolver typeResolver) { TypeResolver = typeResolver; if (!TypeResolver.IsSupported <INetFwProduct>()) { throw new NotSupportedException(); } UnderlyingObject = TypeResolver.CreateInstance <INetFwProduct>(); Name = name; }
/// <summary> /// Creates a new instance of this class on the current thread for a remote machine and leaves the cross thread control to the user of the /// class. /// </summary> public FirewallLegacy(COMTypeResolver typeResolver) { if (!IsSupported(typeResolver)) { throw new NotSupportedException("This type is not supported in this environment."); } TypeResolver = typeResolver; UnderlyingObject = TypeResolver.CreateInstance <INetFwMgr>(); Profiles = new ReadOnlyCollection <FirewallLegacyProfile>( new[] { new FirewallLegacyProfile(this, FirewallProfiles.Domain), new FirewallLegacyProfile(this, FirewallProfiles.Private) } ); }