static public bool IsPlugin(object obj) { if (obj == null) { return(false); } RegisterPlugIn plugin = (RegisterPlugIn)Attribute.GetCustomAttribute(obj.GetType(), typeof(RegisterPlugIn)); return(plugin != null); }
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); } }