Mercurial > pub > bltoolkit
diff Source/TypeBuilder/ParameterAttribute.cs @ 0:f990fcb411a9
Копия текущей версии из github
author | cin |
---|---|
date | Thu, 27 Mar 2014 21:46:09 +0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Source/TypeBuilder/ParameterAttribute.cs Thu Mar 27 21:46:09 2014 +0400 @@ -0,0 +1,65 @@ +using System; +using System.Diagnostics.CodeAnalysis; + +namespace BLToolkit.TypeBuilder +{ + [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] + [AttributeUsage(AttributeTargets.Property)] + public class ParameterAttribute : Attribute + { + protected ParameterAttribute() + { + SetParameters(); + } + + public ParameterAttribute(object parameter1) + { + SetParameters(parameter1); + } + + public ParameterAttribute( + object parameter1, + object parameter2) + { + SetParameters(parameter1, parameter2); + } + + public ParameterAttribute( + object parameter1, + object parameter2, + object parameter3) + { + SetParameters(parameter1, parameter2, parameter3); + } + + public ParameterAttribute( + object parameter1, + object parameter2, + object parameter3, + object parameter4) + { + SetParameters(parameter1, parameter2, parameter3, parameter4); + } + + public ParameterAttribute( + object parameter1, + object parameter2, + object parameter3, + object parameter4, + object parameter5) + { + SetParameters(parameter1, parameter2, parameter3, parameter4, parameter5); + } + + protected void SetParameters(params object[] parameters) + { + _parameters = parameters; + } + + private object[] _parameters; + public object[] Parameters + { + get { return _parameters; } + } + } +}