Class AddInManager
- Namespace
- Dynamicweb.Extensibility.AddIns
- Assembly
- Dynamicweb.Extensibility.dll
Manager for extensibility.
public class AddInManager
- Inheritance
-
AddInManager
- Inherited Members
Properties
AllowAddIns
Gets a value indicating whether [allow add ins].
public static bool AllowAddIns { get; set; }
Property Value
- bool
true
if [allow add ins]; otherwise,false
.
Methods
CanBeCastFrom(Type, Type)
Determines whether specified target type can be cast from the specified source type.
public static bool CanBeCastFrom(Type targetType, Type sourceType)
Parameters
Returns
- bool
- Value indicating whether specified target type can be cast from the specified source type.
CreateAddInInstance(string)
Creates the add in instance.
public static object CreateAddInInstance(string addInTypeName)
Parameters
addInTypeName
string- Name of the add in type.
Returns
CreateAddInInstance(string, params object[])
Creates the add in instance.
public static object CreateAddInInstance(string addInTypeName, params object[] args)
Parameters
Returns
CreateAddInInstance(Type)
Creates the add in instance.
public static object CreateAddInInstance(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
CreateAddInInstance(Type, params object[])
Creates the add in instance.
public static object CreateAddInInstance(Type addInType, params object[] args)
Parameters
Returns
CreateAddInInstance<T>()
Creates the first matching implementation of the specified type.
Sort order used is per the GetAddInClasses<T>() method.
public static T CreateAddInInstance<T>()
Returns
- T
- Object matching the type specified
Type Parameters
T
- The type to get an implementation of
CreateAddInInstances<T>()
Creates the add in instances.
public static IEnumerable<T> CreateAddInInstances<T>()
Returns
- IEnumerable<T>
- List of instances of the given type.
Type Parameters
T
- The type to get instances of.
EnsureAssembliesAreLoaded()
Ensures the assemblies are loaded.
public static void EnsureAssembliesAreLoaded()
GetAddInActive(Type)
Gets the AddIn active attribute.
public static bool GetAddInActive(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInAuthors(Type)
Retrieves the list of values of the "Name" property of an add-in's AddInAuthorAttribute attributes.
public static IEnumerable<string> GetAddInAuthors(Type addInType)
Parameters
addInType
Type- Add-in type.
Returns
GetAddInClasses(string)
Returns all types whose name contains the given search string.
By default, only usable types are returned, i.e., public and not abstract classes.
public static IEnumerable<Type> GetAddInClasses(string search)
Parameters
search
string- Search string.
Returns
- IEnumerable<Type>
- All types whose name contains the given search string.
GetAddInClasses(string, bool)
Returns all types whose name contains the given search string.
By default, only usable types are returned, i.e., public and not abstract classes.
public static IEnumerable<Type> GetAddInClasses(string search, bool strongMatch)
Parameters
search
string- Search string.
strongMatch
bool- Value indicating whether match is only counted from the beginning of the type full name.
Returns
- IEnumerable<Type>
- All types whose name contains the given search string.
GetAddInClasses(string, bool, Func<Type, bool>)
Returns all types whose name contains the given search string.
Only types that pass the
typeIsUsablePredicate
are returned.public static IEnumerable<Type> GetAddInClasses(string search, bool strongMatch, Func<Type, bool> typeIsUsablePredicate)
Parameters
search
string- Search string.
strongMatch
bool- Value indicating whether match is only counted from the beginning of the type full name.
typeIsUsablePredicate
Func<Type, bool>- A predicate that is used to determine whether the found types are usable.
Returns
- IEnumerable<Type>
- All types whose name contains the given search string.
GetAddInClasses(Type)
Gets the add in classes.
public static ArrayList GetAddInClasses(Type addInBaseType)
Parameters
addInBaseType
Type- Type of the add in base.
Returns
GetAddInClasses<T>()
Gets the add in classes.
public static IEnumerable<Type> GetAddInClasses<T>()
Returns
Type Parameters
T
- The type to get classes of.
GetAddInDeprecated(Type)
Gets the add in deprecated attribute.
public static bool GetAddInDeprecated(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInDescription(Type)
Gets the add in description attribute.
public static string GetAddInDescription(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInGroup(Type)
Gets the add in group attribute.
public static string GetAddInGroup(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInIgnore(Type)
Returns a value indicating whether the given type has an Ignore attribute;
true
if this is the case, false
otherwise.public static bool GetAddInIgnore(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInImage(Type)
Gets the add in image attribute.
public static string GetAddInImage(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInIsStandard(Type)
Determines whether the given add-in is a standard Dynamicweb add-in.
public static bool GetAddInIsStandard(Type type)
Parameters
type
Type- Add-in type.
Returns
- bool
- Value indicating whether the given add-in is a standard Dynamicweb add-in.
GetAddInLabel(Type)
Gets the add in label attribute.
public static string GetAddInLabel(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInLabels(Type)
Gets the add in labels.
public static IDictionary<string, string> GetAddInLabels(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInName(Type)
Gets AddInName attribute from the specified type.
Use this method if the type contains only one Name attributes, otherwise use the GetAddInNames function.
public static string GetAddInName(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInNames(Type)
Gets AddInName attributes from the specified type.
Use this method if the type contains multiple Name attributes, otherwise use the GetAddInName function.
public static IEnumerable<string> GetAddInNames(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInOrder(Type)
Gets the add in order attribute.
public static int GetAddInOrder(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInParameterEditor(Type, string)
Gets the add in parameter editor.
public static AddInParameterEditorAttribute GetAddInParameterEditor(Type addInType, string parameterName)
Parameters
Returns
GetAddInParameterEditorName(Type, string)
Gets the name of the add in parameter editor.
public static string GetAddInParameterEditorName(Type addInType, string parameterName)
Parameters
Returns
GetAddInParameterGroupName(Type, string)
Gets the name of the add in parameter group.
public static string GetAddInParameterGroupName(Type addInType, string parameterName)
Parameters
Returns
GetAddInParameterName(PropertyInfo)
Returns the name of the add-in parameter.
public static string GetAddInParameterName(PropertyInfo prop)
Parameters
prop
PropertyInfo- Object property.
Returns
- string
- The name of the add-in parameter.
GetAddInParameterOrder(Type, string)
Gets the add in parameter order.
public static int GetAddInParameterOrder(Type addInType, string parameterName)
Parameters
Returns
GetAddInParameterOrderInCode(Type, string)
Gets the add in parameter order in code.
public static int GetAddInParameterOrderInCode(Type addInType, string parameterName)
Parameters
Returns
GetAddInParameters(Type)
Gets the add in parameters.
public static IEnumerable<string> GetAddInParameters(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInParameterSectionName(Type, string)
Gets the name of the add in parameter section.
public static string GetAddInParameterSectionName(Type addInType, string parameterName)
Parameters
Returns
GetAddInParameterType(object, string)
Gets the type of the add in parameter.
public static Type GetAddInParameterType(object instance, string parameterName)
Parameters
Returns
GetAddInParameterValue(object, string)
Gets the add in parameter value.
public static object GetAddInParameterValue(object instance, string parameterName)
Parameters
Returns
GetAddInProperties(Type)
Gets the add in properties.
public static IEnumerable<string> GetAddInProperties(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInProperty(Type, string)
Gets the add in property.
public static PropertyInfo GetAddInProperty(Type addInType, string propertyName)
Parameters
Returns
GetAddInPropertyType(Type, string)
Gets the type of the add in property.
public static Type GetAddInPropertyType(Type addInType, string propertyName)
Parameters
Returns
GetAddInPropertyValue(object, PropertyInfo)
Gets the add in property value.
public static object GetAddInPropertyValue(object instance, PropertyInfo prop)
Parameters
instance
object- The instance.
prop
PropertyInfo- Property.
Returns
GetAddInPropertyValue(object, string)
Gets the add in property value.
public static object GetAddInPropertyValue(object instance, string propertyName)
Parameters
Returns
GetAddInTargets(Type)
Retrieves the list of values of the "Path" property of an add-in's AddInTargetAttribute attributes.
public static IEnumerable<string> GetAddInTargets(Type addInType)
Parameters
addInType
Type- Add-in type.
Returns
GetAddInTypeByAddInName(string)
Gets the name of the add in type by add in.
public static Type GetAddInTypeByAddInName(string addInName)
Parameters
addInName
string- Name of the add in.
Returns
GetAddInTypeByName(string)
Gets the name of the add in type by.
public static Type GetAddInTypeByName(string typeName)
Parameters
typeName
string- Name of the type.
Returns
GetAddInUseParameterGrouping(Type)
Gets the add in use parameter grouping attribute.
public static bool GetAddInUseParameterGrouping(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInUseParameterOrdering(Type)
Gets the add in use parameter ordering attribute.
public static bool GetAddInUseParameterOrdering(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInUseParameters(Type)
Gets the add in use parameters.
public static bool GetAddInUseParameters(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAddInUseParameterSectioning(Type)
Gets the add in use parameter sectioning attribute.
public static bool GetAddInUseParameterSectioning(Type addInType)
Parameters
addInType
Type- Type of the add in.
Returns
GetAssemblyQualifiedName(Type)
Returns the assembly-qualified name of the type (full name plus assembly simple name).
public static string GetAssemblyQualifiedName(Type type)
Parameters
type
Type- Type.
Returns
- string
- Assembly-qualified name of the type (full name plus assembly simple name).
GetCollectionElementType(Type)
Returns a type of an element if the target type represents a strongly typed collection.
public static Type GetCollectionElementType(Type type)
Parameters
type
Type- Type to examine.
Returns
- Type
- A type of an element if the target type represents a strongly typed collection.
GetCustomAttributes<T>(PropertyInfo)
Returns a list of custom attributes of the given type defined on a given property.
public static IEnumerable<T> GetCustomAttributes<T>(PropertyInfo targetProperty) where T : Attribute
Parameters
targetProperty
PropertyInfo- Property to examine.
Returns
- IEnumerable<T>
- A list of custom attributes.
Type Parameters
T
- Attribute type.
Exceptions
- ArgumentNullException
targetProperty
is null.
GetCustomAttributes<T>(Type)
Returns a list of custom attributes of the given type defined on a given type.
public static IEnumerable<T> GetCustomAttributes<T>(Type targetType) where T : Attribute
Parameters
targetType
Type- Type to examine.
Returns
- IEnumerable<T>
- A list of custom attributes.
Type Parameters
T
- Attribute type.
Exceptions
- ArgumentNullException
targetType
is null.
GetIcon(Type, KnownIcon)
Gets the add in icon attribute.
public static KnownIcon GetIcon(Type addInType, KnownIcon defaultIcon)
Parameters
addInType
Type- Type of the add in.
defaultIcon
KnownIcon- The icon should be return if addInType doesn't have AddInIconAttribute attribute
Returns
GetPropertyInfo(Type, string)
Gets the property info.
public static PropertyInfo GetPropertyInfo(Type addInType, string parameterName)
Parameters
Returns
GetPropertyValue(object, string)
Retrieves a value of the given property.
public static object GetPropertyValue(object target, string propertyName)
Parameters
Returns
- object
- Property value.
GetProviders<T>()
Gets a list of providers of the specified type that have an AddInActive attribute set to true.
public static List<T> GetProviders<T>()
Returns
- List<T>
Type Parameters
T
GetProviders<T>(string)
Gets a list of providers of the specified type and specfied target attribute value and have an AddInActive attribute set to true.
public static List<T> GetProviders<T>(string target)
Parameters
target
string- The target attribute value.
Returns
- List<T>
Type Parameters
T
GetTemplateExtenders<T>()
Gets the list of template extenders of the specified type.
public static IEnumerable<T> GetTemplateExtenders<T>()
Returns
- IEnumerable<T>
Type Parameters
T
- Template extender base type.
GetTemplateExtenders<T>(bool)
Gets the list of template extenders of the specified type.
public static IEnumerable<T> GetTemplateExtenders<T>(bool ignoreCache)
Parameters
ignoreCache
bool- Value indicating whether to ignore cached version of extenders.
Returns
- IEnumerable<T>
Type Parameters
T
- Template extender base type.
ImplementsInterface(object, Type)
Implements the interface of specified type.
public static bool ImplementsInterface(object instance, Type interfaceType)
Parameters
Returns
ImplementsInterface(Type, Type)
Returns a value indicating whether the given type implements the given interface.
public static bool ImplementsInterface(Type type, Type interfaceType)
Parameters
Returns
- bool
- Value indicating whether the given type implements the given interface.
InvokeFunction(object, string, object[])
Invokes the function of the specfied name on the specified instance with the specified parameters.
public static object InvokeFunction(object instance, string functionName, object[] arguments)
Parameters
instance
object- The instance.
functionName
string- Name of the function.
arguments
object[]- The arguments.
Returns
InvokeStaticFunction(string, string, object[])
Invokes a static function on the type with the given type name.
The function must be static and public.
The params array must contain elements that exactly match a signature for given function.
public static object InvokeStaticFunction(string typeName, string functionName, object[] arguments)
Parameters
typeName
string- Name of the type.
functionName
string- Name of the function.
arguments
object[]- The arguments.
Returns
InvokeStaticFunction(Type, string, object[])
Invokes a static function on the given type.
The function must be static and public.
The params array must contain elements that exactly match a signature for given function.
public static object InvokeStaticFunction(Type type, string functionName, object[] arguments)
Parameters
Returns
IsAddInEnabled(Type)
Determines whether [is add in enabled] [the specified type].
public static bool IsAddInEnabled(Type type)
Parameters
type
Type- The type.
Returns
- bool
true
if [is add in enabled] [the specified type]; otherwise,false
.
IsAssemblyAllowed(string)
Returns a value which indicates whether the specified assembly is allowed.
public static bool IsAssemblyAllowed(string asmName)
Parameters
asmName
string- Assembly name.
Returns
SetAddInDisabled(Type)
Sets the add in disabled.
public static void SetAddInDisabled(Type type)
Parameters
type
Type- The type.
SetAddInEnabled(Type)
Sets the add in enabled.
public static void SetAddInEnabled(Type type)
Parameters
type
Type- The type.
SetAddInParameterValue(object, string, object)
Sets the add in parameter value.
public static void SetAddInParameterValue(object instance, string parameterName, object value)
Parameters
SetAddInPropertyValue(object, string, object)
Sets the add in property value.
public static void SetAddInPropertyValue(object instance, string propertyName, object propertyValue)
Parameters
instance
object- The instance.
propertyName
string- Name of the property.
propertyValue
object- The property value.
SetAddInPropertyValue(object, string, object, bool)
Sets the add in property value.
public static void SetAddInPropertyValue(object instance, string propertyName, object propertyValue, bool tryConvert)