summaryrefslogtreecommitdiff
path: root/src/Notepad/Infrastructure/Container/Windsor/IComponentExclusionSpecification.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Notepad/Infrastructure/Container/Windsor/IComponentExclusionSpecification.cs')
-rw-r--r--src/Notepad/Infrastructure/Container/Windsor/IComponentExclusionSpecification.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Notepad/Infrastructure/Container/Windsor/IComponentExclusionSpecification.cs b/src/Notepad/Infrastructure/Container/Windsor/IComponentExclusionSpecification.cs
new file mode 100644
index 0000000..b611859
--- /dev/null
+++ b/src/Notepad/Infrastructure/Container/Windsor/IComponentExclusionSpecification.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Windows.Forms;
+using Notepad.Infrastructure.Core;
+
+namespace Notepad.Infrastructure.Container.Windsor {
+ public interface IComponentExclusionSpecification : ISpecification<Type> {}
+
+ public class ComponentExclusionSpecification : IComponentExclusionSpecification {
+ public bool IsSatisfiedBy(Type type) {
+ return type.GetInterfaces().Length == 0
+ || type.IsSubclassOf(typeof (Form))
+ || type.IsAssignableFrom(typeof (IDependencyRegistry));
+ }
+ }
+} \ No newline at end of file