View Single Post
Old 06-02-2006   #6 (permalink)
dreeschkind


 
 

Re: What's the correct way do design an Exif image information cmd

Sorry about that, I'm just another Java guy.
I always thought .NET was quite similar to Java, where I can do things like
that:

Date d = null;
if (d == null) {
System.out.println("Java");
}

Maybe I should start reading more about .NET and C# now.

--
greetings
dreeschkind

"Staffan Gustafsson" wrote:

> In the .NET type system, a DateTime is a ValueType, allocated on the stack,
> not on the garbage collected head.
>
> The only way you can get a reference to a DateTime is to box it, but then
> you lose the strong typing.
>
>
> PS > [string] $a=$null
> [C:\NeoCode\N2]
>
> PS > [DateTime] $a=$null
> Cannot convert null to type "System.DateTime".
> At line:1 char:14
> + [DateTime] $a= <<<< $null
>
> /Staffan
>
> "dreeschkind" <dreeschkind@discussions.microsoft.com> wrote in message
> news:039BA966-540F-415A-ACCC-C4D6BBC8BE68@microsoft.com...
> > "Staffan Gustafsson" wrote:
> >
> >> This could be represented as a DateTime. The problem is that the property
> >> is
> >> optional in EXIF.
> >> If represented as a string, you can allways return null or String.Empty,
> >> but
> >> then you lose all the goodness of the strong typing.

> >
> > Uhh, why do you think a DateTime property can't be null?
> > If a String can be null, any other object should be able to be null, too.
> >
> > --
> > greetings
> > dreeschkind

>
>
>

My System SpecsSystem Spec