ok, I call the following:
Type t = typeof(ISomething); // some interface
MemberInfo[] mi = t.GetMembers();
// but mi has length of 0
How can I iterate over the members of this interface?
Thanks
-KJ 6 1128
KJ,
When doing this for myself, I can get the members of an interface. The
only way it doesn't work is if ISomething has no methods on it (perhaps just
properties?).
What is the definition of ISomething? Can you post your code?
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"n_o_s_p_a__m" <n_**********@mail.com> wrote in message
news:1f**************************@posting.google.c om... ok, I call the following:
Type t = typeof(ISomething); // some interface MemberInfo[] mi = t.GetMembers();
// but mi has length of 0
How can I iterate over the members of this interface?
Thanks -KJ How can I iterate over the members of this interface?
Can you post the actual interface? It does have methods, right?
Mattias
--
Mattias Sjögren [MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Pls, check access level for members of your interface
Are there any public members?
Actually, all it does is inherit 5 other interfaces (all of which do have
methods); maybe this is the catch.
It looks like:
public interface IWFEXAPI :
IAuditingAPI,
IElementInstanceControlAPI,
IInstanceControlAPI,
IWorkItemAPI,
IWorkListAPI
{}
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ea**************@TK2MSFTNGP09.phx.gbl... KJ,
When doing this for myself, I can get the members of an interface.
The only way it doesn't work is if ISomething has no methods on it (perhaps
just properties?).
What is the definition of ISomething? Can you post your code?
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"n_o_s_p_a__m" <n_**********@mail.com> wrote in message news:1f**************************@posting.google.c om... ok, I call the following:
Type t = typeof(ISomething); // some interface MemberInfo[] mi = t.GetMembers();
// but mi has length of 0
How can I iterate over the members of this interface?
Thanks -KJ
Yura2000, All members in an interface have to be public.
"Yura2000" <yu***@clal-ins.co.il> wrote in message
news:13**********************************@microsof t.com... Pls, check access level for members of your interface. Are there any public members?
Ok, found the answer:
Type[] nestedTypes = typeof(IWFEXAPI).GetInterfaces();
ArrayList mis = new ArrayList();
foreach(Type t in nestedTypes) {
mis.AddRange(t.GetMethods());
}
mi = new MethodInfo[mis.Count];
mis.CopyTo(mi);
"Ken" <an***********@verizon.net> wrote in message news:<GG******************@nwrddc01.gnilink.net>.. . Yura2000, All members in an interface have to be public.
"Yura2000" <yu***@clal-ins.co.il> wrote in message news:13**********************************@microsof t.com... Pls, check access level for members of your interface. Are there any public members? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Maurice Ling |
last post by:
Hi,
I have read that this had been asked before but there's no satisfactory
replies then.
I have a module (pA) written in python, which originally is called by
another python module (pB), and...
|
by: lothar.behrens |
last post by:
Hi,
a long time ago I had implemented my version - or attempt - of a smart
pointer.
It is not well and most books I have read afterwards are using
templates :-(
It is macro based and now I...
|
by: McKirahan |
last post by:
Firefox does not reflect selected option via innerHTML
How do I get Firefox to reflect selected option values?
<html>
<head>
<title>FFinner.htm</title>
<script type="text/javascript">...
|
by: Bon |
last post by:
Hello all
Would it be possible to migrate the MS Access 2000 to MS SQL Server
2000?
My application is using MS Access 2000 as database and as user
interface such as forms. Now, I want to...
|
by: Dietmar Kuehl |
last post by:
Hi,
after reading the documentation on C# generics from several sources, I'm
still unclear whether it is possible to infer associated types from a
type argument. For example, if I have an...
|
by: KK |
last post by:
Hello all,
I have several classes binded by one common interface - say 'sum'
interface which calculates the sum of all the class elements of type
'int'.
class Alphabet
{
int _a;
int _b;
int...
|
by: Philip Daniels |
last post by:
I am doing some work with a client API via COM interop. I have
reached the situation where after this call to their API:
object someObj = con.Peek(1);
"someObj" contains some type of COM...
|
by: Mikhail Teterin |
last post by:
Hello!
I'm going through the fields of a class one at a time and need to handle
differently depending on whether they are arrays or scalars.
What's the right way to make the distinction? The...
|
by: lpinho |
last post by:
Hi all,
I have a class (named for the example myObject) that can be of
several types (int, string, float, etc), instead of using a object to
define it's type I used a generic.
public class...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |