예제 #1
0
        static public bool IsPlugin(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            RegisterPlugInAttribute plugin = (RegisterPlugInAttribute)Attribute.GetCustomAttribute(obj is Type ? (Type)obj : obj.GetType(), typeof(RegisterPlugInAttribute));

            return(plugin != null);
        }
예제 #2
0
        static public Guid PlugInID(object obj)
        {
            if (obj == null)
            {
                return(new Guid());
            }

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

                return(plugin.Value);
            }
        }