G
Guest
Using asp.net1.1, I have a property on a control that is an enum. I use an
accessor and set it in HTML view. So:
public enum Permission
{
None = 0,
Admin = 1,
Member = 2, ...
}
....
public class Lock : System.Web.UI.Control
{
private Permission perm;
[Bindable(true),
Category("Security"),
DefaultValue("1")]
public Permission RequiredPermission
{
get
{
return perm;
}
set
{
perm = value;
}
}
Then in html view:
<cc1:Lock ... RequiredPermission="Admin" ... >
Now, I want to make the Permission property an array of permissions:
private Permission[] perm;
My question is, how can I implement this to allow me to still specify the
list of permissions in html view, like:
<cc1:Lock ... RequiredPermission="Admin,Member" ... >
I need to convert this list into an array, is there any way to do this
within an accessor? If I try something like this, I get a parser error,
saying it can't create an object of type Permission[] from its string
representation.
public Camelot.Permission[] RequiredPermission
{
get
{
return perm;
}
set
{
// break up comma delimited string in value, create an array of
permissions, assign it to perm
}
}
Thanks!
accessor and set it in HTML view. So:
public enum Permission
{
None = 0,
Admin = 1,
Member = 2, ...
}
....
public class Lock : System.Web.UI.Control
{
private Permission perm;
[Bindable(true),
Category("Security"),
DefaultValue("1")]
public Permission RequiredPermission
{
get
{
return perm;
}
set
{
perm = value;
}
}
Then in html view:
<cc1:Lock ... RequiredPermission="Admin" ... >
Now, I want to make the Permission property an array of permissions:
private Permission[] perm;
My question is, how can I implement this to allow me to still specify the
list of permissions in html view, like:
<cc1:Lock ... RequiredPermission="Admin,Member" ... >
I need to convert this list into an array, is there any way to do this
within an accessor? If I try something like this, I get a parser error,
saying it can't create an object of type Permission[] from its string
representation.
public Camelot.Permission[] RequiredPermission
{
get
{
return perm;
}
set
{
// break up comma delimited string in value, create an array of
permissions, assign it to perm
}
}
Thanks!