Exemplo n.º 1
0
        static public bool IsPlugin(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            RegisterPlugIn plugin = (RegisterPlugIn)Attribute.GetCustomAttribute(obj.GetType(), typeof(RegisterPlugIn));

            return(plugin != null);
        }
Exemplo n.º 2
0
        static public Guid PlugInID(object obj)
        {
            if (obj == null)
            {
                return(new Guid());
            }

            if (obj is IPlugInWrapper)
            {
                return(PlugInID(((IPlugInWrapper)obj).WrappedPlugIn));
            }
            else
            {
                RegisterPlugIn plugin = (RegisterPlugIn)Attribute.GetCustomAttribute(obj.GetType(), typeof(RegisterPlugIn));
                if (plugin == null)
                {
                    return(new Guid());
                }

                return(plugin.Value);
            }
        }