473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Custom attributes to define min, max, ... value on numerical properties

Hi All,

Did somebody already define attributes for numerical properties to define
value : minima, maxima, a number of decimal, ...? This information would be
useful to unify syntax

Polo
Nov 15 '05 #1
12 5762
Polo,

I believe the static property on each numeric type is MinValue and
MaxValue for the min and max values in that range respectively.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:Og****************@TK2MSFTNGP11.phx.gbl...
Hi All,

Did somebody already define attributes for numerical properties to define
value : minima, maxima, a number of decimal, ...? This information would be useful to unify syntax

Polo

Nov 15 '05 #2
Sorry but It is not my problem.

I woul like to define custom attributes to set min, max, number of digits
by exemple :
[MinValue(0)]
[MaxValue(100)]
...
public int Temperature
{
...
}

Somebody has you it already defined this type of attribute.

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> a
écrit dans le message de news: On**************@TK2MSFTNGP10.phx.gbl...
Polo,

I believe the static property on each numeric type is MinValue and
MaxValue for the min and max values in that range respectively.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:Og****************@TK2MSFTNGP11.phx.gbl...
Hi All,

Did somebody already define attributes for numerical properties to define value : minima, maxima, a number of decimal, ...? This information
would be
useful to unify syntax

Polo


Nov 15 '05 #3
Pol,

Well, there is no attribute like that, but you can always create your
own. You just have to derive a class from the Attribute class and then add
your properties, and the appropriate constructor syntax.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Sorry but It is not my problem.

I woul like to define custom attributes to set min, max, number of digits
by exemple :
[MinValue(0)]
[MaxValue(100)]
..
public int Temperature
{
...
}

Somebody has you it already defined this type of attribute.

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> a
écrit dans le message de news: On**************@TK2MSFTNGP10.phx.gbl...
Polo,

I believe the static property on each numeric type is MinValue and
MaxValue for the min and max values in that range respectively.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:Og****************@TK2MSFTNGP11.phx.gbl...
Hi All,

Did somebody already define attributes for numerical properties to define value : minima, maxima, a number of decimal, ...? This information

would
be
useful to unify syntax

Polo



Nov 15 '05 #4
Sorry but It is not my problem.

I woul like to define custom attributes to set min, max, number of digits
by exemple :
[MinValue(0)]
[MaxValue(100)]
...
public int Temperature
{
...
}

Somebody has you it already defined this type of attribute.

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> a
écrit dans le message de news: On**************@TK2MSFTNGP10.phx.gbl...
Polo,

I believe the static property on each numeric type is MinValue and
MaxValue for the min and max values in that range respectively.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:Og****************@TK2MSFTNGP11.phx.gbl...
Hi All,

Did somebody already define attributes for numerical properties to define value : minima, maxima, a number of decimal, ...? This information
would be
useful to unify syntax

Polo


Nov 15 '05 #5
Pol,

Well, there is no attribute like that, but you can always create your
own. You just have to derive a class from the Attribute class and then add
your properties, and the appropriate constructor syntax.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Sorry but It is not my problem.

I woul like to define custom attributes to set min, max, number of digits
by exemple :
[MinValue(0)]
[MaxValue(100)]
..
public int Temperature
{
...
}

Somebody has you it already defined this type of attribute.

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> a
écrit dans le message de news: On**************@TK2MSFTNGP10.phx.gbl...
Polo,

I believe the static property on each numeric type is MinValue and
MaxValue for the min and max values in that range respectively.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:Og****************@TK2MSFTNGP11.phx.gbl...
Hi All,

Did somebody already define attributes for numerical properties to define value : minima, maxima, a number of decimal, ...? This information

would
be
useful to unify syntax

Polo



Nov 15 '05 #6
Nicholas,

It would be nice if these attributes could also perform corresponding data
validation. I have seen an article called "Aspect-Oriented Programming" that
explained such tricks. While I find this idea very appealing, its
implementation seems to be too complicated in the .NET Framework.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote
in message news:%2****************@TK2MSFTNGP12.phx.gbl...
Pol,

Well, there is no attribute like that, but you can always create your
own. You just have to derive a class from the Attribute class and then add your properties, and the appropriate constructor syntax.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Sorry but It is not my problem.

I woul like to define custom attributes to set min, max, number of digits by exemple :
[MinValue(0)]
[MaxValue(100)]
..
public int Temperature
{
...
}

Somebody has you it already defined this type of attribute.

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> a
écrit dans le message de news: On**************@TK2MSFTNGP10.phx.gbl...
Polo,

I believe the static property on each numeric type is MinValue and
MaxValue for the min and max values in that range respectively.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:Og****************@TK2MSFTNGP11.phx.gbl...
> Hi All,
>
> Did somebody already define attributes for numerical properties to

define
> value : minima, maxima, a number of decimal, ...? This information

would
be
> useful to unify syntax
>
> Polo
>
>




Nov 15 '05 #7
Nicholas,

It would be nice if these attributes could also perform corresponding data
validation. I have seen an article called "Aspect-Oriented Programming" that
explained such tricks. While I find this idea very appealing, its
implementation seems to be too complicated in the .NET Framework.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote
in message news:%2****************@TK2MSFTNGP12.phx.gbl...
Pol,

Well, there is no attribute like that, but you can always create your
own. You just have to derive a class from the Attribute class and then add your properties, and the appropriate constructor syntax.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Sorry but It is not my problem.

I woul like to define custom attributes to set min, max, number of digits by exemple :
[MinValue(0)]
[MaxValue(100)]
..
public int Temperature
{
...
}

Somebody has you it already defined this type of attribute.

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> a
écrit dans le message de news: On**************@TK2MSFTNGP10.phx.gbl...
Polo,

I believe the static property on each numeric type is MinValue and
MaxValue for the min and max values in that range respectively.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:Og****************@TK2MSFTNGP11.phx.gbl...
> Hi All,
>
> Did somebody already define attributes for numerical properties to

define
> value : minima, maxima, a number of decimal, ...? This information

would
be
> useful to unify syntax
>
> Polo
>
>




Nov 15 '05 #8
Dmitry,

They can provide indicators as to what the data validation should be.
Attributes are nothing more than meta-data, and they should have no
executable code in them (at least, when loosely defining "executable"). You
need to have code that performs actions based on the meta-data, which is in
fact what the implementation of Aspect Oriented Programming that you saw (I
believe we saw the same article) does.

--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:eB**************@TK2MSFTNGP10.phx.gbl...
Nicholas,

It would be nice if these attributes could also perform corresponding data
validation. I have seen an article called "Aspect-Oriented Programming" that explained such tricks. While I find this idea very appealing, its
implementation seems to be too complicated in the .NET Framework.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
Pol,

Well, there is no attribute like that, but you can always create your
own. You just have to derive a class from the Attribute class and then

add
your properties, and the appropriate constructor syntax.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Sorry but It is not my problem.

I woul like to define custom attributes to set min, max, number of

digits by exemple :
[MinValue(0)]
[MaxValue(100)]
..
public int Temperature
{
...
}

Somebody has you it already defined this type of attribute.

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> a écrit dans le message de news: On**************@TK2MSFTNGP10.phx.gbl... > Polo,
>
> I believe the static property on each numeric type is MinValue and > MaxValue for the min and max values in that range respectively.
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - nick(dot)paldino=at=exisconsulting<dot>com
>
> "Pol Bawin" <pb@rtech.be> wrote in message
> news:Og****************@TK2MSFTNGP11.phx.gbl...
> > Hi All,
> >
> > Did somebody already define attributes for numerical properties to
define
> > value : minima, maxima, a number of decimal, ...? This information would
> be
> > useful to unify syntax
> >
> > Polo
> >
> >
>
>


Nov 15 '05 #9
Dmitry,

They can provide indicators as to what the data validation should be.
Attributes are nothing more than meta-data, and they should have no
executable code in them (at least, when loosely defining "executable"). You
need to have code that performs actions based on the meta-data, which is in
fact what the implementation of Aspect Oriented Programming that you saw (I
believe we saw the same article) does.

