Пример #1
0
 public void Process(Type type, Registry registry)
 {
     if (PluggableAttribute.MarkedAsPluggable(type))
     {
         registry.AddType(type);
     }
 }
Пример #2
0
            /// <summary>
            /// Determines if the PluggedType is a valid Plugin into the
            /// PluginType
            /// </summary>
            /// <param name="pluginType"></param>
            /// <param name="pluggedType"></param>
            /// <returns></returns>
            public static bool IsExplicitlyMarkedAsPlugin(this Type pluggedType, Type pluginType)
            {
                bool returnValue = false;

                bool markedAsPlugin = PluggableAttribute.MarkedAsPluggable(pluggedType);

                if (markedAsPlugin)
                {
                    returnValue = CanBeCastTo(pluggedType, pluginType);
                }

                return(returnValue);
            }
 public void MarkedAsPluggable()
 {
     Assert.AreEqual(true, PluggableAttribute.MarkedAsPluggable(typeof(ColorWidget)), "ColorWidget is marked");
 }
 public void NotMarkedAsPluggable()
 {
     Assert.AreEqual(false, PluggableAttribute.MarkedAsPluggable(typeof(NotPluggableWidget)),
                     "ColorWidget is marked");
 }