Carlos,
You could add an operator for an implicit and explicit conversions.
However, you will also have to overload all the other operators for your
type if you want to perform things like addition, subtraction, etc, etc.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
(E-Mail Removed)
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> I trying to do something that I'm not sure is possible. I want to
> create a class or struct where this is can be done:
>
> public class myInt32
> {
> //TODO
> }
> .....
>
> public class b
> {
> public void myMethod()
> {
> myInt32 a = new myInt32();
> a = 2;
> }
> }
>
> I want a Int32 to with I want to add some special behaviour, it
> possible to create a class or struct where one of it's properties can
> be accessed directly by the object name, instead of
> myobject.myproperty ?
>
> Hope you can help,
> Carlos Pedro
>