--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:eB**************@TK2MSFTNGP10.phx.gbl...
Nicholas,

It would be nice if these attributes could also perform corresponding data
validation. I have seen an article called "Aspect-Oriented Programming" that explained such tricks. While I find this idea very appealing, its
implementation seems to be too complicated in the .NET Framework.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
Pol,

Well, there is no attribute like that, but you can always create your
own. You just have to derive a class from the Attribute class and then

add
your properties, and the appropriate constructor syntax.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Sorry but It is not my problem.

I woul like to define custom attributes to set min, max, number of

digits by exemple :
[MinValue(0)]
[MaxValue(100)]
..
public int Temperature
{
...
}

Somebody has you it already defined this type of attribute.

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> a écrit dans le message de news: On**************@TK2MSFTNGP10.phx.gbl... > Polo,
>
> I believe the static property on each numeric type is MinValue and > MaxValue for the min and max values in that range respectively.
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - nick(dot)paldino=at=exisconsulting<dot>com
>
> "Pol Bawin" <pb@rtech.be> wrote in message
> news:Og****************@TK2MSFTNGP11.phx.gbl...
> > Hi All,
> >
> > Did somebody already define attributes for numerical properties to
define
> > value : minima, maxima, a number of decimal, ...? This information would
> be
> > useful to unify syntax
> >
> > Polo
> >
> >
>
>


Nov 15 '05 #10
Thank you for this information, but or then I to find this article
"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> a
écrit dans le message de news: e#**************@TK2MSFTNGP12.phx.gbl...
Dmitry,

They can provide indicators as to what the data validation should be.
Attributes are nothing more than meta-data, and they should have no
executable code in them (at least, when loosely defining "executable"). You need to have code that performs actions based on the meta-data, which is in fact what the implementation of Aspect Oriented Programming that you saw (I believe we saw the same article) does.

--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:eB**************@TK2MSFTNGP10.phx.gbl...
Nicholas,

It would be nice if these attributes could also perform corresponding data
validation. I have seen an article called "Aspect-Oriented Programming" that
explained such tricks. While I find this idea very appealing, its
implementation seems to be too complicated in the .NET Framework.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com>

wrote
in message news:%2****************@TK2MSFTNGP12.phx.gbl...
Pol,

Well, there is no attribute like that, but you can always create your own. You just have to derive a class from the Attribute class and then add
your properties, and the appropriate constructor syntax.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
> Sorry but It is not my problem.
>
> I woul like to define custom attributes to set min, max, number of

