On 12/02/2008, Niblett, Alex <[EMAIL PROTECTED]> wrote:
> We have an old guidelines note to use IsAssignableFrom() followed by a
> hard cast as opposed to using the 'as' keyword followed by a check for
> null, but there is no explanation for why this approach should be used.
> There are also no com
Its because "Is" works similar to Type.IsInstanceOfType which is very
different from whether or not the type can be converted to the type.
Think explicit conversions, the type is not the interface but can be
converted to it.
It makes no difference between 1.1 and 3.5 the same issue applies.
Cheer
We have an old guidelines note to use IsAssignableFrom() followed by a
hard cast as opposed to using the 'as' keyword followed by a check for
null, but there is no explanation for why this approach should be used.
There are also no comments on the 'is' keyword approach to casting. Can
somebody ple
Thanks Eric, I'll Keep t hat in mind
-Original Message-
From: Eric Gunnerson [mailto:[EMAIL PROTECTED]
Sent: 26 January 2004 08:15
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Casting Problem
Paul,
I'm not sure I recommended this before or not, but running the fuslog
lf Of Paul Stevens
Sent: Sunday, January 25, 2004 11:54 PM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Casting Problem
I'm using Assembly.LoadFrom as the assemblies are "Add-Ins" that reside
on a shared folder where they are used by both the front end and a back
end component, the
r, problem
solved
-Original Message-
From: Heath Ryan [mailto:[EMAIL PROTECTED]
Sent: 24 January 2004 06:49
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Casting Problem
yep,
My mistake, I meant LoadFrom.
// Ryan
-
The information included in th
in
the immediate window but not anywhere else, obviously the .NET runtime has
no problem with the cast, why should C# have a problem?
-Original Message-
From: Heath Ryan [mailto:[EMAIL PROTECTED]
Sent: 24 January 2004 06:49
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Casting Problem
ppens if all of the files are placed into a single
folder, however that is not a perfect solution
-Original Message-
From: Eric Gunnerson [mailto:[EMAIL PROTECTED]
Sent: 23 January 2004 08:23
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Casting Problem
Assembly.Load should gi
Thanks that might be part of it, as I am using assembly.load
-Original Message-
From: Heath Ryan [mailto:[EMAIL PROTECTED]
Sent: 23 January 2004 06:30
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Casting Problem
Hi Paul,
Just a wild guess,
Are you using Assembly.Load ?
And
yep,
My mistake, I meant LoadFrom.
// Ryan
-
The information included in this message is personal and/or confidential and
intended exclusively for the addressees as stated. This message and/or the
accompanying documents may contain confidential information an
that you aren't compiling it separately into different assemblies.
-Original Message-
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Heath Ryan
Sent: Friday, January 23, 2004 8:30 AM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Casti
implicitly by the CLR.
HTH
// Ryan
-Original Message-
From: Paul Stevens
To: [EMAIL PROTECTED]
Sent: 1/23/2004 1:03 PM
Subject: [ADVANCED-DOTNET] Casting Problem
I've got a very weird problem,
Basically I have the following setup,
1. a Custom attribute class
2. a DLL that use
I've got a very weird problem,
Basically I have the following setup,
1. a Custom attribute class
2. a DLL that uses the custom attribute
3. a reader that checks a DLL for the custom attributes class
System.Attribute.IsDefined(t,typeof(Multichoice.Attributes.RuntimeConfig))
4.
p.com/devresources
- Original Message -
From: "Mark Bugeja" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 18, 2002 6:32 PM
Subject: Re: [ADVANCED-DOTNET] Casting
> Hi Pierre,
>
> There are a couple of methods you can use depending on what
AM
> To: [EMAIL PROTECTED]
> Subject: [ADVANCED-DOTNET] Casting
>
>
> Hi,
> to transform a structure to array of byte[] I am using the following
> procedure:
>
> public static unsafe byte[] StructToByte(MySimpleStruct
> simpleStruct) {
> byte[] arr = new byte[
> Syste
Hi,
to transform a structure to array of byte[] I am using the following
procedure:
public static unsafe byte[] StructToByte(MySimpleStruct simpleStruct)
{
byte[] arr = new byte[
System.Runtime.InteropServices.Marshal.SizeOf(simpleStruct) ];
fixed( byte* parr = arr )
{
*((MySimpleStruct
16 matches
Mail list logo