Re: problems typecast,find by function/member name and getting "managed reference"
- From: "SunnyDrake" <sunnydrake@xxxxx>
- Date: 26 Sep 2006 16:58:55 -0700
Jon написав:
let me explain .. this *program and it's parts* may be used byNo, and then call methods in the interface.The normal way to overcome this is to use an interface if possible.and then use Runtime.InteropServices._Type.GetInterface Method (String)
I guess it depends on the exact situation - but I would *generally*
rather see a "strongly called" interface member than futz around with
reflection. It does depend though.
different peope:
coders which work's on some modules(not core),artists who add new gfx
and add info about it in XML resource list file and designers who via
tool or directly in XML will place objects/ai rules(logic)/actions
etc... so one of core script side task:
1) is to load XML
2) try to find requested command(which type/state is unknown , only
name in string(or hash number,btw. functions may be created/changed by
modules at
runtime or even via DCOM))
3) find appropriate type/object,initalize it in
C# type
4) perform actions on it,which described in XML(partialy solved thnx
to you).
So as i thnk reflection and dynamic types is a good way, but as
a former C++ coder i'v hardly hitted in typecast of C#, in this way C#
to be more *plastic* on base synatx have a long way to go....well you
can call me *stuped C# green*...but i wanna make long look on C# in my
coding(i'm buyed by some ideas and toolz :).
Object's don't have,some of (pre)boxed data have type and possibly canthanks it's was a great help!.Objects don't have names. What exactly do you mean?
now i only need find a way to get object by its name in string..
still have intalization variable name, other part of objects directly
after
initalization(in some type) putted in some ArrayList as objects.
Objects in my cases in original type is user classes, mostly have
inside (public string name;)
so i need to get collection of initalized objects of .GetType( *XML
suppiled type name*
) and/or get collection of initalized objects which in pre-boxed type
have public string name; == *XML suppiled value* in some domain
assembly.
?give struct of data,rule to access data parts in memory at runtime,atand still i'm not found a good solution to dynamicalyHang on - casting and unboxing are very different things. Casting at
typecast(unboxing) any *unknown type* to object at runtime.
runtime doesn't make sense because the point of casting is to give the
*compiler* more information, which clearly isn't relevant at runtime.
least this was so in C++!
this as i think was one of ideas to keep original GetType for objects
and for conversions
too...
Casting is not relevant if some data(and code data) is unmodified(in
compiled form)at
runtime(to get new type of data you need to make a copy of current with
new type) ,and make sense if same data at runtime maybe used in
different
means(types,forms,purpose) without modification or creating new data.
.
- References:
- problems typecast,find by function/member name and getting "managed reference"
- From: SunnyDrake
- Re: problems typecast,find by function/member name and getting "managed reference"
- From: Jon Skeet [C# MVP]
- Re: problems typecast,find by function/member name and getting "managed reference"
- From: SunnyDrake
- Re: problems typecast,find by function/member name and getting "managed reference"
- From: Jon Skeet [C# MVP]
- problems typecast,find by function/member name and getting "managed reference"
- Prev by Date: Re: Adding file version info to C# .NET program
- Next by Date: Re: List resize
- Previous by thread: Re: problems typecast,find by function/member name and getting "managed reference"
- Next by thread: Cookies and subdomains and IE6
- Index(es):
Relevant Pages
|