digits
> by exemple :
> [MinValue(0)]
> [MaxValue(100)]
> ..
> public int Temperature
> {
> ...
> }
>
> Somebody has you it already defined this type of attribute.
>
> "Nicholas Paldino [.NET/C# MVP]"
<ni**************@exisconsulting.com> a > écrit dans le message de news: On**************@TK2MSFTNGP10.phx.gbl... > > Polo,
> >
> > I believe the static property on each numeric type is MinValue and > > MaxValue for the min and max values in that range respectively.
> >
> > Hope this helps.
> >
> >
> > --
> > - Nicholas Paldino [.NET/C# MVP]
> > - nick(dot)paldino=at=exisconsulting<dot>com
> >
> > "Pol Bawin" <pb@rtech.be> wrote in message
> > news:Og****************@TK2MSFTNGP11.phx.gbl...
> > > Hi All,
> > >
> > > Did somebody already define attributes for numerical properties
to > define
> > > value : minima, maxima, a number of decimal, ...? This

information > would
> > be
> > > useful to unify syntax
> > >
> > > Polo
> > >
> > >
> >
> >
>
>


Nov 15 '05 #11
Thank you for this information, but or then I to find this article
"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> a
écrit dans le message de news: e#**************@TK2MSFTNGP12.phx.gbl...
Dmitry,

They can provide indicators as to what the data validation should be.
Attributes are nothing more than meta-data, and they should have no
executable code in them (at least, when loosely defining "executable"). You need to have code that performs actions based on the meta-data, which is in fact what the implementation of Aspect Oriented Programming that you saw (I believe we saw the same article) does.

--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:eB**************@TK2MSFTNGP10.phx.gbl...
Nicholas,

It would be nice if these attributes could also perform corresponding data
validation. I have seen an article called "Aspect-Oriented Programming" that
explained such tricks. While I find this idea very appealing, its
implementation seems to be too complicated in the .NET Framework.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com>

wrote
in message news:%2****************@TK2MSFTNGP12.phx.gbl...
Pol,

Well, there is no attribute like that, but you can always create your own. You just have to derive a class from the Attribute class and then add
your properties, and the appropriate constructor syntax.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Pol Bawin" <pb@rtech.be> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
> Sorry but It is not my problem.
>
> I woul like to define custom attributes to set min, max, number of

digits
> by exemple :
> [MinValue(0)]
> [MaxValue(100)]
> ..
> public int Temperature
> {
> ...
> }
>
> Somebody has you it already defined this type of attribute.
>
> "Nicholas Paldino [.NET/C# MVP]"
<ni**************@exisconsulting.com> a > écrit dans le message de news: On**************@TK2MSFTNGP10.phx.gbl... > > Polo,
> >
> > I believe the static property on each numeric type is MinValue and > > MaxValue for the min and max values in that range respectively.
> >
> > Hope this helps.
> >
> >
> > --
> > - Nicholas Paldino [.NET/C# MVP]
> > - nick(dot)paldino=at=exisconsulting<dot>com
> >
> > "Pol Bawin" <pb@rtech.be> wrote in message
> > news:Og****************@TK2MSFTNGP11.phx.gbl...
> > > Hi All,
> > >
> > > Did somebody already define attributes for numerical properties
to > define
> > > value : minima, maxima, a number of decimal, ...? This

information > would
> > be
> > > useful to unify syntax
> > >
> > > Polo
> > >
> > >
> >
> >
>
>


Nov 15 '05 #12

Hi Pol,

I think you can search "Aspect-Oriented Programming" in google.
There are many links in google, related to it.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Pol Bawin" <pb@rtech.be>
| References: <Og**************@TK2MSFTNGP11.phx.gbl>
<On**************@TK2MSFTNGP10.phx.gbl>
<e1**************@TK2MSFTNGP11.phx.gbl>
<#m**************@TK2MSFTNGP12.phx.gbl>
<eB**************@TK2MSFTNGP10.phx.gbl>
<e#**************@TK2MSFTNGP12.phx.gbl>
| Subject: Re: Custom attributes to define min, max, ... value on numerical
properties
| Date: Thu, 25 Sep 2003 09:39:23 +0200
| Lines: 117
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <#Q**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 194.78.114.66
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:187226
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Thank you for this information, but or then I to find this article
|
|
| "Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> a
| écrit dans le message de news: e#**************@TK2MSFTNGP12.phx.gbl...
| > Dmitry,
| >
| > They can provide indicators as to what the data validation should
be.
| > Attributes are nothing more than meta-data, and they should have no
| > executable code in them (at least, when loosely defining "executable").
| You
| > need to have code that performs actions based on the meta-data, which is
| in
| > fact what the implementation of Aspect Oriented Programming that you saw
| (I
| > believe we saw the same article) does.
| >
| > --
| > - Nicholas Paldino [.NET/C# MVP]
| > - nick(dot)paldino=at=exisconsulting<dot>com
| >
| > "Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com>
wrote
| > in message news:eB**************@TK2MSFTNGP10.phx.gbl...
| > > Nicholas,
| > >
| > > It would be nice if these attributes could also perform corresponding
| data
| > > validation. I have seen an article called "Aspect-Oriented
Programming"
| > that
| > > explained such tricks. While I find this idea very appealing, its
| > > implementation seems to be too complicated in the .NET Framework.
| > >
| > > --
| > > Dmitriy Lapshin [C# / .NET MVP]
| > > X-Unity Test Studio
| > > http://x-unity.miik.com.ua/teststudio.aspx
| > > Bring the power of unit testing to VS .NET IDE
| > >
| > > "Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com>
| > wrote
| > > in message news:%2****************@TK2MSFTNGP12.phx.gbl...
| > > > Pol,
| > > >
| > > > Well, there is no attribute like that, but you can always create
| > your
| > > > own. You just have to derive a class from the Attribute class and
| then
| > > add
| > > > your properties, and the appropriate constructor syntax.
| > > >
| > > >
| > > > --
| > > > - Nicholas Paldino [.NET/C# MVP]
| > > > - nick(dot)paldino=at=exisconsulting<dot>com
| > > >
| > > > "Pol Bawin" <pb@rtech.be> wrote in message
| > > > news:e1**************@TK2MSFTNGP11.phx.gbl...
| > > > > Sorry but It is not my problem.
| > > > >
| > > > > I woul like to define custom attributes to set min, max, number of
| > > digits
| > > > > by exemple :
| > > > > [MinValue(0)]
| > > > > [MaxValue(100)]
| > > > > ..
| > > > > public int Temperature
| > > > > {
| > > > > ...
| > > > > }
| > > > >
| > > > > Somebody has you it already defined this type of attribute.
| > > > >
| > > > > "Nicholas Paldino [.NET/C# MVP]"
| <ni**************@exisconsulting.com>
| > a
| > > > > écrit dans le message de news:
| > On**************@TK2MSFTNGP10.phx.gbl...
| > > > > > Polo,
| > > > > >
| > > > > > I believe the static property on each numeric type is
MinValue
| > and
| > > > > > MaxValue for the min and max values in that range respectively.
| > > > > >
| > > > > > Hope this helps.
| > > > > >
| > > > > >
| > > > > > --
| > > > > > - Nicholas Paldino [.NET/C# MVP]
| > > > > > - nick(dot)paldino=at=exisconsulting<dot>com
| > > > > >
| > > > > > "Pol Bawin" <pb@rtech.be> wrote in message
| > > > > > news:Og****************@TK2MSFTNGP11.phx.gbl...
| > > > > > > Hi All,
| > > > > > >
| > > > > > > Did somebody already define attributes for numerical
properties
| to
| > > > > define
| > > > > > > value : minima, maxima, a number of decimal, ...? This
| > information
| > > > > would
| > > > > > be
| > > > > > > useful to unify syntax
| > > > > > >
| > > > > > > Polo
| > > > > > >
| > > > > > >
| > > > > >
| > > > > >
| > > > >
| > > > >
| > > >
| > > >
| > >
| >
| >
|
|
|

Nov 15 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: F. Da Costa | last post by:
Hi, I was wondering *why* there is a difference between the results of the following two statements. On the suface they seem to do the same (or do they?) frm => returns void ...
3
by: xAvailx | last post by:
I apologize ahead of time for the long post... Background: Working on a CRM type custom application. The application is for an event management company. The company will provide the application...
1
by: Pol Bawin | last post by:
Hi All, Did somebody already define attributes for numerical properties to define values : minima, maxima, a number of décimals, ...? This information would be useful to unify syntax Polo
1
by: Microsoft | last post by:
Hello there, I have following situation , how can I solve this puzzle in C#. I have interface called IVendor with some custom attributes applied to it interface IVendor {
2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
3
by: Gigi | last post by:
I'm trying to add a custom property to each row of a table. So I created an HtmlTable called tblClass, I created a new class myRow inherited from HtmlTableRow, to which I added a new member myRow ...
3
by: Dan | last post by:
Hi, I am messing around with custom attributes and may have understood the concept a bit wrong:- I have a simple class that has a few public properties that individually have custom...
15
by: Jeff Mason | last post by:
Hi, I'm having a reflection brain fog here, perhaps someone can set me on the right track. I'd like to define a custom attribute to be used in a class hierarchy. What I want to do is to...
2
by: P4trykx | last post by:
Hello I'm want to add some custom attributes to WebControls using WebControl.Attributes.Add("abc","234"); So the html output will look like this, <input type="hidden" abc="123" /etc. I know...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.